In addition to PE's link to resonance, follow up with this on on conjugation - the resonance is needed to get an photon absorbed into the molecule, which then needs this property:

Resonance is needed to help absorb a photon and allow an electron to move about the molecule. The conjugation helps distribute the charge of the electron about the area of conjugation. The longer the area of conjugation, the more the charge is distributed. Also, the length of the conjugated chain the longer the wavelength of light that can be absorbed. That is, a blue dye will be shorter in length than a red dye. And IR dye will be longer yet.

Then check this:

And look at the molecules PE showed in Post #33. You can see how the longer the chain of conjugated carbons in those molecules affect the wavelength of absorption.