A compound is coloured due to the presence of electrons. In NaCl, due to a non-stoichiometric defect, an electron occupies an interstitial position and when it is excited, it imparts colour.Complete answer:
As we know, solids are formed by a large network of crystals and this network is not always perfect. There are defects in these crystals which are generally irregular in arrangement of the constituents forming the network.
We can classify these defects as point defects which is the irregularity from the ideal arrangement around a point or an atom and line defects which is the irregularity in the entire row of the lattice.
Point defects are further classified into stoichiometry defects, impurity defects and non-stoichiometric defects. Sodium chloride can show all of these defects but the coloured crystals due to excess metal lies under non stoichiometric defects.
We can define the non-stoichiometry defects as the defects which contain elements in a non-stoichiometric ratio due to excess or deficiency of metal in the lattice.
When we heat the crystals of sodium chloride in presence of sodium vapour, sodium cations are deposited on the surface of the crystal. The chlorine anion diffuses to the surface of the crystal and combines with the sodium cation to give us sodium chloride. This happens due to the loss of electrons by sodium atoms to give us sodium cation. The released electron diffuses into the crystal lattice and occupies an anionic site which is called the F-centre. Due to this, the crystal has an excess of sodium. When this electron is excited, it imparts yellow colour, thus we see the crystals as yellow coloured.Note:
Sodium chloride can have stoichiometric defects too but here, in the question it is mentioned to us that it has excess sodium ions therefore it cannot be a stoichiometric defect as excess sodium ions will change the stoichiometric ratio of sodium and chlorine which is 1:1 in NaCl. F-centres are also known as colour centres as the anionic site occupied by the electrons impart colour.