” Opal is a hydrated amorphous form of silica (SiO2·nH2O); its water content may range from 3 to 21% by weight, but is usually between 6 and 10%. Because of its amorphous character, it is classed as a mineraloid, unlike crystalline forms of silica, which are classed as minerals. It is deposited at a relatively low temperature and may occur in the fissures of almost any kind of rock, being most commonly found with limonite, sandstone, rhyolite, marl, and basalt. Opal is the national gemstone of Australia.
The internal structure of precious opal makes it diffract light. Depending on the conditions in which it formed, it can take on many colors. Precious opal ranges from clear through white, gray, red, orange, yellow, green, blue, magenta, rose, pink, slate, olive, brown, and black. Of these hues, the black opals are the rarest, whereas white and greens are the most common. Opals vary in optical density from opaque to semitransparent.
Precious opal shows a variable interplay of internal colors, and though it is a mineraloid, it has an internal structure. At microscopic scales, precious opal is composed of silica spheres some 150 to 300 nm in diameter in a hexagonal or cubic close-packed lattice. It was shown by J. V. Sanders in the mid-1960s that these ordered silica spheres produce the internal colors by causing the interference and diffraction of light passing through the microstructure of the opal. The regularity of the sizes and the packing of these spheres determines the quality of precious opal. Where the distance between the regularly packed planes of spheres is around half the wavelength of a component of visible light, the light of that wavelength may be subject to diffraction from the grating created by the stacked planes. The colors that are observed are determined by the spacing between the planes and the orientation of planes with respect to the incident light. The process can be described by Bragg’s law of diffraction.” https://en.wikipedia.org/wiki/Opal