At sunset, the light coming straight from the sun has crossed so much air that most of its blue has been scattered away, which is why the sun turns orange. Half an hour later the sun is below the horizon, and every bit of light in the sky is that same sunlight, scattered towards you after an even longer trip. You would expect the sky overhead to turn orange too. Instead it turns the deepest blue of the day.
Rayleigh scattering, the textbook reason the sky is blue, can't do this on its own. In 1953 E. O. Hulburt worked out that most of the twilight blue comes from somewhere else: ozone, twenty-odd kilometres up, which absorbs orange and yellow light in a broad band called the Chappuis band. I wanted to see that for myself, so I built the sky from scratch: a round Earth, real air, a little haze, an ozone layer, a measured solar spectrum, and light followed through as many bounces as it takes. Then I ran the same evening with the ozone taken out.
The panorama above is that model. Nothing in it is painted. Move the clock to set the sun's height, drag the sky to look around, and switch the ozone between today's amount, an ozone hole, and none at all.
Take the ozone away
Without ozone the evening goes differently. The sunset itself hardly changes: there's still a glow low in the west, a little more golden. But the sky overhead never deepens. By the time the sun is a few degrees down the zenith is a pale, faintly warm grey, and later in twilight it goes slightly peach. There is no blue hour.

With ozone (300 DU)

Without ozone
The other side of the sky changes too. Face east just after sunset and you normally see the Earth's shadow, a blue-grey band along the horizon, with the pink Belt of Venus above it. In the model both colours depend on ozone. With the sun 1° down, the shadow's chromaticity is (0.29, 0.31) and the belt's is (0.34, 0.34), just to the pink side of white. Without ozone they are (0.35, 0.36), a dull tan, and (0.40, 0.39), orange. Ozone takes the middle of the spectrum out of the light that reaches them, and red plus blue reads as pink.

With ozone: the Earth's shadow and the Belt of Venus

