Molecules containing electrons or non-bonding electrons (n-electrons) can absorb the energy in the form of ultraviolet or visible light to excite these electrons to higher anti-bonding molecular orbitals. The more easily excited the electrons (i.e. liwer energy gap between the HOMO and LOMO) , the longer the wavelength of light it can absorb.