White light is a mixture of different colours of light (e.g red, green and blue) and each colour has a different wavelength. For something to have colour, it needs to absorb certain wavelengths (or colours) of light. What's left over is what we see. So how do transition metals do that?
When they dissolve in solution, they don't exist as isolated ions but are surrounded by ligands (in aqueous solutions they're water molecules). These ligands donate a pair of electrons to the positive metal ion in a dative covalent bond. For example, iron forms [Fe(H2O)6]2+ which is pale green. These ions are called complex ions.
All transition metals have electrons in their d orbitals, which are electrostastically repelled by those donated by the ligands. Since d orbitals have different shapes and orientations, they're not all repelled to the same extent: for an octahedral complex ion, the ligands are placed at the 6 corners of the octadedron. The dz2 and dx2-y2 are pointing to those corners and so are repelled a lot. The other three d orbitals don't point directly towards the ligands and so are repelled less. Therefore, the dz2 and dx2-y2 orbitals are at a higher energy than the other three, and so an energy gap is created, called d orbital splitting.
When light shines on the solution, wavelengths of light that have an energy equal to the energy gap between the two sets d orbitals take electrons in the lower energy orbital to one at the higher energy level. The wavelengths left behind are what we see!