aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/test-contrast.mjs
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-09 18:39:58 -0500
committerCraig Jennings <c@cjennings.net>2026-06-09 18:39:58 -0500
commit1d51a332b96c008b9b22f7597fb590d4438be0d5 (patch)
tree7fb37376524c1354fd356025bfed366270439b64 /scripts/theme-studio/test-contrast.mjs
parenta32140d65ff0feec8e3227cee82275e8e056f47f (diff)
downloaddotemacs-1d51a332b96c008b9b22f7597fb590d4438be0d5.tar.gz
dotemacs-1d51a332b96c008b9b22f7597fb590d4438be0d5.zip
feat(theme-studio): add the ramp generator core
ramp(baseHex, {n, stepL, chromaEase}) in app-core.js turns one base color into a tonal ramp: 2n steps at offsets -n..-1 and +1..+n, ordered darkest to lightest, base excluded. It holds the OKLCH hue, steps lightness by stepL, eases chroma toward the extremes so only the farthest step loses most of its color, and gamut-clamps each step with its own clamped flag. Bad input returns a structured result rather than throwing: an unparseable base gives {steps: [], error: 'bad-hex'}, and out-of-range n/stepL/chromaEase clamp into range with the clamped knob named in adjusted. Defaults are n=2, stepL=0.08, chromaEase=0.5. This is Phase 1 of the palette-ramps spec: pure logic, no UI. Tests cover mid/near-white/near-black bases, hue-hold, chroma easing, knob clamping, and malformed hex. The integrity stripper for app-core.js now drops import lines too, since the core imports normHex and the colormath helpers for the Node tests (stripped on inline, where both are already in scope).
Diffstat (limited to 'scripts/theme-studio/test-contrast.mjs')
0 files changed, 0 insertions, 0 deletions