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

Why are sunsets red: the measured answer, orange to purple

Rendered from the reference solar spectrum through a spherical atmosphere, the sun two degrees above the horizon comes out #FF8E00 with 2.38 percent of its light left. Rayleigh scattering does almost all of that reddening, haze does much less than people think, and the blue that arrives after sunset is made by the ozone layer.

A sunset is not a different phenomenon from a blue sky. It is the same scattering, run through about thirty-five times as much air. The sun sitting two degrees above the horizon renders at #FF8E00 with 2.38 percent of its light still arriving. At that moment red light is getting through 48 times more easily than blue.

That much is the standard story and it holds up. The parts that did not survive contact with the numbers are the popular extras. Dust and pollution turn out to be a poor way to buy redness. The bright glow wrapped around the setting sun is not Rayleigh scattering at all. And the blue you see overhead twenty minutes after sunset is not leftover daylight: strip one trace gas out of the model and that blue turns into a dull orange.

How I measured it

Same spectral toolkit as why the sky is blue and what color the sun is, with one change that matters: the atmosphere has to be round. At noon you can pretend the air is a flat slab. At sunset the light travels far enough that the curve of the planet sets the answer.

  • The light going in. ASTM G173-03, the reference solar spectra published by the US National Renewable Energy Laboratory. The extraterrestrial spectrum is sunlight before Earth touches it.
  • Molecular scattering. Rayleigh optical depth from Hansen and Travis, giving 0.0973 at 550 nm for a sea level column, distributed vertically with an 8 km scale height.
  • Haze. An aerosol layer with a 1.2 km scale height and an Angstrom exponent of 1.26 at an optical depth of 0.072, both taken from the fit in the sky piece rather than tuned here.
  • Ozone. Measured absorption cross sections from Serdyuchenko and colleagues, at a 300 Dobson unit column shaped as a layer centred on 22 km. The Chappuis band peaks at an optical depth of 0.0415 at 602 nm.
  • The geometry. Every optical path is integrated numerically through a spherical shell of radius 6,371 km, so a ray can graze the planet and come out the other side.

The check on all of that is that the three components have to add up to the extinction ASTM actually measured. Over 400 to 680 nm the model reproduces the reference beam to a root mean square error of 0.0139 in optical depth. Delete ozone and the same comparison degrades to 0.0351 with a systematic bias, which is a neat independent confirmation that the Chappuis band is sitting in the reference spectrum whether anyone mentions it or not.

The path length check is separate. Integrated through the sphere, the molecular air mass at the horizon comes out at 35.4 against the 37.9 that the standard Kasten and Young formula gives, the difference being refraction, which the model does not include. Ozone comes out at 12.3, because a layer sitting 22 km up is much less foreshortened than the dense air at your feet. Aerosol, packed into the bottom kilometre or two, comes out at 91.

Every color below is rendered under the CIE 1931 two degree observer and scaled so the brightest sRGB primary hits full. That shows the hue, which is the thing being argued about. It does not show the brightness, and the brightness is falling off a cliff as you go down these ladders.

The setting sun, one degree at a time

This is the sun’s own disc, not the sky around it. The dominant wavelength says which hue, the purity says how far it has travelled from white, and the last column is the part nobody quotes.

overhead#FFEDDC · 581.1 nm · 11.1% pure
30° up#FFE8CB · 579.5 nm · 17.9% pure
10° up#FFD496 · 579.6 nm · 40.0% pure
5° up#FFBA5D · 581.9 nm · 62.7% pure
3° up#FFA22B · 584.9 nm · 78.6% pure
2° up#FF8E00 · 587.8 nm · 87.4% pure
1° up#FF6F00 · 593.0 nm · 95.1% pure
on the horizon#FF2F00 · 604.0 nm · 99.3% pure

The light left over is 82.3 percent overhead, 34.2 percent at ten degrees, 2.4 percent at two degrees and 0.009 percent on the horizon. That last figure is roughly one part in eleven thousand, which is why you can look straight at a setting sun and why it is a terrible idea five minutes earlier.

