Colour vision

Colour vision is the capacity of an organism to distinguish objects based on the wavelengths (or frequencies) of the light they reflect, emit, or transmit. 
Colour is a quality made by the visual brain and so it is "not" a property of objects, despite what children are taught. 
The wavelength reflected from an object is the objective fact: it does not depend upon perception. A 'red' apple does not emit red light. Rather, it simply absorbs all the frequencies of visible light shining on it except for a group of frequencies that are reflected. It is these frequencies which are "perceived" as red.
Mechanism.
 The visible light spectrum ranges from about 380 to 740 nanometers. Colors of the spectrum such as red, orange, yellow, green, cyan, blue, and violet are in this range. These spectral colors do not refer to a single wavelength, but rather to a set of wavelengths: red, 625–740 nm; orange, 590–625 nm; yellow, 565–590 nm; green, 500–565 nm; cyan, 485–500 nm; blue, 450–485 nm; violet, 380–450 nm.
The nervous system derives colour by comparing the responses to light from the several types of cone photoreceptors in the eye. These cone photoreceptors are sensitive to different portions of the visible spectrum.
For humans, the visible spectrum ranges approximately from 380 to 740 nm, and there are normally three types of cones. The visible range and number of cone types differ between species.
With colour, vision gets better (more information) about the things the eye sees. This lets the eye see when fruit or vegetables are ripe, and can see animals hiding from plain sight. The advantage of colour vision is mainly in the daytime. At night the main problem is to collect enough light to see in the weak light. This is something rods do better than cones.
Types of colour vision.
Colour vision is not an all-or-none state. Many groups of animals can distinguish colour, but in different ways. In mammals, for instance, some groups have no colour vision, and some are dichromats. The dichromats have two kinds of cones, and cannot see ultraviolet, red and orange light. 
It is thought that the mammals which survived though the Jurassic period were small nocturnal or burrowing animals with little need to see colour. Later, after the extinction of the dinosaurs, many lines adapted to be more active in the daytime. Most developed a form of colour vision, which is much more useful in the daytime. Primates developed full (trichromacy) colour vision. For them, the ability to distinguish the colour of fruit from leaves always was essential.
Many insects have colour vision in the ultraviolet range, which humans do not. That is why honey guides on flowers are so noticeable in ultraviolet light photographs.