AgI is coloured whereas Na is not because
AgI has more ionic character.
AgI has more covalent character
AgI has unpaired electrons.
AgI has high molecular weight.
With the increase in the size of anions, the polarization of anions increases. The cation is known as polarization. With the increase in polarization, the intensity of compound colour increases. Thus, the silver salts like are coloured.