fix(color): normalize scheme seeds without # to #RRGGBB
Merged
KE
13d ago+8+8+0123456789-2-2-0123456789
Summary
hexToRgb already accepts a 6-digit seed without a leading # ("ff00aa"). schemeFromSeed still stored seedHex.toUpperCase() as palette.seed, so that input became "FF00AA" instead of the canonical "#FF00AA" used everywhere else (and required by isHex).
When the seed parses, set seed from rgbToHex so it is always #RRGGBB. Invalid seeds are still uppercased as before.
Test plan
-
npx vitest run lib/color.extended.test.ts lib/color.test.ts - New case:
schemeFromSeed("ff00aa").seed === "#FF00AA"(fails before, passes after) -
npm run typecheck
Summary by cubic
Fixes schemeFromSeed so valid seeds without # are stored as #RRGGBB in palette.seed, matching the canonical format used elsewhere and required by isHex. Previously schemeFromSeed("ff00aa").seed returned "FF00AA".
- Invalid seeds are still uppercased as before.