We know that the electron configuration in $3d$ orbitals of $\ce{Zn^2+}$, in $4d$ orbitals of $\ce{Cd^2+}$ and in $5d$ orbitals of $\ce{Hg^2+}$ ions are completely same.
Then why the compounds of $\ce{Hg(II)}$ and $\ce{Cd}$, such as $\ce{HgO}$, $\ce{CdS}$ radiate versatile colour where $\ce{ZnO}$, $\ce{ZnS}$ are white?