Tonee Gee coding corner

Wavelength to Color


Exploring our vision

For millions of years, human eyes have evolved to detect light in the range of 380—780nm, a segment of the electromagnetic spectrum known as “visible light.” This range aligns with a specific atmospheric window on Earth that permits the passage of these wavelengths while filtering out higher frequencies, like X-rays, and lower frequencies such as microwaves.

Sunlight appears white to our eyes because it radiates almost uniformly across all visible wavelengths. In contrast, lasers emit light at a single, specific wavelength, offering a unique color. This gives us a hint about how the frequency or wavelength of light relates to the colors we perceive.


When it comes to digital displays, the RGB (Red, Green, Blue) system is predominant. In this color model, each color is represented by values assigned to its three components — red, green, and blue. These values range from 0 to 255, allowing for: 256 x 256 x 256 = 16.7 million distinct colors.

However, the intricacy of human vision means we can perceive colors beyond the RGB color space’s boundaries. Given that there isn’t a definitive way to map a wavelength to a specific color due to the complexities of human color perception, any tool aiming to do so should be approached as a general guide rather than an authoritative source.

Color sensitivity of the human eye

In dim lighting conditions, our vision operates in “scotopic” mode, primarily relying on the rod cells in our retina. These rod cells are highly sensitive to wavelengths around 500 nm but play little, if any, role in discerning color.

In contrast, under brighter conditions such as daylight, our vision transitions to the “photopic” mode. Here, cone cells become the primary detectors of light and are instrumental in our ability to perceive color. These cones are responsive to various wavelengths, with peak sensitivity at around 555 nm.

For classification purposes, cones are typically categorized based on the wavelengths at which their sensitivities peak: short (S), medium (M), and long (L).

However, it’s essential to understand that these categories don’t directly map to specific colors in the way we typically perceive them. Instead, our perception of color results from a multifaceted process.

It begins with the differential signals from these photoreceptors in the retina and culminates in the visual cortex and associative regions of our brain, which interpret and craft our vibrant visual experience.

Above: relative brightness sensitivity of the human visual system as a function of wavelength in nanometers.
Above: normalized response spectra of human photo-sensitive cones, to monochromatic spectral stimuli, with wavelength given in nanometers.

However, as I pointed out, the relationship between wavelength and perceived color isn’t always straightforward:

Metamerism: Different combinations of wavelengths can produce the same perceived color. This phenomenon occurs because our eyes are only sensitive to the combined input from the three types of cones. For example, a mixture of red and green light can appear yellow, even though yellow also has its own specific wavelength.

Limitations of RGB: While the RGB color space can produce a vast array of colors, it doesn’t encompass all the colors the human eye can see. Other color spaces, such as CMYK (used for printing) or LAB (a perceptually uniform color space), have different gamuts that can represent colors not achievable in RGB.

Variation among individuals: Different people may perceive colors slightly differently due to variations in their cone cells. Some individuals might even have color vision deficiencies, like color blindness, affecting their perception.

Context: Color perception can also be influenced by surrounding colors. This is the basis for many optical illusions where the same color appears different depending on its context.