Why are HgO and CdS compounds colourful?
The band gap decreases as either electronegativity of the anion decreases (electronegativity of anion in CdS &lt; CdTe , ZnS &lt; ZnSe) or the overlap decreases (overlap in ZnS > CdS).

Also, note that colored compounds only result when 1.8 &lt; Band gap &lt; 3.0. Larger gaps give white/transparent &amp; smaller gaps give a black colour to compounds.
(The band gap in ZnS is 3.54, the band gap in CdS is 2.45.)