Different metal salts produce characteristic flame colors in fireworks: barium compounds give green, strontium gives red, copper gives blue, and sodium gives intense yellow. This occurs because the metal atoms absorb energy and release it as specific wavelengths of visible light. Mercury and potassium don't produce green flames in this context.