The transition metals have five distinct orbitals in their third energy level. When bonded to a ligand these orbitals are separated into two groups located at two slightly different energy levels. The difference of these levels in the complex ion formed corresponds to the energy of a photon in the visible spectrum of the electromagnetic waves so when white light shines at the ion photons of this energy get absorbed. The result is a compound with a colour opposite of the absorbed photon's colour on the colour wheel.