Color Memory Game
By John K.··13 min read

The visible light spectrum, measured: none of it fits on a screen

We took the CIE 1931 colour matching functions at 1 nm and tested every wavelength from 380 to 700 nm against sRGB. Zero of the 321 wavelengths can be displayed. The best a screen manages misses the real chromaticity by a median of 0.118 in u'v', roughly 36 threshold steps, and 93 nm of the red end collapses into one flat #FF0000.

Every explanation of the visible light spectrum arrives with the same picture. A horizontal strip, violet on the left at about 380 nm, red on the right at about 700 nm, six or seven colour bands of roughly equal width, all lit to the same cheerful brightness, blending into each other as they go. NASA has one. Wikipedia has one. Your physics textbook had one.

We ran that strip against the data it claims to represent, the CIE 1931 colour matching functions at 1 nm resolution, and the first result is short enough to say in a sentence. Not one of the 321 wavelengths from 380 to 700 nm can be shown on an sRGB screen. Not most of them. None of them. Every spectrum chart you have ever looked at is a set of substitutes, and we measured how far off each substitute lands.

What a screen actually puts on the glass

Pure light of a single wavelength sits on the outer boundary of human colour vision, the spectral locus. A display mixes three fixed primaries, which means everything it can produce lives inside the triangle those primaries define. That triangle covers about 33.5 percent of the area enclosed by the locus in CIE 1931 chromaticity, and critically the locus itself is the one curve the triangle can never touch except at three corners that are not on it either.

So a spectrum chart has to cheat. The standard approach, the one behind essentially every published strip, is to compute each wavelength’s true colour, throw away the negative primary values that come out, and scale what remains until one channel is at full output. That produces a colour with the right general flavour and the wrong chromaticity. Here is what it gets, wavelength by wavelength, with the miss measured in CIE 1976 u’v’, where a threshold step is around 0.0033.

Best a screen can doWavelengthMiss in u’v’Steps offBrightness
#7200FF380 nm0.1943590.004%
#7100FF400 nm0.1940590.040%
#6E00FF420 nm0.1904580.400%
#6100FF440 nm0.1614492.3%
#4F00FF450 nm0.1287393.8%
#1A00FF460 nm0.0747236.0%
#002DFF470 nm0.0440139.1%
#0087FF480 nm0.08772713.9%
#00ECFF490 nm0.11583520.8%
#00FFA2500 nm0.12743932.3%
#00FF4A510 nm0.12213750.3%
#00FF00520 nm0.10413271.0%
#00FF00540 nm0.05131695.4%
#96FF00560 nm0.0176599.5%
#FAFF00570 nm0.0162595.2%
#FFB400580 nm0.0146487.0%
#FF7B00590 nm0.0131475.7%
#FF4700600 nm0.0116463.1%
#FF0000620 nm0.06952138.1%
#FF0000650 nm0.15034610.7%
#FF0000680 nm0.1700521.7%
#FF0000700 nm0.1734530.410%

Across the full 380 to 700 nm range the median miss is 0.118 in u’v’, about 36 threshold steps. The worst is 0.194 at 403 nm. The best, at 600 nm, is 0.0116, still three or four steps away. There is no wavelength anywhere in the visible range that a screen renders correctly, and no wavelength it renders within a hair of correctly.

If you prefer CIEDE2000, the same comparison at matched luminance gives a median of 11.26 and a maximum of 30.35. Treat those as a floor rather than a measurement. CIEDE2000 divides chroma differences by a term that grows with chroma, and monochromatic light has chroma in the hundreds, so the formula quietly compresses exactly the error we are trying to size. The u’v’ figures are the honest ones. We kept both because the gap between them is itself a useful warning about using CIEDE2000 outside the range it was fitted on.

The bands are not remotely equal

The second thing the standard chart gets wrong is the part people actually read off it. Draw violet, blue, green, yellow, orange and red as blocks of similar width and you imply that each one contains a similar amount of colour. It does not work like that.

We walked the locus one nanometre at a time at matched lightness, so the only thing being counted is hue and chroma, and summed the perceptual distance. The whole spectrum from 380 to 700 nm is 254.2 CIEDE2000 long. Here is how that length is distributed against the wavelength widths the textbooks use.

BandRangeShare of widthShare of colour changeChange per nm
Violet380–450 nm21.9%6.4%0.231
Blue450–495 nm14.1%45.1%2.550
Green495–570 nm23.4%24.9%0.842
Yellow570–590 nm6.3%11.2%1.422
Orange590–620 nm9.4%9.5%0.802
Red620–700 nm25.0%3.0%0.095

