Question: what determines the wavelength of a photon that is absorbed?
Answer: The electrons in an atom can only occupy certain allowed energy levels. When an electron drops from a higher energy level to a lower one, the excess energy is emitted as a photon of light, with its wavelength dependent on the change in electron energy.