The deep blue colour of the solution K2Cr2O7 is because an electron from the Oxygen lone pair is transferred to low lying Chromate ion orbital.
Oxidation number of Chromium in Cr2O72−⇒2x+7×(−2)x=+6. The electronic configuration of Chromium is 1s22s22p63s23p64s13d5so it will lose six electrons to form Cr+6.
Electronic configuration of Cr6+=1s22s22p63s23p6since there are no electrons present in the d-orbital, the d-d transition will not occur.
The oxygen atom in Cr2O72−that act as a ligand and due to charge transfer transfers its one electron to chromium and due to which the coloured compound is formed.
Similarly, in MnO4−the oxidation number of Manganese⇒x+4(−2)=−1x=+7. The electronic configuration of Manganese is 1s22s22p63s23p64s23d5so it will lose seven electrons to form Mn+7
Electronic configuration of Mn+7=1s22s22p63s23p6, here also no d-orbital is present so no d-d transition will take place.
The oxygen atom in MnO4− acts as a ligand and due to charge transfer transfers its one electron to manganese due to which a coloured compound is formed.
Therefore, K2Cr2O7 and KMnO4 are coloured compounds due to charge transfer or ligand to metal transfer.