Wavelength → sRGB
Approximate the sRGB color for a visible-light wavelength (380–780 nm).
Overview
The Wavelength → sRGB tool approximates the colour a viewer would perceive for a single wavelength of visible light between 380 and 780 nanometres. Drag the slider across the visible spectrum and the tool renders a swatch alongside its hex, RGB and approximate spectral-locus coordinates.
It is useful for physics demonstrations, building a spectrum gradient for an educational site, illustrating laser wavelengths in product UX, or matching an "approximate" colour to a wavelength callout in a scientific paper. Astronomers and lighting designers occasionally need it for narrow-band emission previews.
How it works
Single-wavelength colours sit on the spectral locus — the curved boundary of the CIE chromaticity diagram. The tool uses a widely-used piecewise approximation that breaks the 380–780 nm range into bands (violet, blue, cyan, green, yellow, orange, red) and assigns each band a polynomial in the R, G and B channels that fits experimental data.
Intensity rolls off at both ends of the visible range, where the eye's response is weak — between 380–420 nm and 700–780 nm a smooth attenuation factor multiplies all three channels. The final values are clamped to 0–1 and encoded as sRGB hex.
Examples
460 nm → #0085ff (blue)
520 nm → #67ff00 (green)
580 nm → #ffd000 (yellow)
620 nm → #ff8a00 (orange)
700 nm → #530000 (deep red, attenuated)
FAQ
Why does pure red dim above 700 nm?
The eye's red-cone response falls off sharply past 700 nm. Real spectral light at that wavelength is dim to viewers even when the source is bright, so the approximation attenuates the RGB output accordingly.
Are these colours physically accurate?
They are an approximation of human perception, not a measurement of the spectrum itself. Many spectral colours — pure greens around 520 nm, deep violets near 400 nm — fall outside the sRGB gamut and have to be desaturated to display.
Can I convert sRGB hex back to a wavelength?
Not uniquely. Most sRGB colours are produced by mixing wavelengths and have no single equivalent. The conversion is one-way unless the input was already a known spectral colour.
Why is magenta missing from the spectrum?
Magentas are non-spectral — there is no single wavelength of light that looks magenta. They are produced by combining red and blue, which is why they sit inside the chromaticity diagram rather than on its boundary.
What does the visible range cover?
Roughly 380–780 nm, with the centre 450–650 nm carrying the brightest perceptual response. Below 380 nm is ultraviolet; above 780 nm is infrared. Both fall outside human vision.