The speed of light is about 300,000km/s. Light travels fastest in vacuum. As light passes through the material, the speed decreases slightly depending on the material.
The speed of light reduction depends on the type or density of the material.

If the speed of light in a vacuum is denoted as ‘1’, the speed is reduced to ‘1 / n’ as the light passes through an object. The value of n is called the refractive index of the object.

Even with the same material, the refractive index varies slightly depending on the wavelength.
For example, a red light (wavelength 700 nm) has a refractive index of 1.33 in water, while a purple light (wavelength 400 nm) has a refractive index of 1.34 in water.

Because each light has a different speed, it is differently refracted, so the degree of distortion is different. It is called spectrum that the light is separated by the color according to the wavelength.