Monodisperse colloidal spheres (silica or polystyrene, 150–400 nm) suspended in a fluid slowly sediment or crystallize as the solvent evaporates, self-assembling into a close-packed face-centred-cubic (FCC) lattice — a synthetic opal. This slider drives that transition: at 0% the spheres sit at random, jammed positions (φ ≈ 0.64, random close packing, no color); at 100% they sit on exact FCC lattice sites (φ ≈ 0.74, close packing) stacked in ABCABC (111) planes.
An ordered opal Bragg-diffracts visible light off its (111) planes exactly like X-rays off a crystal. The reflected peak wavelength follows a modified Bragg's law for a photonic lattice:
d_111 = D · √(2/3) (111)-plane spacing, D = sphere diameter
n_eff = √( φ·n_sphere² + (1−φ)·n_medium² ) Maxwell-Garnett effective index
λ = 2 · d_111 · √( n_eff² − sin²θ ) Bragg peak, θ = angle from surface normal
- Assembly progress — interpolates every sphere from its random position to its FCC lattice site and ramps φ from 0.64 → 0.74; the Bragg color only appears once long-range order builds up, since diffraction needs a periodic lattice, not just close packing.
- Sphere diameter D — sets d₁₁₁ directly, which is the dominant control on hue: ~200 nm gives blue, ~260 nm green, ~320 nm red-orange, matching real silica/PMMA opal photonic pigments.
- Viewing angle θ — the sin²θ term blue-shifts the reflected color as you tilt away from normal incidence, the same angle-dependent iridescence seen in natural opal gemstones and butterfly wing scales.
- Infiltrating medium — swapping air for water or ethanol raises n_eff and red-shifts λ; this is the working principle of opal-based colorimetric vapor and humidity sensors, which report a concentration by eye as a color change.
Real-world relevance: this is the same mechanism used to fabricate structural-color pigments, tunable photonic-crystal sensors, and templates for inverse-opal catalysts and battery electrodes — all built by letting colloids do the hard work of self-assembly instead of top-down lithography.