aboutsummaryrefslogtreecommitdiff
path: root/modules/host-environment.el
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 /modules/host-environment.el
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 'modules/host-environment.el')
0 files changed, 0 insertions, 0 deletions