There was a famous and controversial (at the time) science fiction story published by E.C. Comics in 1953, "Judgment Day". A human astronaut visits a planet inhabited by sapient robots in order to determine if they're ready for membership in a Federation-style organization. Some robots are orange, and others are blue, with the orange robots being in charge while the blue robots perform menial or unpleasant jobs, live in squalor, and have few rights. The orange robots claim that this is natural, since the blue robots are intellectually inferior and can't do any better, but the robots are physically identical other than their color. The real difference is that the orange robots receive full educational programming when constructed, while the blue robots only receive rudimentary programming, forcibly keeping them in their inferior position.
(The controversy came from the final panel, in which the astronaut removed his helmet and was revealed to be black, producing a reaction similar to what was shown in the DS9 episode "Far Beyond the Stars" when it was reprinted in 1956, post-Comics Code.)