The first fireworks were invented in China during the Song Dynasty — these are the years 960-1279. They were made from gunpowder placed in hollow bamboo stalks. The Chinese believed that fireworks ward off evil spirits, and therefore actively used them on holidays and during religious events. At the same time, the pyrotechnic profession was considered highly respected.
At first, the "Chinese lights" were not colored, as they are now. They exploded in the form of bright white flashes, giving a lot of noise and smoke — the more the better, because evil spirits do not like it. But around the 14th century, the Chinese figured out how to paint fireworks.
In a military treatise on gunpowder and explosives called "Huolongjing", written by Needham, Joseph (1986). Science and Civilisation in China, Volume 5: Chemistry and Chemical Technology, Part 7: Military Technology: The Gunpowder Epic. Cambridge University Press By Jiao Yu and Liu Bowen around the 1370s, there is information about which chemicals can be useful for colored fireworks. Thus, arsenic sulfide was used for yellow, copper acetate for green, lead carbonate for purple, and mercury chloride (calomel) for white.
This treatise also told how to create a bomb by mixing oil, urine, ammonia, feces, green onion juice, iron granules and broken porcelain. But let's not get distracted.
Fireworks have appeared in Europe Werrett, Simon (2010). Fireworks: Pyrotechnic arts and sciences in European history. Chicago: The University of Chicago Press in the XIV century — that's when traders brought them to Italy. For a long time they were rather nondescript, because the Chinese, although they leaked the recipe for making gunpowder, kept the coloring methods secret. However, by the 17th century, fireworks had spread all over Europe anyway.
It was only in 1786 that the French chemist Claude Louis Berthollet discovered Fritz Ullmann. Ullmann’s Encyclopedia of Industrial Chemistry that the oxidation of the pyrotechnic mixture with potassium chlorate makes the lights purple. His subsequent research showed that when ignited, chemical elements emit light with different wavelengths. And as a result, barium gives fireworks a green color, strontium is red, sodium is yellow, and copper is blue.
So the Europeans rediscovered the secret of colored fireworks. Moreover, they have promoted Werrett, Simon (2010). Fireworks: Pyrotechnic arts and sciences in European history. Chicago: The University of Chicago Press Pyrotechnic art is far ahead, having started using magnesium and aluminum — these metals burn with intense silver light.
In general, the next time you start setting off fireworks, you will know that the whole chemical industry is behind this entertainment. Most importantly, do not forget about safety precautions while admiring the bright lights.