Here’s the deal behind the Chemistry of Fireworks – and yes, with anything worthwhile, you really need to Try.
The colors are produced by the heating of metal salts, that emit characteristic colors. The atoms of each element absorb energy and release it as light of specific colors. The energy absorbed by an atom rearranges its electrons from their lowest-energy state, called the ground state, up to a higher-energy state, called an excited state. The excess energy of the excited state is emitted as light, as the electrons descend to lower-energy states, and ultately, the ground state.