Things appear to have colour because they absorb some wavelengths of light and reflect others.
Chromophores are the part of molecules responsible for the absorption and reflection of light.
A chromophore is formed by a group of atoms within a molecule and the electrons that orbit their nuclei.
The colour produced by an opaque object corresponds with the wavelengths not absorbed during the interaction of light with the chromophores of the molecules that form its surface.
Whether different wavelengths of light are absorbed or reflected by a chromophore depends on whether there is an energy difference between orbiting electrons.
If the energy difference between the electrons of a chromophore falls within the range of the visible spectrum (2 to 2.75 electron volts) then it produces the colour seen by an observer.