How are electrons in conjugated molecules excited?
This first picture shows what happens to the molecular orbitals of ethylene if we bring two ethylene molecules (the right and left sides of the molecular orbital vs. energy part of the diagram) close together and form 1,3 butadiene (center of the figure)

The next figure shows the result of adding a third ethylenic group to the molecule and form 1,3,5-hexatriene. Note how in each case the molecular orbitals combine (split) and generate a new set of molecular orbitals; and in each case the separation between the Highest Occupied Molecular Orbital (HOMO) and the Lowest Unoccupied Molecular Orbital (LUMO) decreases.  When light is absorbed an electron is promoted from the HOMO to the LUMO.  If we make the HOMO-LUMO separation small enough by extending conjugation, we can shift absorbtion into the visible region (longer wavelength, smaller HOMO-LUMO energy separation). We can add other groups too, like cyano, nitro, phenyl, carbonyl, etc. to extend the conjugation in our system.