Evolution of Vertebrate Visual Pigments
James K Bowmaker and David M Hunt
Vision endows an animal with the ability to detect almost instantaneously the environment around it. A primary visual function must be the detection of objects against a background, but a visual system based solely on luminance differences can be confused if the brightness of either the object or the background is highly variable. This occurs, for instance, in shallow waters where surface wave ripples and reflections from the substrate can cause continuously variable luminance.
Such potential confusion can be overcome by adding a further dimension to the visual system, the ability to detect differences in the spectral composition of the environment, where spectral reflectance (colours) will be independent of luminance: this is therefore a possible explanation for the evolution of colour vision so early in vertebrate evolution.
One of my favorite articles explaining color vision and the emergence of trichromacy and dichromacy from tetrachromacy. It approaches the subject a bit from a functional standing to explain the shifts, but nevertheless does a thorough analysis of what we know thus far on color vision and phylogeny.