Metallic salts are used in fireworks to produce different colors of light. When metallic salts are heated up, they absorb energy and their electrons reach higher, excited energy levels. When the electrons return back to lower energy levels, they give off the energy absorbed as colored light.
The metals in metallic salts have electrons that are usually present in their most stable state, called the ground state. In their ground state, the electrons revolve around the nucleus without losing energy. When metallic salts are heated, the heat energy is absorbed by the electrons in the ground state, and they reach higher energy levels. The electrons in higher energy levels are said to be in an excited state. This excited state is not as stable as the ground state and does not last very long. When the electrons return to their ground states, they release energy in the form of light.
The color of the light is characteristic of the metal used in the salt. This is because the amount of energy released is different for different elements. Since the amount of energy released is inversely proportional to the wavelength of the light emitted, lower energies emit light with a longer wavelength, and high energies emit light with a shorter wavelength. For example, strontium salts emit lower amounts of energy compared to copper salts. Therefore, strontium salts emit light in the red end of the spectrum, which has a longer wavelength, while copper salts emit light in the blue end of the spectrum, which has a shorter wavelength.