an atom is comprised of electrons, protons, and neutrons. The protons and neutrons are contained within the nucleus while the electrons exist in discrete energy levels outside of the nucleus. When an atom is exposed to enough energy, such as the heat created within a firework explosion, an electron can absorb this energy and get promoted to a higher energy level. Shortly after, the electron will fall back down to a lower energy level, releasing energy in the form of light. Therein lies the key to colorful fireworks.
the energy difference between the two levels is 2.03 eV it would emit orange light (610 nm). As it turns out, the wavelength and energy are inversely proportional, so a transition with a greater energy of 2.33 eV would produce light of a shorter wavelength, 532 nm or green light.
Every element has a unique number of electrons and electron configuration which means not every element will contain electronic transitions of the same energies – giving each element its own “spectral footprint.” This fact is commonly used in laboratories to identify elemental compositions of unknowns.