Sodium chloride on heating with sodium vapours acquires yellow colour because sodium chloride crystal suffers metal excess defect with sodium vapours on heated condition. Due to electronic transition at the excited state of sodium atom, it appears yellow.