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

What color is indigo: eight hex codes, one rainbow band, measured

Indigo is not one color. Eight named indigos sit a mean 19.26 CIEDE2000 units apart, the web color #4B0082 is not a color any wavelength can produce, and the rainbow band itself is only 3.24 units wide once it reaches a screen. Measured from the CIE 1931 observer and a ray trace through a raindrop.

Ask what color indigo is and you get three answers that do not agree. A dyer will show you a deep navy cloth. A web developer will type indigo into a stylesheet and get a dark aubergine purple. And anyone who learned the rainbow at school will point at a band between blue and violet that, when they go outside and look at an actual rainbow, is not there.

All three are defensible. None of them is the same color as the others. So rather than pick a side, I measured the lot: eight published hex codes that carry the name indigo, the band of the spectrum Newton assigned it, and the physical slice of a real rainbow it occupies. The numbers turn out to answer the two questions people actually ask, which are whether indigo is blue or purple, and why it is so hard to see.

Eight colors, one name

These are the named indigos in circulation. Every one of them appears in reference material, every one of them is called indigo, and they are not variations on a theme.

Indigo (color wheel)
#4000FF · L* 34.6, C* 131.2, hue 307.6 deg
Electric indigo
#6F00FF · L* 38.9, C* 126.8, hue 310.3 deg
Deep indigo, also sold as blue-violet
#8A2BE2 · L* 42.2, C* 102.3, hue 313.1 deg
Web indigo, the CSS keyword
#4B0082 · L* 20.5, C* 74.3, hue 314.1 deg
Web-safe indigo
#330099 · L* 20.1, C* 88.0, hue 308.9 deg
Imperial blue
#002395 · L* 21.5, C* 74.1, hue 300.7 deg
Tropical indigo
#9683EC · L* 60.6, C* 59.5, hue 301.5 deg
Indigo dye, the actual dyestuff
#00416A · L* 26.2, C* 29.0, hue 267.6 deg

Every hue figure on this page is a CIELAB hue angle, not the HSL hue your color picker shows. The two use different zero points and different geometry, so #4B0082 reads as 314 degrees here and 275 in a picker. Neither is wrong; they are answering different questions, and CIELAB is the one that corresponds to how far apart two colors look.

Run all 28 pairs through CIEDE2000 and the mean separation is 19.26 units. Twenty-three of the 28 pairs are more than 10 units apart. The widest pair, web indigo against tropical indigo, is 36.66, which is roughly the distance from a mid gray to a strong red. For scale, two colors stop looking like the same color somewhere around 2.3 units, a threshold I went into in detail in the piece on the just noticeable difference. Only one pair on the list, color wheel indigo against electric indigo, comes close to that at 4.60.

The hue column is where the argument lives. Seven of the eight sit between 300.7 and 314.1 degrees, which is the violet-purple quadrant. One sits at 267.6 degrees, forty degrees away, and it is the only one of the eight that describes a real substance. Indigo dye is a blue. Everything else called indigo is a purple.

What the rainbow's indigo actually is

Newton is the reason indigo is on the list at all. In Experiment 7 of the first book of Opticks he sets out the order plainly: the lights of several colours are more refrangible one than another, he writes, in this order of their colours, red, orange, yellow, green, blue, indigo, deep violet. Seven names, and the seventh is not plain violet but deep violet, which is worth holding onto.

Modern sources put indigo somewhere between 420 and 450 nanometers. Taking the most common boundaries, 430 to 450, and pushing each wavelength through the CIE 1931 two degree observer and out into sRGB, the band renders like this.

430 nm, indigo's long edge
#8700FF · hue 312.4 deg
440 nm, the middle of the band
#7F00FF · hue 311.6 deg
450 nm, the boundary with blue
#6F00FF · hue 310.3 deg

Two things fall out of that immediately. The first is that the rainbow's indigo is a violet-purple, hue 310 to 312 degrees, sitting right in the cluster with seven of the eight named indigos and nowhere near the dye. So when someone asks whether indigo is blue or purple, the honest answer is that the rainbow band is a purple and the dye is a blue, and the two are 24.50 units apart. They were never the same color. The word just got used twice.

