Reservoir

The making · No. 170 · Chance

Reservoir: how a fair sample stays fair.

A short account of the palette, the type, and the canvas that turns an endless stream into seven honest cups.

01 / ConceptThe single job

Reservoir is a fictional interactive essay on reservoir sampling — the algorithm that keeps a uniform sample of a stream you can only see once, using memory that never grows. Its audience is the curious engineer and the numerate stranger alike. The page has one job: to make it felt that seven items, chosen with fading one-in-n odds, remain a perfectly fair sample of a river of any length — and to prove it, not merely claim it.

02 / PaletteWater, and the thing kept from it

Argued from the subject: a cold river ground, a cool current for everything in motion, and a single warm accent reserved for the sample you hold — the light in the cup.

Current
#0E1620
The riverbed ground — deep blue-black, so the stream and the cups both glow against it.
Stream mark
#4FA8C0
The moving water: current lines, chip outlines, histogram bars. A LINE/MARK token — never body text.
Held accent
#E0B24A
Reserved for what you keep — the seven cups, the odds meter, the uniform line. Scarcity gives it weight.
Water ink
#D4DEE4
The derived body ink — light on the dark ground at well above 4.5:1, with #9DB0BC for secondary copy.

03 / TypeA civic sans and a ledger mono

Archivo carries the voice — a grotesque with the plain authority of signage; IBM Plex Mono handles every number, so counts, odds and indices line up in tabular columns like a running tally.

Archivo · display, 800
A fair sample of a river
IBM Plex Mono · counts & odds
n = 1,284   keep 7 ⁄ 1284   0.55%

The one moment of typographic bravery is the live fraction in the status bar — a bold amber 7 ⁄ n that ticks down as the river lengthens, the odds themselves set as display type.

04 / TechniqueTwo canvases, one honest algorithm

Everything is procedural — no images, no libraries. Two <canvas> surfaces share a single requestAnimationFrame loop (DPR capped at 2, sized to container, paused on document.hidden).

05 / IterationThree passes, logged

Pass 1Craft

Pass 2Depth

Pass 3Hardening