Comparison between the inputs of photoreceptors with different spectral sensitivities is required for color vision. In Drosophila, this is achieved in each ommatidium by the inner photoreceptors R7 and R8. Two classes of ommatidia are distributed stochastically in the retina: 30% contain UV-Rh3 in R7 and blue-Rh5 in R8, while the remaining 70% contain UV-Rh4 in R7 and green-Rh6 in R8. We show here that the distinction between the rhodopsins expressed in the two classes of ommatidia depends on a series of highly conserved homeodomain binding sites present in the rhodopsin promoters. The homeoprotein Orthodenticle acts through these sites to activate rh3 and rh5 in their specific ommatidial subclass and through the same sites to prevent rh6 expression in outer photoreceptors. Therefore, Otd is a key player in the terminal differentiation of subtypes of photoreceptors by regulating rhodopsin expression, a function reminiscent of the role of one of its mammalian homologs, Crx, in eye development.