aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/README.md
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-08 21:41:38 -0500
committerCraig Jennings <c@cjennings.net>2026-06-08 21:41:38 -0500
commit582d8a6a5d228bcb49a6ca3092b61418a348f37f (patch)
tree23ff13395b6cd314486141b24ab308ab3a382b1e /scripts/theme-studio/README.md
parent485f2aedcc599002a515d45d06ea4e2669cdbb4a (diff)
downloaddotemacs-582d8a6a5d228bcb49a6ca3092b61418a348f37f.tar.gz
dotemacs-582d8a6a5d228bcb49a6ca3092b61418a348f37f.zip
feat(theme-studio): render a Chroma×Lightness plane in OKLCH mode
Perceptual-metrics Phase 4b, the last piece of the OKLCH editor. In OKLCH mode the picker's square becomes a Chroma (x) by Lightness (y) plane at the current hue. The crosshair maps to (C, L) and the hue strip selects H. The unreachable region is greyed out so the sRGB gamut boundary at that hue is visible, and the AA/AAA contrast mask overlays on top of the reachable colors. The per-cell in-gamut test is forward-only: oklch to oklab to linear-rgb plus a channel-range check, never the binary search, which stays in oklch2hex for committing a chosen color. colormath.js now exports oklab2lrgb, inGamut, and lrgb2hex (with direct Node tests, including one that pins inGamut to oklch2hex's clamped flag so the plane and the commit path agree on the boundary). The rendered bitmap caches on hue, dimensions, mask, and background, so dragging C and L at a fixed hue reuses it. HSV stays untouched: the square keeps its saturation/value gradient and the existing contrast mask. A #planetest headless guard asserts the crosshair lands at the color's (C, L), an out-of-gamut cell renders as the grey fill, and an in-gamut cell renders as a real color.
Diffstat (limited to 'scripts/theme-studio/README.md')
-rw-r--r--scripts/theme-studio/README.md7
1 files changed, 7 insertions, 0 deletions
diff --git a/scripts/theme-studio/README.md b/scripts/theme-studio/README.md
index 58ddbf81..68d74815 100644
--- a/scripts/theme-studio/README.md
+++ b/scripts/theme-studio/README.md
@@ -58,6 +58,13 @@ Three tiers of faces, plus the palette:
background, negative means light text on a dark background — so a light color
on dupre's dark ground reads as a negative Lc. WCAG stays the rating used in
the syntax/UI/package tables; APCA and OKLCH are picker-only diagnostics.
+
+ An edit-model toggle switches the picker between HSV and OKLCH, independent of
+ the contrast mask. In OKLCH mode the L/C/H dials drive the color and the square
+ becomes a Chroma×Lightness plane at the current hue, with the out-of-gamut
+ region greyed out; the hue strip selects the hue. Pushing chroma past sRGB
+ snaps to the reachable color and shows a clamp note. The palette also warns
+ when two colors fall below a perceptual ΔE threshold, hard to tell apart.
- **Syntax** — every font-lock / tree-sitter category (keyword, string,
function, type, comment, and the rest), each with normal/bold/italic and a
contrast rating. Click a category to flash its tokens in the code; click a