How and when elements in the powder emit different colors of light at a subatomic level

• When we ,introduce heat to the atom,, the electrons within the atoms ,becomes excited, , thus elevating to ,their highest energy ,level.
,• When the ,heat subsides,, electrons also ,return to lower energy ,level.
,• When this happens , they ,discharge energy in the form of light,, as a results they ,produce different colours of light.,
,• This is due to different energy between two levels.