A simple type of chemical reaction in fireworks is the color produced during and after the explosion. Chemical elements, generally metals, are mixed in with the gunpowder to create colors that vary depending on the element.
Fireworks are filled with metal oxides and metal salts. Some of the more common metals found in fireworks today are titanium, copper, potassium, aluminum and lithium. When these chemicals are heated, the atoms in each element absorb energy and the electrons rearrange themselves from their lowest energy state to a higher one. The metals start oxidizing, which creates heat.
When the electrons revert to a lower energy state, the excess energy is emitted as light. Each element releases a different amount of energy, which determines the color emitted. Aluminium and titanium create a white light, whereas copper emits a blue color.