Read the last two columns together. Blue occupies 14.1 percent of the wavelength range and delivers 45.1 percent of the visible colour change. Red occupies 25 percent of the range and delivers 3 percent. Per nanometre, blue changes colour 27 times faster than red. The fastest ten nanometres in the spectrum, 472 to 482 nm, cover 43.9 CIEDE2000 on their own, more than the violet and orange bands put together and nearly six times the whole of red. The slowest ten, 690 to 700 nm, cover 0.05. That is a ratio of about 867 to 1 between the busiest and the deadest stretches of a chart that draws them at the same scale.

This is not an artefact of the lightness we picked. Repeating the walk at luminance factors of 0.05, 0.1, 0.2 and 0.4 moves the total between 206 and 276 but leaves blue at 45 percent and red at 3 percent in every case, with the per nanometre ratio between 26.5 and 28.2. The shape is a property of the locus, not of the exposure.

Which is why a rainbow looks the way it does

Look at a real rainbow, or at our measurements of one in the order of the rainbow colours, and the red arc reads as one broad flat stripe while the blue to green region does all the visible work in a narrower space. People usually explain that with the geometry of the bow. Half of it is simply this table. The long wavelength end of the spectrum has very little colour variation in it to begin with.

A quarter of the chart is one single colour

Combine the two findings and something odd falls out of the rendering. Step through 380 to 700 nm at 1 nm and ask how many distinct 8 bit hex codes the best effort render produces. The answer is 144, from 321 wavelengths. Extend the strip to 780 nm, as plenty of charts do, and it is still 144. Those extra 80 nanometres of near infrared add nothing at all, because they are already indistinguishable from what came before.

The runs are worse than the count suggests:

  • 608 to 780 nm renders as #FF0000 and nothing else. That is 173 nanometres, one flat unchanging red, 43 percent of a 380 to 780 chart. Inside the more common 380 to 700 range it is still 93 nm, or 29 percent of the whole picture.
  • 515 to 552 nm all render as #00FF00. Thirty eight nanometres of pure green primary.
  • 380 to 390 nm is #7200FF, 391 to 404 nm is #7100FF, 405 to 412 nm is #7000FF. The violet end drifts by one unit in the red channel at a time and changes hue by essentially nothing.
  • In total, 54.8 percent of the 380 to 700 strip sits inside a run of five or more nanometres that share one identical colour. Over half the chart is constant.

Two separate things are happening here and they are worth keeping apart. Red 608 to 700 is flat partly because the spectrum genuinely has little colour change there, which the band table already showed, and partly because sRGB clips it all to the same corner of the cube. The green plateau is almost entirely clipping. The violet plateau is almost entirely the spectrum.

The brightness is the biggest lie in the picture

Spectrum diagrams are drawn at even brightness from end to end. The eye does not work that way at all. The 1924 photopic luminous efficiency function peaks at 555 nm, and if you shine equal radiant power at every wavelength, the ends of the strip are almost invisible.

  • 380 nm registers at 0.0039 percent of the 555 nm peak. One part in 25,641.
  • 400 nm is one part in 2,525. 420 nm is one part in 250.
  • 700 nm is one part in 244. 680 nm is one part in 59.
  • 19.3 percent of the 380 to 700 range, specifically 380 to 428 and 688 to 700, sits below one percent of peak efficiency. A fifth of the chart is territory the eye barely registers.

Split an equal energy white by band and the same story appears from the other direction. Green is 23.4 percent of the width and 54.8 percent of the perceived brightness. Yellow, at 6.3 percent of the width, contributes 16.1 percent. Violet is 21.9 percent of the width and 0.56 percent of the brightness. Nearly a quarter of the chart, by wavelength, accounts for about one two hundredth of what you would see.

Draw the spectrum honestly and it would be a bright hump around yellow green falling away to black at both ends, with most of the named colours crowded into the middle third. Nobody draws it that way because it photographs badly, but a prism on a windowsill does exactly this. The violet fringe is always the faint one, and that has nothing to do with the prism.

In defence of indigo

Newton split the spectrum into seven, and the internet has spent two decades explaining that indigo does not belong, that he only included it to match the seven notes of a musical scale, and that nobody can see a separate indigo band anyway. It is the single most repeated fact about the visible spectrum.

We measured the Newton bands at their usual wavelength assignments, in units of colour change rather than nanometres, and the argument comes out backwards.

  • Indigo, 420 to 450 nm: 14.8 CIEDE2000, about 6 just noticeable differences.
  • Red, 620 to 700 nm: 7.6 CIEDE2000, about 3 just noticeable differences, across a range nearly three times wider.
  • Violet, 380 to 420 nm: 1.4 CIEDE2000. One single step, across 40 nanometres.

