Barium compounds produce green colors in fireworks. Different elements create different colored flames: barium gives green, copper produces blue, strontium gives red, and sodium yields yellow. This is based on the principle of flame emission spectroscopy where each element emits characteristic wavelengths of light when heated.