Metals of the d-block have five degenerate d orbitals. However, in the presence of ligands, these orbitals are no more degenerate and they split into sets of degenerate orbitals depending on the nature of the ligands and the geometry of the complex formed.
Hence it is possible for electrons to undergo d-d transitions when this occurs leading to the unique color of some transition metal ions.
Also, charge transfer accounts for the color of oxysalts such as KMnO4 where the d-d transition band is weak.
One is chloroform, formerly used as an inhaled anesthetic during surgery, the primary use of chloroform today is in industry, where it is used as a solvent and in the production of the refrigerant freon.
In an ionic bonds, the metal loses electrons to become a positively charged cation, In which the nonmetal accepts those electrons to become a negatively charged anion.