Indigo contains roughly twice the visible colour change that red contains, and ten times what violet contains. If you want to delete a band from ROYGBIV on the grounds that it does not earn its place, the candidate is violet, which by this measure is one perceptual step wide and 0.56 percent of the brightness. Red survives only because it is so useful at the ends of things. We wrote more about the naming problem in what colour indigo is, and the short version is that the indigo objection is a vocabulary argument dressed up as a perceptual one.

What survives the trip to a screen

One last count. Walk the true spectrum at matched lightness and mark a new colour every time you have moved a full just noticeable difference from the last mark. You get 84 distinguishable colours between 380 and 700 nm. Do the same walk along the rendered strip, using the quantised 8 bit values a browser actually paints, and you get 63.

So a spectrum image on a screen keeps about three quarters of the distinct steps and loses a quarter of them, on top of putting every single one in the wrong place. The total journey shrinks from 254.2 to 205.9 CIEDE2000, a loss of 19 percent of the colour variety, almost all of it at the two ends.

Worth noting that 84 is lower than the figure from the classical wavelength discrimination literature, which lands nearer 150 distinct wavelengths. The two are measuring different things. Discrimination experiments ask whether a small side by side difference is detectable, which is a far more sensitive test than asking whether two colours are a full CIEDE2000 unit apart. Both numbers are in the same neighbourhood, which is reassuring for a formula being pushed to the edge of its range. Our piece on how many colours you can see works through why these counts vary so much by method.

Where the spectrum stops and colour keeps going

The strip also implies that the spectrum contains all the colours, which it does not. Magenta is nowhere on it, at any wavelength, because it is not a wavelength. We put a number on that in the measurement of magenta: 22.81 percent of the sRGB gamut is extra spectral, colours that no single wavelength can produce. The line of purples that closes the locus is real colour with no place on the chart.

The reverse is also true, and it is why metamerism exists. Because the eye reduces a whole spectral power distribution to three numbers, wildly different spectra land on the same colour. The spectrum chart suggests a one to one map between wavelength and colour. Only one direction of that map is a function.

How this was measured

Colour matching functions are the CIE 1931 2 degree standard observer at 1 nm from the Colour and Vision Research Laboratory tables, with the 1924 photopic luminous efficiency function from the same source. Each wavelength was converted to XYZ at unit luminance to hold chromaticity, then to linear sRGB with the IEC 61966-2-1 matrix and D65 white.

The rendered version clips negative primaries to zero and scales the remainder so the largest channel is at full output, which is the standard construction and the one that gives a published strip its appearance. Chromaticity error is Euclidean distance in CIE 1976 u’v’. Perceptual lengths are CIEDE2000 sums over consecutive 1 nm samples with luminance held constant, run at four different luminance factors to confirm the band shares are stable. Quantisation to 8 bit was applied before the rendered strip was re-measured, so the 63 figure reflects what a browser paints rather than what the float pipeline computes. Gamut area is the shoelace area of the locus closed by the line of purples against the sRGB primary triangle in CIE 1931 xy, quoted only because it is the familiar figure, since xy area is not perceptually uniform.

The short version

  • Zero of the 321 wavelengths between 380 and 700 nm are inside sRGB. Median chromaticity miss 0.118 u’v’, about 36 threshold steps.
  • Blue is 14 percent of the width and 45 percent of the colour change. Red is 25 percent of the width and 3 percent of the change.
  • 608 to 780 nm renders as one identical #FF0000. Over half the strip is constant colour.
  • 380 nm is one twenty five thousandth as bright as 555 nm at equal power. A fifth of the range is below one percent of peak.
  • Indigo holds twice the colour change of red. Violet, at one perceptual step across 40 nm, is the band with the weak case.

None of which makes the chart useless. It makes it a diagram of wavelength wearing the costume of a diagram of colour, and those two things are about 27 times out of step at one end of it.

Try the distances yourself

Every number above is a distance between two colours, which is also what the color memory game scores. It shows you a colour, takes it away, and measures how far your recall lands in the same CIEDE2000 units used throughout this article. If you would rather work in wavelengths of a sort, hue sort hands you a scrambled set of colours and asks you to put them back in spectral order, which is the closest thing here to rebuilding the strip by eye. Hex mode makes you name the code instead. There are more of them here, and a daily round if you want just one.

For more on the pieces this article leans on, see the just noticeable difference for where the 2.3 threshold comes from, RGB against CMYK for what happens to a gamut when you print it, and why the sky is blue for the case where the physics of one narrow band decides what you see.