Here's why:
* Light is an electromagnetic wave: Light waves are a form of electromagnetic radiation, which means they are composed of oscillating electric and magnetic fields.
* Wavelength and frequency: The wavelength of a light wave is the distance between two successive crests or troughs of the wave. The frequency is how many wave crests pass a point in a given time. Wavelength and frequency are inversely related – shorter wavelengths correspond to higher frequencies, and vice versa.
* The visible spectrum: The human eye is sensitive to a narrow range of electromagnetic radiation called the visible spectrum. Different wavelengths within this spectrum correspond to different colors. For example:
* Red light has the longest wavelength in the visible spectrum.
* Violet light has the shortest wavelength.
* All the other colors (orange, yellow, green, blue, indigo) fall between these extremes.
In summary: The color of light is directly related to the wavelength (and indirectly to the frequency) of the light wave.