The color in the fireworks is a result of chemical additives known as Pyrotechnic colorants. These chemicals are metal salts and the color is provided, generally, by the metal ion i.e. the cation; salt ions (or anions) have little effect on the color of the firework. For example, sodium salts (such as sodium carbonate and sodium bicarbonate) generate yellow color.
Similarly, the Barium salts (such as barium chloride, barium chlorate, barium carbonate, barium nitrate and barium oxalate) result in green color from the fireworks. On burning, the barium salts generally convert to barium chloride (especially when using PVC along with any salt of barium). Barium chloride may oxidize to form barium oxide, BaO or barium hydroxide, BaOH, on burning.
Since barium is toxic in nature, a team of researchers have recently found boron carbide to be a suitable replacement for barium in fireworks.