what is responsible for the colors imitated by elements?

a. an electron hitting another electron
b.an electron absorbing energy
c.an electron releasing energey
d.an electron absorbing, then releasing energy​