Notice where the hue actually moves. Between overhead and ten degrees the dominant wavelength barely shifts, from 581.1 to 579.6 nm, while the purity nearly quadruples. The sun spends most of the afternoon getting more yellow rather than differently yellow. The swing into orange and red is all crammed into the last five degrees, which the sun crosses in about twenty minutes. That is the whole reason a sunset feels like an event rather than a gradient.

What is actually doing the reddening

The honest way to attribute this is to knock each component out and re-render. Sun at two degrees, everything else held fixed.

The real atmosphere
#FF8E00 · 587.8 nm · 87.4% pure
With the aerosol removed
#FFA528 · 584.2 nm · 79.1% pure
With the ozone removed
#FF8B00 · 588.0 nm · 90.4% pure
With molecular scattering removed
#FFDDC2 · 583.2 nm · 20.0% pure

Take the haze away and the sunset is still a sunset: 79.1 percent pure instead of 87.4. Take the ozone away and almost nothing happens to the disc. Take the air molecules away and the sunset collapses to 20.0 percent purity, a washed out cream. Roughly four fifths of the color in a sunset is plain molecular scattering by clean air.

Which brings up the folk claim that pollution makes sunsets better. It does redden them, and the model says so. It is just a bad trade. Here is the same sun at two degrees under five aerosol loads, from a scrubbed maritime sky to something you would not want to breathe.

AOD 0.02#FF9E1A · 585.2 nm · 8.28% of the light
AOD 0.072#FF8E00 · 587.8 nm · 2.38% of the light
AOD 0.15#FF7800 · 591.5 nm · 0.38% of the light
AOD 0.30#FF5100 · 598.5 nm · 0.012% of the light

Going from a clean sky to a heavily loaded one buys 13.3 nm of extra redness and costs 2.86 decades of brightness, a factor of 720. That is 4.67 nm of hue per decade of light thrown away. Simply waiting for the sun to drop from ten degrees to two buys 8.2 nm for 1.16 decades, or 7.06 nm per decade. Patience is 1.51 times more efficient than smog.

The reason is that aerosol extinction is nearly grey. Between 420 and 680 nm, molecular scattering changes by a factor of 7.16. Aerosol changes by a factor of 1.84. Haze mostly removes light rather than selecting a color, so it dims a sunset far faster than it reddens it. A wildfire sky looks dramatic because it is dark and strange, not because it is saturated.

Why is the sky orange, and not just the sun

The disc is the easy half. The sky is lit by scattering, and scattering prefers blue, so the sky above a red sun ought to fight back toward blue. It does not, and the reason is not the one I expected.

With the sun on the horizon, this is the western sky straight above it. These are the numbers behind the phrase “sunset colors”.

1° up#FF6500 · 594.7 nm · 96.4% pure
2° up#FF7E00 · 590.5 nm · 91.4% pure
3° up#FF8E04 · 588.1 nm · 85.0% pure
5° up#FFA346 · 585.7 nm · 70.7% pure
7° up#FFB168 · 584.6 nm · 57.8% pure
10° up#FFC18B · 584.1 nm · 42.2% pure
14° up#FFD1AF · 584.3 nm · 27.0% pure
20° up#FFE4D7 · 586.9 nm · 11.3% pure
30° up#F9F5FF · purple line · 5.1 chroma
45° up#DAE8FF · 477.3 nm · 10.9% pure
overhead#C6DFFF · 478.6 nm · 16.5% pure

The sky next to the setting sun comes out at 588.1 nm, which is redder than the disc itself at 587.8 nm. Rayleigh scattering should have pulled it the other way. So I ran it again with the aerosol deleted, and the sky flipped to 581.7 nm against a disc at 584.2, a shift of 2.4 nm toward blue and a color difference of 4.88 dE00.

The bright halo around a setting sun is aerosol forward scattering, not molecular scattering. At 15 degrees from the sun, 83.6 percent of the scattered light in the model is coming off haze particles rather than air molecules, because a Henyey-Greenstein phase function at g = 0.70 throws light forward hard while Rayleigh scattering spreads it evenly. Haze scatters nearly grey, so the halo simply reproduces whatever color the beam already is. That is exactly why it looks like the sun bleeding into the sky instead of a blue glow around a red disc. By 90 degrees from the sun the aerosol share has fallen to 21.7 percent, and normal service resumes.

