Pigments absorb certain light waves & reflect others; giving the appearance of the reflected color to the viewer's perception. But what chemically happens within the pigment in order to absorb certain wavelengths & reject others?
While I am not particularly into photonics I do like to think I know enough that maybe I can point you in the right direction. Do not think of this as a chemical reaction- think of it more as shapes and sizes, some molecules may be shaped so that red photons will fit into a pit and never return while green does not- so it bounces off. Remember that there are electromagnetic properties of the matter, and of the light- and that there will result in interaction due to this. Keep in mind the myriad of textures formed with different atoms- the endless arrangement of molecules possible- and that each frequency of light also has varied properties such as size and power.
You might mix two clear liquids together and through chemical reaction the resulting molecule is just right for only orange to bounce off lets say. The chemical reaction set the condition for this light interaction- but once occurred it is inconsequential to that aspect. Even if the light is simply power full enough catalyst to burn it and result in another chemical reaction which again changes the physical properties of the matter.
In visibly colored compounds the color results from the absorbtion of electromagnetic energy, in the form of photons, of particular energies. Blue compounds tend to absorb the energy in the red end of the spectrum, for example. The actual absorption is done by the electrons in the chromophore. After the energy is absorbed, the electrons are promoted into higher energy levels with the energy difference being equivalent to the energy of the absorbed photon. The electrons return to their ground state by some process, usually by thermal vibrations but potentially by emission as well. This emission (fluorescence or phosphorescence) can contribute to the color as well. Day-Glo dyes tend to absorb in the UV and emit in the visible, for example.
Why do colored compounds only absorb certain wavelengths? Think of the absorption process being coupled to the excitation process. Only certain energies are capable of promoting the electrons into certain excited states. This was explained to me as being similar to pushing someone on a swing. You have to time it just right... have just the right frequency. Spastic pushing doesn't get you anywhere.