Lexicon / Colour · 4 of 5

40 / Colour

Difference Inversion

The words turn into the opposite of whatever passes behind them, readable over a photograph, over white and over black — and gone over one particular grey.

Every tone but one

Four of Ansel Adams’s photographs of the national parks, 1941–42, then the eleven zones of the Zone System he worked out with Fred Archer around 1939–40, from pure black to pure white. The line in the middle is white and set to difference: watch what happens to it on Zone V.

Ansel Adams, The Tetons — Snake River, Grand Teton National Park, Wyoming, 1942
The Tetons — Snake River, Grand Teton National Park, WyomingAnsel Adams, 1942 · National Archives 79-AA-G01A copy travels on the Voyager Golden Record, launched in 1977.
Ansel Adams, Old Faithful Geyser, Yellowstone National Park, Wyoming, 1941
Old Faithful Geyser, Yellowstone National Park, WyomingAnsel Adams, 1941 · National Archives 79-AA-T26Taken at dusk or dawn, during an eruption.
Ansel Adams, Yellowstone Lake, Yellowstone National Park, Wyoming, 1941
Yellowstone Lake, Yellowstone National Park, WyomingAnsel Adams, 1941 · National Archives 79-AA-T06
Ansel Adams, The Giant Dome, Hall of Giants, Big Room, Carlsbad Caverns National Park, New Mexico, 1941
The Giant Dome, Hall of Giants, Big Room, Carlsbad Caverns National Park, New MexicoAnsel Adams, 1941 · National Archives 79-AA-W06The largest stalagmite then found: sixteen feet across.
  1. 0pure black
  2. I
  3. II
  4. III
  5. IV
  6. Vmiddle grey: what a light meter makes of anything it reads
  7. VI
  8. VII
  9. VIII
  10. IX
  11. Xpure white

also called mix-blend-mode · invert on crossing · self-inverting overlay

One property, no JavaScript, and the overlay never has to know what is behind it. What it cannot survive is mid-grey, where inverting a value returns very nearly the value you started from. Plan for that band rather than discovering it on the one slide that has it. White set to difference becomes, pixel by pixel, the opposite of what lies beneath: black over white, white over black, a new tone over every picture. Over middle grey the opposite of the tone is nearly the tone itself, so the line all but disappears — the one place to keep it away from.

How it is built.line { position: sticky; top: 50%; color: #fff; mix-blend-mode: difference } /* each pixel: |white − what is behind| */ .zone { background: lab(calc(var(--z) * 10%) 0 0) } /* Zone V = L* 50 */ .walk { isolation: isolate } /* what the line may blend with */

In full, on GitHub index.html showcase.css

Photographs — Ansel Adams, Photographs of National Parks and Monuments, compiled 1941–42, Records of the National Park Service, National Archives, public domain, via Wikimedia Commons: 79-AA-G01, 79-AA-T26, 79-AA-T06, 79-AA-W06. Facts — Zone System; NASA, the Golden Record’s images.