aboutsummaryrefslogtreecommitdiff
path: root/scripts/theme-studio/test-contrast.mjs
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-06-10 00:16:11 -0500
committerCraig Jennings <c@cjennings.net>2026-06-10 00:16:11 -0500
commit072e35423098e81939da7a5b9276ab9306c3c324 (patch)
treea8f592825ba4186152f242feecb77f388bbb409e /scripts/theme-studio/test-contrast.mjs
parent22d91d60c7f0094465741e9430033c6297cd7737 (diff)
downloaddotemacs-072e35423098e81939da7a5b9276ab9306c3c324.tar.gz
dotemacs-072e35423098e81939da7a5b9276ab9306c3c324.zip
feat(theme-studio): add the color-families model core
Four pure functions in app-core.js, all derived from the hex so renaming never moves a color. familiesFromPalette groups a flat palette into the ground strip (the bg/fg assignment hexes, pinned, de-duped) plus hue families: near-neutrals split off by a chroma threshold, the rest cluster by hue proximity with a 25-degree gap and a 360 wrap, each family's base its most-saturated member. regenFamily returns a family's symmetric ramp around the base (n=0 is the base alone, handled without ramp()'s 1-4 clamp). rankByLightness gives each current member a signed offset from the base, and stepRepointPlan maps old positions to new ones across a regenerate, listing the positions that drop out so the caller can leave their references a visible "(gone)". Phase 1 of the color-families spec, pure logic, no UI. 13 node tests cover the gap split/merge, neutrals, absent and de-duped ground hexes, n=0, lightness ranking, and the survivor/removed repoint split. Suite 78 to 91 green.
Diffstat (limited to 'scripts/theme-studio/test-contrast.mjs')
0 files changed, 0 insertions, 0 deletions