The orange goes all the way around

Looking three degrees above the horizon with the sun setting, here is what happens as you turn your back on it.

towards the sun#FF8E04 · 588.1 nm · 85.0% pure
45° around#FFAE40 · 583.3 nm · 72.8% pure
90° around#FFAF3F · 582.9 nm · 73.1% pure
135° around#FFA732 · 584.1 nm · 76.9% pure
directly away#FF9400 · 586.8 nm · 85.4% pure

The horizon opposite the sunset is 85.4 percent pure, very slightly more saturated than the horizon the sun is actually setting into. The whole ring is warm, with a shallow minimum at right angles, because the Rayleigh phase function is symmetric front to back and the light illuminating that far horizon has crossed just as much atmosphere. Photographers know this as the Belt of Venus and mostly shoot the other way. The model says the eastern horizon is the better target for saturation, by a small but real margin.

Why is the sky pink

Pink is not a separate mechanism. It is the same orange band read at lower purity, and the ladder above shows exactly where it lives: between roughly 10 and 20 degrees above the horizon, where the dominant wavelength is still parked at 584 nm but the purity has fallen from 42 percent to 11. #FFD1AF and #FFE4D7 are the pinks, and they are pale because that part of the sky is lit by a beam that has not been reddened quite as hard, scattered through more air on the way to you.

This is worth saying plainly because the search results for pink skies are full of people looking for a second cause. There is not one. A pink sky is an orange sky with the saturation turned down, which is also all a shade of pink ever is next to a shade of red. The reason it reads as a different color rather than a weaker one is that your visual system is comparing it against the deep orange sitting immediately below it in the same view.

Why is the sky purple

Purple is different, and the model does produce it. With the sun exactly on the horizon, the sky at 30 degrees elevation lands on the purple line of the chromaticity diagram: a complementary dominant wavelength of 565.4 nm, a hue angle of 304 degrees, and a color difference of 5.32 dE00 from neutral. It renders as #F9F5FF. The band of purple hues spans 26 to 30 degrees, and as the sun sinks to two degrees the band lifts to 39 to 42 degrees and fades.

A purple that far from any spectral wavelength can only be a mixture. It sits precisely at the seam where the warm band running up from the horizon meets the blue coming down from the top of the sky. Long wavelengths from below, short wavelengths from above, nothing much in the middle, and the result crosses out of the spectrum entirely. It is the same trick as a complementary pair mixing to something no single wavelength can make.

The honest caveat: at 5.32 dE00 from neutral, the model’s purple is a hint, and the twilight purples people photograph are far stronger than that. Single scattering puts the orange and the blue next to each other cleanly, and it takes multiple scattering to smear them into the same line of sight properly. I added a crude second scattering order and it contributed about one percent of the radiance, which is not enough. The model gets the mechanism and the location right and understates the intensity.

The blue after sunset belongs to the ozone layer

This is the result that made the piece worth writing.

Once the sun is below your horizon, the light reaching the sky above you has grazed the planet. Its path skims through the upper atmosphere, missing most of the dense air but crossing the ozone layer nearly edge-on. Ozone’s Chappuis band absorbs in a broad hump centred at 602 nm, right in the orange. So the beam that lights your twilight has had its orange eaten out of it before it arrives.

Here is the same twilight sky computed twice, once with the real ozone column and once with the ozone deleted and nothing else changed.

Sun 2° below, 30° up
#CFE2FF#FFF2D7 · 26.79 dE00 apart, hue angle 178° apart
Sun 4° below, 45° up
#AECDFF#FFF4DF · 29.14 dE00 apart, hue angle 176° apart
Sun 6° below, overhead
#A2C8FF#FFF4E2 · 29.75 dE00 apart, hue angle 174° apart

Without the ozone layer, twilight would not be blue. It would be a pale dirty orange, from the horizon to the zenith. The two versions sit almost exactly opposite each other on the hue circle, 174 to 178 degrees apart, at differences of 27 to 30 dE00. For scale, the just noticeable difference is around 2.3, so this is roughly a dozen times past obvious.

