Dear Student,
According to Maxwell, every particle or substance radiate when subjected to electromagnetic radiation. Electrons too gets excited to higher energy level when electromagnetic radiation are imposed on it. Now when this electron travel back to its ground state, it emits radiation. The energy of the radiation if falls in the visible region, then colour is observed and if it falls it any other region, then the radiations are not visible.