We now know that pigments absorb certain wavelengths of light and reflect others, but why are some molecules colorful and others are not?

Most organic molecules only absorb high energy UV light because the energy gap between the molecular orbitals is quite large.

In pigments, the energy gap is small enough for visible light to be absorbed. Pigment molecules often contain vast conjugated systems. These systems of connected molecular orbitals with delocalized electrons lower the overall energy of the molecules and decrease the energy gaps between molecular orbitals. Conjugated systems are identified by the presence of alternating single and multiple bonds and lone pairs of electrons (i.e. in oxygen or nitrogen).

A diagram of a conjugated system. Six carbon atoms form a hexagon structure. Each carbon atom has a single-bonded hydrogen atom extending out from it. Within the hexagon, double bond exist between every other carbon atom, with a total of 3 double bonds in the structure. A double sided arrow points to a second six-carbon hexagon. This hexagon has the same structure as the previous one, except that the double bonds have traded places with the single bonds. An arrow from both of these structures pints to a six-carbon hexagon with a circle inside, rather than 3 double bonds. This notation is used to show that the location of the double bonds is interchangeable within the hexagon. Finally, a colourful heat map has evenly distributed bands of colours, showing that the electron density is highest in the centre or the structure and evenly spaced around the hexagon, with no one side having higher density than another.

This image shows a very simple conjugated system. The alternating double bonds can be drawn in either position. In reality, the electrons are delocalized and are spread all over the molecule. The colorful heat map pictured on the right symbolizes the distribution of the electrons over the molecule. Red refers to the maximum electron density.