A soap film is a wafer-thin layer of water sandwiched between two surfactant monolayers, and its ever-shifting rainbow colours are a textbook case of thin-film interference. This simulation drains the film exponentially — faster at the top, where gravity pulls liquid down into the surrounding frame, than at the bottom — while evaporation thins it everywhere at once, until the thinnest point crosses a rupture threshold and the bubble pops.
A bubble coloured in horizontal interference bands that shift and cycle as thickness falls, alongside a live thickness-vs-time chart for both the top and bottom of the film, with a marked rupture line.
Set the Initial Thickness, Gravity Drainage Rate and Evaporation Rate, then watch the top and bottom thickness curves fall until one crosses the rupture line and the bubble pops. Click New Bubble to start again.
Because gravity drains the top of a hanging film faster than the bottom, real soap bubbles often show a dark "black film" patch near the top just before popping — the top has drained down to just a couple of surfactant-bilayer thicknesses, too thin to reflect visible light at all.
Light reflecting off the front and back surfaces of the thin film interferes constructively or destructively depending on the film's thickness and the light's wavelength, so different thicknesses reflect different colours strongly — the classic thin-film interference effect.
Gravity continuously pulls liquid down out of the film into the thicker border where it meets the surrounding frame, so the top of a vertical film loses liquid to drainage fastest, while the bottom is topped up by that same draining flow for a while.
Once drainage and evaporation thin part of the film down to only a few nanometres — roughly the thickness of the two surfactant monolayers with almost no water left between them — that patch becomes mechanically unstable and ruptures, and the tear propagates almost instantly across the whole film.
No — it uses a simplified interference-intensity approximation for three representative wavelengths (red, green, blue) rather than integrating the full visible spectrum, which is enough to reproduce the characteristic colour-cycling pattern without the computational cost of a full spectral model.