diff options
| author | Craig Jennings <c@cjennings.net> | 2026-06-08 19:43:36 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-06-08 19:43:36 -0500 |
| commit | 78260018dc83015611ae4ddd989b95a6498addfd (patch) | |
| tree | 0048ecfc82f66683bce20ff4ffb3822b9651d5b1 /docs | |
| parent | 49342bf574a73ba60a51857dae9e149c09131d7a (diff) | |
| download | dotemacs-78260018dc83015611ae4ddd989b95a6498addfd.tar.gz dotemacs-78260018dc83015611ae4ddd989b95a6498addfd.zip | |
feat(theme-studio): inline colormath.js, migrate WCAG/HSV helpers
Perceptual-metrics Phase 1. generate.py inlines the colormath.js body into the page script, stripping the ES-module export so one source feeds both the browser and the Node tests. The page's own lin, rl, contrast, rating, hsv2rgb, rgb2hsv, hex2rgb, and rgb2hex copies move into colormath.js. normHex, textOn, and ratingColor stay in the page as UI-boundary helpers.
rl now reuses colormath's canonical lin (0.04045 cutoff) instead of the old 0.03928 form. The two are byte-identical on every #rrggbb: no 8-bit channel falls between the cutoffs (10/255 = 0.0392, 11/255 = 0.0431), confirmed over 200k random pairs with zero contrast change and no AA/AAA flips.
test-colormath.mjs adds Normal/Boundary/Error cases for the migrated helpers, a seeded hsv-rgb round-trip property test, and an inline-integrity check that the generated page carries the colormath.js body verbatim, so the inlined copy and the tested module can't drift.
Diffstat (limited to 'docs')
0 files changed, 0 insertions, 0 deletions
