When light travels through a vacuum, its frequency remains constant. The frequency of light corresponds to its color or wavelength. In a vacuum, light maintains its original frequency, which determines its color.
However, when light encounters a medium, such as air, water, or glass, its speed changes. This change in speed can result in a phenomenon called refraction. When light passes from one medium to another, the change in speed causes the light to bend or deviate from its original path.
The change in speed of light when passing through a medium affects its wavelength, but not its frequency. According to the wave equation c = λν, where c is the speed of light, λ is the wavelength, and ν is the frequency, if the speed of light changes while the frequency remains constant, the wavelength must also change.
In different mediums, the change in wavelength leads to a change in the color of light perceived by an observer. This phenomenon is responsible for various optical effects, such as the bending of light in a prism or the dispersion of colors in a rainbow.
In summary, when light travels through a vacuum, its frequency (and therefore color) remains constant. However, when light passes through a medium, its speed changes, resulting in a change in wavelength and subsequently a change in the perceived color of light.