Crystals get their colour from different factors, such as chemical composition, impurities, structural defects, temperature, pressure, radiation, environmental conditions and light interference.
Impurities is a big one: Some crystals have trace elements or foreign substances that change the colour of the crystal. For example, amethyst is purple because it contains iron impurities that interact with the quartz crystal structure and produce a violet hue.
Chemical composition determines the inherent colours that depend on the type and arrangement of atoms or molecules that make up the crystal. For example, ruby is red because it contains chromium atoms that absorb blue and green light and reflect red light.
Light interference affects appearance. Some crystals have thin layers or microscopic structures that cause light to diffract, refract, or reflect in different ways, creating a spectrum of colours. For example, opal has a play of colour because it has tiny spheres of silica that scatter light into different wavelengths.
Structural defects also impact appearance. Some crystals have irregularities or distortions in their crystal lattice that affect the way light is absorbed or reflected by the crystal. For example, diamond can have different colours, such as yellow, pink, or blue, depending on the type and amount of defects in its carbon atoms.