Sort:  

The size of the silica spheres and the space between them determines the color of light.

aha! Good ole light refraction at work. So when you see an opal that has many different colors it just means that the silica spheres within are inconsistently sized and spaced.

Well, specific sizes create specific colors for instance 0.1 micron makes violet, 0.2 micron makes red. And the space between them is a water/silica solution so that has some play on the way the light bends through the opal.