The second is a small piece of housekeeping that turns out to validate the whole method. Electric indigo, #6F00FF, is a hex code that has been floating around color references for decades. My render of 450 nm came out at #6F00FF as well, to the byte, for a CIEDE2000 difference of 0.00. That is not a coincidence I engineered; it is what electric indigo was defined as, and getting it back out of an independent calculation means the colorimetry underneath everything below is behaving.

The CSS keyword is not a rainbow color at all

Web indigo, #4B0082, is the one most people meet, because it is one of the named colors you can type straight into a stylesheet. I converted it to chromaticity coordinates and drew a line from the white point through it to see which wavelength it corresponds to.

There is no such wavelength. The line leaves the diagram through the purple line, the straight edge that closes the horseshoe between the two ends of the visible spectrum. Colors on that side are non-spectral: they exist only as mixtures of long and short wavelengths, and no single wavelength of light produces them. Running the line the other way to get a complementary gives 565.8 nm, a yellow-green.

So the color CSS named after a band of the rainbow cannot appear in a rainbow. It is 18.55 units from the middle of the actual indigo band and only 10.86 units from CSS purple, #800080. If you have ever typed indigo expecting something inky and blue and got something that looked like an aubergine, the measurement agrees with you.

The dye goes the other way. Indigo dye at #00416A has a dominant wavelength of 477.9 nm, which is not in the indigo band at all but comfortably inside blue. Here is the part that made me check the arithmetic twice: plain CSS blue, #0000FF, has a dominant wavelength of 464.3 nm, which is only 14 nm from indigo's edge. Ordinary blue is a closer match to the rainbow's indigo than indigo dye is, by 9.07 units to 26.19.

Why you cannot find indigo in a rainbow

This is the complaint that fills the Reddit threads, and it has a numerical answer. The short end of the spectrum changes color far more slowly than the middle does, so a band that looks generous when you measure it in nanometers is nearly empty when you measure it in color.

400 nmevery 5 nm, rendered460 nm

I measured the spectral locus three different ways, because each one has a weakness and I wanted to know whether the answer survived all three.

  • CIE 1976 u’v’ arc length. Walk along the horseshoe in the chromaticity diagram designed to be roughly uniform and add up the distance. No gamut involved, no lightness involved.
  • Equal-luminance CIEDE2000 path. Normalize every spectral color to the same luminance, convert to CIELAB against D65 and sum the CIEDE2000 steps along the way. CIELAB is defined for any tristimulus value, so this also escapes the gamut problem, and it reports in units with a known threshold.
  • Rendered sRGB path. The same walk, but on the colors a screen can actually produce. This one is the harshest, because most of the spectral locus is far outside sRGB and the short end gets crushed hardest, but it is the version that matches what you see on a hex guessing screen or in a photograph.

All three land in the same place.

Bandu’v’CIELABsRGB
Red6.73%2.34%2.53%
Orange16.80%10.11%14.65%
Yellow12.48%13.57%21.54%
Green18.65%20.11%17.78%
Blue40.72%47.50%41.61%
Indigo3.52%4.56%1.43%
Violet1.10%1.80%0.46%

Indigo gets between 1.43 and 4.56 percent of the color change in the visible spectrum. Blue gets between 40.72 and 47.50. In the gamut-free CIELAB measurement the whole indigo band is 11.60 units wide, about 5 just noticeable steps, while blue is 120.80 units, about 52. Rendered to a screen it is worse: 3.24 units from one edge of indigo to the other, which is 1.4 steps. A single band you are told to identify, and it contains barely more than one distinguishable color.

It is worth being precise about what that does and does not claim. The middle of indigo is comfortably distinguishable from the middle of blue, by about 43 units when both are taken at the brightness a real bow gives them. What the 3.24 figure says is something narrower: the territory inside the band, from one boundary to the other, holds barely one step of color. Indigo is a real place on the spectrum. It is just an unusually small one.

That result does not depend on where you draw the boundaries. I tried four published sets: 430 to 450, the 420 to 450 given on Wikipedia, 425 to 450, and the 445 to 464 some textbooks use. Indigo comes out between 5.0 and 7.5 just noticeable steps every time, against blue’s 52.5.

The rate at which hue changes