The mechanism is worth stating carefully, because it is not the daytime answer. In daylight the sky is blue because scattering favours short wavelengths, and I put numbers on that in the sky piece. After sunset the beam has been through so much air that the blue in it is long gone. What remains would be orange, and it is ozone absorption, not scattering, that removes the orange and leaves the residual blue. Two different mechanisms, one color, separated by twenty minutes.

The corollary is that the color of the sky after sunset is a readout of how much ozone is overhead. Running the model across the real range of total column values:

220 Dobson units, a thin column
#C4DCFF · 477.6 nm · 17.5% pure
300 Dobson units, the global mean
#AECDFF · 476.8 nm · 25.1% pure
400 Dobson units, a thick column
#98BEFF · 476.0 nm · 33.0% pure

That is a visible spread, and it runs the direction you would guess: more ozone, deeper twilight blue. It is also why twilight photographs taken in different seasons or latitudes are not comparable, and why colorimetric twilight measurements were used to estimate ozone before satellites existed.

How many colors are in one sunset

A last measurement, since this site is built around telling colors apart. Walking from just above the horizon to straight overhead, counting every step of 2.3 dE00 or more using CIEDE2000:

  • At sunset: 28 distinguishable steps, from #FF4900 to #C6DFFF, 47.3 dE00 end to end.
  • With the sun at 60 degrees: 15 steps, from #FFEAD2 to #CFDFFF, 24.9 dE00 end to end.

A sunset sky carries nearly twice the color range of a midday one, in the same 90 degrees of arc. The first ten waypoints of that climb, each one a visibly different color from the last, are #FF4900, #FF5B00, #FF6800, #FF7500, #FF8100, #FF8C00, #FF9626, #FFA03E, #FFA852 and #FFAF63, all inside the first seven degrees above the horizon. That is ten distinguishable shades of orange stacked into a band about the width of your thumb at arm’s length.

Reading those as hex codes, the green channel does all the work: red pins at FF the whole way and blue stays at 00 for the first six steps. Sunset color is very nearly a one dimensional family, which is why guessing sunset hexes is easier than it looks and why the color memory game puts far harder things in front of you.

What this model does not do

  • No refraction. The atmosphere lifts the sun by about 0.57 degrees near the horizon, so when it looks like it is touching, it has geometrically already set. Every horizon figure here is therefore slightly optimistic about how much light survives.
  • Single scattering. Light is scattered once and delivered. That understates the purple, understates twilight brightness, and is the reason the second scattering order I tried contributed only a percent.
  • No clouds. Which is a real omission, because most of what people photograph at sunset is cloud lit from below by exactly the reddened beam in the first ladder. The cloud is white; the light hitting it is #FF6F00.
  • One aerosol type. Non-absorbing, with a fixed size distribution. Real smoke absorbs, which would darken further and shift things brown. The aerosol scale height barely matters: sweeping it from 1 to 3 km moves the setting sun from 587.9 to 587.4 nm.

None of which touches the headline results. The reddening attribution, the aerosol trade, the forward-scattered halo and the ozone counterfactual are all differences of tens of dE00 between models that share every assumption except the one being tested.

The short version

  • The setting sun at two degrees is #FF8E00 with 2.38 percent of its light left, and red is getting through 48 times more easily than blue.
  • Clean air does about four fifths of the reddening. Removing molecular scattering drops purity from 87.4 to 20.0 percent.
  • Haze reddens at 4.67 nm per decade of lost light against 7.06 for simply waiting. Pollution makes sunsets dimmer far faster than it makes them redder.
  • The glow beside the sun is 83.6 percent aerosol forward scattering, which is why it matches the sun’s color instead of opposing it.
  • Pink is orange at lower purity. Purple is a genuine mixture at the seam between the warm band and the blue, 26 to 30 degrees up at sunset.
  • Twilight blue is made by ozone absorption, not by scattering. Remove the ozone and it turns orange, 29 dE00 and 176 degrees of hue away.

If the numbers here were interesting, the companion pieces run the same machinery at other targets: the daytime sky, the ocean, the sun itself, and the color temperature scale that everyone quotes and few people have plotted. Or go and try to tell two of those sunset oranges apart in the daily challenge.