A SMALL EXPERIMENT IN WONDER
Move the sun. Change the droplets. Find your rainbow.
Put a rainbow in your world. Your camera picture stays on this device.
Drag the picture to place the rainbow. You can also focus the picture and use the arrow keys.
A playful overlay. Move the horizon to hide the effect below it; trees and buildings above the line aren’t detected.
A LITTLE SOMETHING TO NOTICE
The second rainbow comes from light reflecting twice inside a drop. That extra bounce reverses its colours—and leaves it a little fainter.
Sunlight enters a drop, bends, reflects inside it, and bends again on the way out. One internal reflection makes the primary bow; two make the fainter, reversed secondary.
Light is a wave. Different paths through a drop interfere, reinforcing some directions and cancelling others. Similar-sized drops keep those delicate fringes visible. A mixture of sizes blurs them together.
Rainbow Simulator uses a spherical-drop Airy approximation, with water dispersion, Fresnel reflection, a lognormal mixture of drop sizes, and the softening effect of the Sun’s 0.53° disk. A background worker samples 41 wavelengths and converts their combined light to display colours using an approximation to the CIE colour-matching functions.
Sun elevation sets the bow’s position around the point opposite the Sun. At ground level, the main bow slips below the horizon when the Sun rises above about 42°. The secondary can remain visible a little longer.
Camera mode blends the rainbow over live video on your device. Drag to place it, adjust its scale, and move the horizon to keep the effect above the ground. Placement is manual: the toy does not detect the real Sun, track your surroundings, or recognise buildings and trees. Capture photo saves one frame with the effect. Camera access stops when you switch away from the page.
The landscape, clouds, and fog background are illustrative. Rain amount adjusts brightness, not a measured rain rate. Exposure is fixed. This is not a full Mie simulation: tiny fog drops and large, flattened raindrops are only approximate, and multiple scattering is omitted. Colours are limited by your screen.
Explore further: MiePlot · Atmospheric Optics · Colour-matching model
The link remembers the sun, the droplets, and all your settings.
Your sky is ready as a PNG, with the settings tucked underneath.