Without ozone
A cyanometer for one evening
In 1789 Horace-Bénédict de Saussure measured the blueness of the sky with a cyanometer: a ring of 53 paper squares dyed with Prussian blue, from white through deepening blues to black, held up against the sky to find the closest match. Here is one for this evening. Each ring follows the zenith clockwise, from the sun 10° up to 14° down, for a different amount of ozone. 300 DU is about the global average today, 100 DU is the depth of the Antarctic ozone hole in a bad year, and 500 DU is a thick high-latitude spring layer.
The inner ring, with no ozone, is the whole argument in one picture. It starts the evening nearly as blue as the others, but it whitens as the sun sets and finishes in the warm greys. The rings with ozone go the other way: the deeper into twilight, the bluer they get.
Sunbeams that come out blue
Why ozone? Follow the light. Once the sun has set, the air above you is lit by sunbeams that skimmed past the Earth somewhere to the west. A beam that skims low ploughs through dense air and arrives deep red, or not at all; the unlit air beneath those beams is the Earth's shadow, which you can see rising in the east as a blue-grey band. A beam that skims higher misses most of the air, but it runs for hundreds of kilometres along the ozone layer, edge on, instead of crossing it.
With the sun 4° down, half the zenith's once-scattered light comes from above 34 km, from beams whose lowest point was in the stratosphere. With the sun 6° down, that height is 58 km. A beam that grazes at 20–25 km has lost some of its blue to Rayleigh scattering, but along that path ozone takes even more of the green, yellow and orange, leaving the blue and the red. In the model such a beam, followed all the way through the atmosphere, comes out bluer than sunlight: chromaticity (0.28, 0.29), against the sun's own (0.32, 0.33). Without ozone the same beam comes out a warm yellow-white, at (0.38, 0.39). Scatter that light down to the observer, which favours blue once more, and you have the twilight zenith.
The bite out of the orange
Divide the zenith's spectrum with ozone by the spectrum without it, and you get the share of each wavelength that the ozone lets through. At sunset the ozone already takes 50% of the zenith's light at 600 nm. As the sun sinks, the beams that light the zenith run longer and longer through the layer, and the bite deepens.
How much of the zenith's light survives the ozone, by wavelength
Two-thirds at sunset, then most of it
How much of the zenith's blueness is ozone's doing? Anna Lange, Alexei Rozanov and Christian von Savigny (2023) put a number on it. Measure how far the sky's colour sits from white on the CIE chromaticity diagram, with and without ozone, and call the difference ozone's share. With the sun on the horizon they found 66% for 300 DU, close to Hulburt's two-thirds. Their study stops at sunset, which is where this page's evening is only beginning.
Given their aerosol, my model gives 43%, 69% and 79% for 100, 300 and 500 DU, against their 39%, 66% and 76%: consistently about three points higher, from different code with different ingredients. (My default, hazier air gives 69% for 300 DU.) Then it carries on. By the time the sun is 3° down ozone's share is 92%, and from there to the end of nautical twilight it stays between about three-quarters and all of the blue, depending on the haze.
Ozone's share of the zenith's blueness
In my default air, and in hazier air, the evening goes one step further. Past about −7.5° the no-ozone zenith crosses to the yellow side of white, so Rayleigh scattering is no longer making the zenith blue at all, and ozone accounts for more than all of its blueness. Lange's metric can't show that, because it measures distance from white without regard to direction. If I project the no-ozone colour onto the direction of the with-ozone colour instead, the share averages 110% between −8° and −10°. In the cleanest air I tried, the no-ozone zenith never quite crosses: it stays a whisker on the blue side of white, and ozone's share settles at 81–85%. Either way, by deep twilight the blue overhead is ozone's work far more than Rayleigh's.
Dimmer, and mostly second-hand
Ozone pays for the blue in brightness. At sunset it takes 35% of the light from the zenith, and by the end of civil twilight 56%. By then most of the light overhead isn't once-scattered sunlight at all. It has scattered at least twice, typically first in the bright sky low in the west and then down to you. With the sun 9° down, nearly all of it has.
Brightness of the zenith
Share of zenith light scattered more than once
That grey band is a caution about every colour on this page. The images show what a camera set to daylight white balance would record. Your own eyes, by the time the sun is 6° to 8° down, are working in the mesopic range, and the sky's colour fades for you just as it deepens for the camera. The rods that take over are most sensitive to blue-green light, which may push the sky bluer still. I haven't modelled the eye.
Show the numbers behind the charts
Over the ozone hole
Under the Antarctic ozone hole, the model says, twilight should be pale. At 100 DU ozone's share at sunset falls to 42%, and through civil twilight the zenith stays a washed-out blue. Try the “ozone hole” setting at .
The real sky may not oblige. Raymond Lee, Wolfgang Meyer and Götz Hoeppe photographed and measured twilight at Germany's Neumayer Station during the 2005 ozone hole, and found only weak correlations between ozone and twilight colour. In their data, aerosols seemed to matter as much as ozone.
I wondered whether the shape of the hole could explain that. A real ozone hole isn't a uniform thinning: the ozone is destroyed in the lower stratosphere and survives above it. So I gave the model a polar-like ozone layer peaking at 18 km, cut 97% of it out between 12 and 26 km to leave 110 DU, and compared that with the same 110 DU removed evenly. I expected the realistic hole to do less damage, because the beams that light the zenith climb as the sun sinks.
I had it backwards. The realistic hole costs more blue than the even thinning, at every sun angle from sunset to −12°. The beams that carry once-scattered light to the zenith graze the Earth at a median height of 16 to 23 km between −1° and −8°, which is exactly where the hole is. So the shape of the hole doesn't explain Lee and colleagues' weak correlations. If anything it should make them stronger. Haze, polar stratospheric clouds and the sheer variety of real skies are the likelier explanations, and I haven't modelled any of them.
How I built it
A spherical Earth, 6,371 km in radius, under 100 km of atmosphere with three ingredients. The air follows the US Standard Atmosphere 1976 and scatters by Rayleigh's law, using the Bodhaine et al. (1999) cross-section. The haze is a boundary layer of optical depth 0.08 at 550 nm plus a thin stratospheric veil, scattering mostly forwards (Henyey–Greenstein, g = 0.7). The ozone is 300 DU by default, peaking at 22 km, with absorption cross-sections measured at 223 K by Serdyuchenko, Gorshelev and colleagues in Bremen. Sunlight is the ASTM G-173 spectrum from above the atmosphere, in 41 bands from 380 to 780 nm.
Once-scattered light is integrated along each line of sight. Everything else is Monte Carlo: paths traced backwards from the eye and scattered by air, haze or ground, with the sunlit stretch of every path segment integrated exactly. That trick is what makes deep twilight tractable, because by then only a thin, high shell of air is still in sunlight. Wavelengths share a path, and sampling uses a mixture over wavelengths so that no wavelength's weight can run away. Spectra become colours through the CIE 1931 observer and are shown in sRGB, with one exposure per moment shared by all three ozone settings. The engine is about 700 lines of C, driven from Python.
| Check | Model | Reference |
|---|---|---|
| Air pressure at 11, 20 and 32 km (US Standard Atmosphere 1976) | 22,633, 5,475, 868 Pa | 22,632, 5,475, 868 Pa (standard tables) |
| Rayleigh optical depth of the whole atmosphere at 550 nm | 0.0971 | 0.0973 (Bodhaine et al. 1999) |
| Sun-column look-up table against direct integration, worst case where transmittance > 10−4 | 0.7% error | — |
| Once-scattered light with the integration step cut fourfold | changes < 0.1% | — |
| Multiple scattering from two independent Monte Carlo estimators, sun +5° to −4° | agree within 2–5% | — |
| Ozone's share of the zenith's blueness at sunset, with Lange et al.'s aerosol: 100, 300, 500 DU | 43%, 69%, 79% | 39%, 66%, 76% (Lange et al. 2023) |
| Light on level ground from the whole sky at sunset: sun's centre on the horizon, and at −0.83° (the almanac's sunset, upper limb on a refracted horizon) | 951 and 600 lux | about 330–585 lux (see notes) |
| Light on level ground when civil twilight ends (sun 6° down) | 4.0 lux | about 2–3.5 lux, often quoted as 3.2–3.4 (see notes) |
| Light on level ground when nautical twilight ends (sun 12° down) | 0.008 lux | about 0.008 lux (widely quoted; from memory) |
What I'm unsure of
Refraction is left out. It bends grazing beams by about half a degree, which shifts the timing of everything a little and lifts the Earth's shadow. Polarisation is left out, which Lange et al. found changes their colours by about 1%. The haze is one choice among many, and twilight colour is sensitive to it: with hazy air (optical depth 0.25) ozone's share at sunset is 67% rather than 69%. The ozone layer is idealised: a smooth bump with cross-sections at a single temperature. The sun is treated as a point, and the model atmosphere ends at 100 km, which only matters once the sun is 10° down and there is almost no once-scattered light left.
There is no airglow, starlight or light pollution, all of which matter by nautical twilight. The deepest-twilight colours carry Monte Carlo noise of a few thousandths in x and y. And the pictures are a rendering, not a measurement: a tone curve, an exposure chosen for each moment, and your screen.