Opal formation - In opal, both diffraction and interference plays a role in the play-of-colour.
Diffraction in opal is the result of light hitting the gaps formed by the spheres (grating) and then being split up into its spectral components. The grating pattern changes the wave length of the reflected incident light, which results in the different colours (see picture below).
How the silica sphere structure in the opal formation affects the intensity of the colour...
Interference occurs when part of the light gets reflected from the surface of the silica sphere while another part gets refracted inside the sphere, and then reflected out—this increases the intensity of colour and brightness. It is also interesting to note that the silica spheres have a series of layers simular to an onion. These layers are believed to contribute and multiply the interference effect (see picture below).
Opal can be any colour; the size of the many gaps or pits determines which colour is seen. In precious opal, the larger spheres create a red colour, which can change depending on the viewing angle*. It is also the rarest colour as it takes longer for the spheres to grow to that size.
Here is the order of colour and corresponding sphere size (smallest-largest): violet - 200 nm, indigo - 222.5 nm, blue - 237.5 nm, green - 255 nm, yellow - 285 nm, orange - 295 nm and red - 325 nm.
*There is a rule in physics called ‘Bragg’s Law’ which explains why opals with a red play-of-colour are also usually able to show all other prismatic colours too when the stone is tilted and viewed from lower angles.