

All the halogens have at least one unpaired electron in the p - orbitals. This unpaired electron can absorb light energy and get excited. When the same electron returns to ground state, they release the energy by emitting light which falls in the visible wavelength range. So we see that halogens are differently coloured based on the wavelength of light they are emitting.
