This page is the color of the sky

zenith
horizon
nadir
sampled live from the camera —

The colors of this page aren't chosen by me. They're sampled from the sky — right now, more or less — by a camera pointed up at it.

The whole thing runs on a Raspberry Pi Zero sitting on a windowsill, on an off-grid cellular connection. A small all-sky camera looks straight up, and every twenty seconds it works out what color the sky currently is. That color becomes the background, the text, the links — the mood of the page. When it's overcast the garden goes grey and flat; at golden hour it warms; after dark it quietly turns the lights off and goes to a dim, legible night theme.

How the color is derived

Each capture goes through a little pipeline:

  1. Look up. The camera grabs a frame. Because the lens is effectively fisheye, only a circular crop in the middle is real sky — so it samples pixels inside that disc and ignores the corners.
  2. Find the dominant colors. It runs k-means clustering over the sampled pixels to boil the whole frame down to its five most representative colors — the palette.
  3. Speak in OKLCh. Each color is converted into OKLCh — a perceptually-uniform color space, so "a bit lighter" or "a bit more saturated" actually look like even steps to the eye. Every color is just three numbers: Lightness, Chroma, Hue.
  4. Name three regions. From those five, it picks three: the zenith (the brightest — the top of the sky), the nadir (the darkest — toward the ground), and the horizon (the most colorful of the rest, where the interesting light usually lives).
  5. Take its temperature. The average of the whole frame gives a correlated color temperature in Kelvin — cool and blue at midday, warm and low at dusk.
  6. Ease, don't jump. Successive readings are smoothed with an exponential moving average so the page drifts gently rather than flickering. Hue is blended along the shortest way around the color wheel, so a color crossing 360°→0° eases through red instead of spinning all the way back through green.

From the sky to this page

A tiny script on the Pi reads that palette every couple of minutes and writes a tiny stylesheet — just nine numbers. The page's hue and whether it's light or dark come straight from the sky; the contrast between text and background is held fixed, so the words stay readable whatever the weather is doing.

It costs almost nothing to run. The palette is a few hundred bytes; the heavy lifting (the camera, the clustering) happens locally and never leaves the device. The sky is doing the design work — I'm just publishing it.

#meta #skybox