The reason lies in the fact that, while the speed of light is constant in vacuum for all colours, it depends on the wavelength of light when it passes through a medium. We know that refractive index is the ratio of speeds in vacuum and in the medium. Consequently, the refractive index of a medium depends on wavelength of light. When white light passes through a medium, each colour selects its least time path and we have refraction of different colours to different extents. This results in separation of colours, producing a spectrum on the wall and in the mirror as we saw in activities (3) and (4. It has been experimentally found that refractive index decreases with an increase in wavelength. If we compare the wave lengths of seven colours in VIBGYOR, red colour has longest wavelength and violet colour has shortest wavelength. The refractive index of red is low hence it suffers low deviation.
We noticed that when white light passes through a prism, it splits into seven colours. Let us assume that you have sent a single colour ray through the prism.
We know that the frequency of light is the property of the source and it is equal to number of waves leaving the source per second. This cannot be changed by any medium. Hence frequency doesn't change due to refraction. Thus coloured light passing through any transparent medium retains its colour.
While refraction occurs at the interface, the number of waves that are incident on the interface in a second must be equal to the number of waves passing through any point taken in another medium. This means that the frequency of the light wave remains unaltered while its wavelength changes depending on the medium through which it passes. We know that the relation between the speed of wave (v), wavelength (λ) and frequency (υ) is.
v=uλ (frequency denoted by υ)
For refraction at any interface, v is proportional to . Speed of the wave increases with increase in wavelength of light and vice versa.
Your answer certainly is a rainbow. That is a good example of dispersion of light.
Let us see how.