The cleanest way to say it is in degrees of hue per nanometer. Across the 70 nm from 380 to 450, the rendered hue angle moves 2.7 degrees. Across the next 30 nm, from 450 to 480, it moves 52.7 degrees. Per nanometer that is 45 times faster. The spectrum spends its first seventy nanometers barely changing its mind and then swings through half the blues in thirty.

Indigo and violet sit in the slow part. Rendered, 400 nm and 430 nm come out at #8E00FF and #8700FF, a difference of 1.05 units, which is below the threshold at which anyone can tell two colors apart. Newton wrote deep violet rather than violet, and the measurement suggests he was reaching for a distinction the eye does not really support. The same effect is why our hue sorting mode gets brutal at the violet end of the strip: consecutive swatches there are genuinely closer together than they look anywhere else on the wheel.

The sky is fair to indigo. The eye is not.

Here is the part I did not expect. You could assume indigo is missing from rainbows because the band is physically thin. It is not.

I ran the standard minimum-deviation calculation for the primary bow, using a Cauchy fit for the refractive index of water, which gives 1.3307 at the red end and 1.3366 at 486 nm. The primary bow runs from an angular radius of 40.687 degrees at 400 nm out to 42.560 degrees at 700 nm, a total width of 1.873 degrees. Splitting that by the seven bands gives each one a physical share of the bow, which I can set against the share of the color it delivers. The gray bar is width, the yellow bar is color, and the number on the right is color divided by width.

BandWidthColorRatio
Red0.18
Orange1.86
Yellow3.39
Green0.87
Blue1.94
Indigo0.13
Violet0.01

Indigo takes 10.71 percent of the bow’s width and returns 1.43 percent of its color, a ratio of 0.13. Violet is the real scandal: it takes more than a third of the entire rainbow, the single largest share of any band, and gives back under half a percent. Yellow does the opposite, squeezing 21.5 percent of the color out of 6.4 percent of the width. Red is the third poor performer at 0.18, which is a useful corrective, because it means this is not a conspiracy against indigo. It is a property of both ends of the bow.

Then there is the blur. The sun is not a point source; it is a disc 0.533 degrees across, and every part of a rainbow is that disc smeared out. The indigo band is 0.2005 degrees wide, which is 0.38 solar diameters. The smear is 2.7 times wider than the band it is smearing. Even if your eye could pull indigo apart from its neighbors, the sky hands it to you already mixed with blue on one side and violet on the other.

Put those together and the disappearance is fully explained without anyone having to be wrong. The geometry gives indigo a reasonable strip of sky. The eye finds almost no color in it. The sun’s own size blurs whatever is left into its neighbors. I went through the full optics of the bow, including the diffraction that actually sets where each band falls, in the piece on rainbow colors in order.

So what do you tell someone

There is no single hex code for indigo, and anyone handing you one is picking a tradition without telling you which. The useful answer is to name the tradition first.

If you mean the rainbow band
#7F00FF · 440 nm rendered, a saturated violet-purple
If you mean the dye, the denim, the history
#00416A · dominant wavelength 477.9 nm, a dark blue
If you mean the CSS keyword
#4B0082 · non-spectral, 10.86 units from CSS purple

Those three are 18.55, 22.83 and 26.19 units apart from each other in a triangle. Not one of them is closer to another than a strong red is to an orange. Whoever you are talking to, it is worth thirty seconds to establish which one they have in their head, because otherwise you will both nod and mean different things.

My own view, after doing the arithmetic, is that the dye has the better claim and the worse luck. Indigo was the name of a substance for thousands of years before Newton borrowed it for a slice of light, and the substance is unambiguously blue. Newton borrowed it for a region that is unambiguously purple, and then the web borrowed it again for a region that is not on the spectrum at all. Each step moved further from the plant. If you want the color that the word originally meant, it is the one that sits forty degrees of hue away from all the others.

If you want to know whether you could actually pick any of these out of a line-up, that is a different question and a more entertaining one. The gap between naming a color and recognizing it is the whole premise of our name that color mode, and the short end of the spectrum, where 70 nm buys you 2.7 degrees of hue, is exactly where naming stops helping. Related reading on the neighbors: shades of blue, shades of purple, and what happens when you measure the color wheel itself.