thin-film interference
A soap bubble drifting in sunlight swirls with shifting rainbow colours, and a drop of oil on a wet road spreads into bright bands of colour, yet neither the soap nor the oil has any colour of its own. The colours come from thin-film interference: light bouncing off the top and bottom of an ultra-thin transparent layer, and the two reflections interfering. It answers the question: where do these colours come from when the material itself is clear and colourless?
When light hits a thin film, some reflects off the top surface and some passes in, reflects off the bottom surface, and comes back out. These two reflected waves travel slightly different distances, the second makes an extra round trip through the film, so they end up out of step by an amount that depends on the film thickness and the wavelength. Where they line up in phase, that colour is reinforced and appears bright; where they cancel, it is dimmed. Because the extra path depends on wavelength, different colours brighten at different thicknesses, so a film of varying thickness glows with different colours across its surface. There is one crucial subtlety: a light wave reflecting off a surface where the index of refraction increases (going into a denser medium) flips its phase by half a wavelength, and this half-wavelength shift must be included when working out which colours are bright.
Thin-film interference is not just pretty, it is put to work: the anti-reflection coating on camera lenses and eyeglasses is a film sized so that reflections cancel, letting more light through; and the shimmer of a peacock feather or a beetle's shell is structural colour from natural thin layers, not pigment. An honest note: the film must be extremely thin, comparable to the wavelength of light, a few hundred nanometres, which is why a thick pane of glass shows no such colours, its two reflections are far too many wavelengths apart to interfere in any orderly way.
A soap film in air (n = 1.33) looks brightest in reflected light for a colour when its thickness matches a quarter of that colour's in-film wavelength. As the film drains and thins, the reflected colour marches through the spectrum, and just before it pops, the top goes black, the film is now far thinner than a wavelength and reflections cancel.
Two reflections (top and bottom of the film) interfere; colour depends on thickness.
Do not forget the half-wavelength phase flip on reflection at a higher-index surface, it decides which colours are bright. The film must be only a few hundred nanometres thick; ordinary window glass is far too thick to show these colours.