Skip to content

Add the single-hue color ramps for GeoTIFF and Zarr layers - #172

Merged
ckrew merged 1 commit into
mainfrom
feature/single-hue-color-ramps
Aug 17, 2026
Merged

Add the single-hue color ramps for GeoTIFF and Zarr layers#172
ckrew merged 1 commit into
mainfrom
feature/single-hue-color-ramps

Conversation

@ckrew

@ckrew ckrew commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Blues was the only light-to-dark single-hue ramp, so a raster that wanted one in any other color had no option. Adds the rest of the ColorBrewer single-hue sequential family -- Greens, Oranges, Purples, Reds -- taking the registry from 14 ramps to 18.

These are the easiest ramps to read a magnitude off, and the safest choice when a raster sits under coloured vector features: a single-hue underlay cannot be mistaken for a categorical overlay the way a rainbow can.

Keystops were sampled from matplotlib 3.10 at twelve evenly spaced points, matching the existing convention. matplotlib's Greens/Oranges/Purples/Reds are the ColorBrewer maps of those names.

The picker gains a "Single hue" group and Blues moves into it, leaving "Sequential" for the multi-hue maps plus grayscale -- which is called out in a comment as running dark to light, the opposite direction from the single-hue family. Display order only; the persisted rampName is unchanged, so existing layers render identically.

Two invariants back the new family. Luminance must fall monotonically from a near-white first stop, which is the property the family exists for and which a mis-sampled table breaks. And each ramp's channel ranking at its darkest stop must match its name, because every other assertion holds for any light-to-dark ramp -- without it, a ramp wired to the wrong hue's table passed silently, which is exactly what mutation testing caught.

Blues was the only light-to-dark single-hue ramp, so a raster that wanted
one in any other color had no option. Adds the rest of the ColorBrewer
single-hue sequential family -- Greens, Oranges, Purples, Reds -- taking
the registry from 14 ramps to 18.

These are the easiest ramps to read a magnitude off, and the safest choice
when a raster sits under coloured vector features: a single-hue underlay
cannot be mistaken for a categorical overlay the way a rainbow can.

Keystops were sampled from matplotlib 3.10 at twelve evenly spaced points,
matching the existing convention. matplotlib's Greens/Oranges/Purples/Reds
are the ColorBrewer maps of those names.

The picker gains a "Single hue" group and Blues moves into it, leaving
"Sequential" for the multi-hue maps plus grayscale -- which is called out
in a comment as running dark to light, the opposite direction from the
single-hue family. Display order only; the persisted rampName is
unchanged, so existing layers render identically.

Two invariants back the new family. Luminance must fall monotonically from
a near-white first stop, which is the property the family exists for and
which a mis-sampled table breaks. And each ramp's channel ranking at its
darkest stop must match its name, because every other assertion holds for
any light-to-dark ramp -- without it, a ramp wired to the wrong hue's
table passed silently, which is exactly what mutation testing caught.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@ckrew
ckrew merged commit b237989 into main Aug 17, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant