Light from the sun or from any very hot source is called white light. But, as Newton was the first to show, white light is really a mixture of light of al colours.
When a beam of light is made to pass through a glass prism, we see all the colours of the rainbow-red, orange, yellow, green, blue, and violet. Each shade blends gradually into the next without a break. this spread of colour is called a spectrum.
These colours are present in sunlight to begin with, but show up only after being spread out by refraction in the prism. Each colour is refracted a slightly different amount, red least and violet most. this spreading out is called dispersion. Without dispersion, the mixture gives the appearance of white to the eye.
Colour is determined by the wavelength of the light. the shortest visible light waves are violet; the longest are red.
most of the colours we see in our surroundings are not of a single wavelength, but are mixtures of many wavelengths. When white light falls on an object, some wavelengths are reflected, and the rest are absorbed by the material. A piece of red cloth, for examle, absorbs almost all wavelengths except a certain range of red ones. These are the only ones that are reflected to your eye, so you see the cloth as red.
So colour is a quality of light. It does not exist apart from light. All our colour sensations are caused by light rays entering our eyes. All objects are seen by reflected light, and the colours that they show exist in the light and not in the object.