Colour of transition metals is due to d-d transition of unpaired electrons. For example, in the complex [Ti(H2O)6]3+, the Ti atom has oxidation state of +3. Its outer electronic configuration is 3d1. It has one unpaired electron. This unpaired electron is excited from t2g level to eg level by absorbing yellow light and hence appears violet coloured.
Complex formation:
Transition elements form large number of complexes. Small sized transition metal cations have high effective nuclear charge. Hence, they can accept lone pair of electrons from ligands to form coordinate bonds. This is also facilitated by vacant inner d-orbital. For example, Ni forms complex Ni(CO)4.