In order for a compound to have colour, it must absorb visible light.
A compound will absorb visible radiation when that radiation possesses the energy needed to move an electron from its lowest energy state or ground state to some excited state.