The retina which is located on the back of the eye, is composed of very closely spaced light-sensitive cells that are in connection with the brains via the optic nerve. The light signals that reach the light-sensitive cells, are transferred to the brains via the optic nerve. The brains takes these signals and translates them into the picture what is happening before our eyes.
Colors make us distinguish things around us better. But how do our eyes recognize colors and can animals observe different colors as well? The electromagnetic waves from the visible range are of different lengths. The longer waves are perceived by our eyes as red and orange, the shorter ones as green and blue. The light-sensitive cells of the retina consist of two types, rods and cones. The rods cannot distinguish color, but are on the other hand light sensitive and also detect very small light intensities. The cones do convert the received wavelengths in colors. Some mammals, in particular primates, have three different kinds of cones. One is sensitive to blue, the second is sensitive to green, and the third cone is sensitive to yellow-green and red. The brains process them into multicolored images. The cones can only process the colors when light is strong enough. That's why at night everything is seen in gray tones. Maybe it's because of that, it has long been assumed that animals that are active at night, like cats, could not recognize colors. We now know that all mammals are able to see colors to some extent.