Why does the colour of the same compound (e.g. magnesium nitride) differ?
Minor differences in color are likely either due to impurities or due to intrinsic crystal defects such as f-centers. For example, $\ce{ZnO}$ is often a shade of yellow, rather than pure white, due to those defects. In alkali halides, h-centers are similar defects giving rise to colors. You can easily create color centers in $\ce{NaCl}$ with a spark coil in just a few minutes.

Another possibility is that there are mixtures of different allotropes, or polymorphic forms. An extreme example is transparent diamond vs. black graphite. BTW, diamonds having varied colors due to impurities (e.g. nitrogen) and to intrinsic defects are useful in studying quantum phenomena, as well as gems.