THE METALS
One metal, one colour
Strontium and lithium give red, sodium yellow, barium green and copper blue. Titanium and magnesium burn silver or white.
Pick a colour
THE CHEMISTRY OF A BURST
RED · GREEN · BLUE each from its own metal
A firework's colour is chosen before it leaves the ground.
Small amounts of metal compounds are packed into the shell. When they burn, heat lifts their electrons up and each metal gives the energy back as its own colour of light.
Updated
Pick a colourTHE SHORT ANSWER
Firework colour is the same science as a school flame test.
Each metal glows its own colour.
THE METALS
Strontium and lithium give red, sodium yellow, barium green and copper blue. Titanium and magnesium burn silver or white.
Pick a colourTHE PROBLEM
Copper's blue needs a hot flame, but too much heat destroys it. A deep, bright blue is still the one colour makers struggle to get.
Why blue is hardTHE PHYSICS
Heat kicks electrons into higher energy levels. As they drop back to their ground state they shed the energy as light of one colour.
See the numbersA QUICK COLOUR CHECK
Pick a colour you might see in a display to find the metal usually behind it. The bar shows where that colour sits in the visible spectrum, from short-wavelength blue to long-wavelength red.
Colours from Royal Society of Chemistry flame-test results and Nautilus; spectrum order from NASA. Flame tests with these chemicals are for supervised labs only.
TWO NUMBERS WORTH KNOWING
One figure for the range our eyes can see,
one for the exact yellow sodium gives off.
380–700 nm
Wavelengths the human eye can detect
NASA says the eye typically detects wavelengths from 380 to 700 nanometres. Violet sits at the short end, around 380, and red at the long end, around 700.
VISIBLE LIGHT · NASA
≈ 589 nm
Sodium's two strongest lines
The US National Institute of Standards and Technology lists sodium's strongest lines at 5889.950 and 5895.924 ångströms in air: about 589 nanometres, a warm yellow.
SODIUM YELLOW · NIST
Each element's pattern of lines works like a fingerprint. NASA notes that astronomers read the same kind of patterns in the light of the Sun and stars to find which elements are there.
FOUR THINGS TO WATCH FOR

You can name the chemistry from a safe spot in the crowd. These are the colours and the metals usually behind them.
A warm yellow-orange is sodium, the same colour the RSC flame test compares to street lights.
Deep reds come from strontium or lithium; a more orange red points to calcium.
Notice how the blues look dimmer than the reds and greens and fade into the night sky.
Silver and white come from titanium or magnesium; gold sparks in the flame test come from iron.
WHY BLUE IS HARD

Raising the flame temperature makes colours brighter, but if it gets too hot the metal species giving off the colour is destroyed and the light washes out to white. Copper's blue is the most fragile, so makers aim for a narrow temperature range, often with copper chloride.
Fireworks were yellowish orange for centuries, from gunpowder alone. Italian makers added metals in the 1800s, and hotter fuels such as aluminium and magnesium later made colours far more vivid. A truly deep, bright blue has still not been found.
Questions
Metal compounds packed into the firework are heated as it burns. The heat lifts their electrons to higher energy levels, and as they fall back they give off light. Each metal gives its own colours.
Strontium and lithium both give deep reds. BBC Science Focus names relatively cool-burning strontium carbonate as a common red.
Blue usually comes from copper, which needs a hot flame but is easily destroyed if it gets too hot. No one has yet found a mix that gives a blue that is both deep and bright, and blue also blends into the night sky.
The colour-making packets, called stars, are packed with gunpowder and a burst charge. At the right height the burst charge fires and throws the stars out into the planned pattern.
No. The Royal Society of Chemistry's flame test is a supervised school experiment with a Bunsen burner and eye protection, and some of the chemicals, such as barium chloride, are toxic. Watch a display instead.
Sources
ABOUT THIS NAME
doodlecolorpop.com is part of the DoodleSale portfolio. It isn't in an auction right now, but you can ask about leasing it.