To our eyes, the world is arrayed in a seemingly infinite splendor of hues, from the sunny orange of a marigold flower to the gunmetal gray of an automobile chassis, from the buoyant blue of a midwinter sky to the sparkling green of an emerald. It is remarkable, then, that for most human beings any color can be reproduced by mixing together just three fixed wavelengths of light at certain intensities. This property of human vision, called trichromacy, arises because the retina the layer of nerve cells in the eye that captures light and transmits visual information to the brain uses only three types of light-absorbing pigments for color vision. One consequence of trichromacy is that computer and television displays can mix red, green and blue pixels to generate what we perceive as a full spectrum of color.
Although trichromacy is common among primates, it is not universal in the animal kingdom. Almost all nonprimate mammals are dichromats, with color vision based on just two kinds of visual pigments. A few nocturnal mammals have only one pigment. Some birds, fish and reptiles have four visual pigments and can detect ultraviolet light invisible to humans. It seems, then, that primate trichromacy is unusual. How did it evolve? Building on decades of study, recent investigations into the genetics, molecular biology and neurophysiology of primate color vision have yielded some unexpected answers as well as surprising findings about the flexibility of the primate brain.
I recommend the Nature link; you can get easily get the entire pf.