Repository navigation
v0.14.0
Minor Changes
-
#63
3b6e2a6Thanks @tenphi! - Replace the OKHSL lightness axis with a contrast-uniform tone axis (OKHST) and remove the Möbius dark-mode curve.Breaking changes
- The
lightnessauthoring prop is gone. Usetone(0–100, contrast-uniform) everywhere — theme colors,glaze.color()structured input, and relative offsets. Equal tone steps now give equal WCAG contrast, so numeric values won't map to the same OKHSL lightness as before; re-check absolute mid-range values. - Config windows changed:
lightLightness/darkLightness→lightTone/darkTone. A window is[lo, hi](reference eps — the common form),{ lo, hi, eps }(advanced eps tuning), orfalseto disable clamping.falseremoves the boundaries (full[0, 100]range) but keeps the contrast-uniform tone curve.darkCurvewas removed. ResolvedColorVariantnow stores{ h, s, t, alpha }(tone) instead of{ h, s, l }. Use the newvariantToOkhsl()helper to recover OKHSL lightness.- Export snapshots now carry
lightTone/darkTonewindows. - Relative
toneoffsets that overshoot[0, 100]now mirror to the other side of the base by default (the newflip, inheritingautoFlip) instead of clamping. Setflip: false(orautoFlip: false) to restore clamping.
New
tone: 'max'/'min'forces a color to the scheme's tone extreme (lightest / darkest) with nobaseand no contrast hack; undermode: 'auto'they invert in dark like any tone.flipper-color prop (default: globalautoFlip): mirrors out-of-bounds relativetoneovershoot and unmetcontrastto the opposite side of the base, or clamps whenfalse.- Tone windows accept the
[lo, hi]array shorthand alongside{ lo, hi, eps }andfalse. contrastaccepts a metric selector: a bare number/preset is WCAG,{ wcag }/{ apca }picks the metric, and the[normal, hc]pair may live at the outer level or inside the metric ({ wcag: [4.5, 7] }).- APCA Lc contrast solving alongside WCAG, plus an APCA-based drift verification warning for chromatic swatches.
- OKHST input:
okhst(H S% T%)strings and{ h, s, t }objects (input only — never emitted). saturationTaperconfig knob (default0.15) gently rolls off saturation toward the tone extremes.- New exports:
toTone,fromTone,toneFromY,yFromTone,okhstToOkhsl,okhslToOkhst,variantToOkhsl,REF_EPS,findToneForContrast,resolveContrastForMode,apcaContrast, and theContrastSpec/OkhstColor/ToneWindow/ExtremeValue/ToneValuetypes.
- The
Patch Changes
- #63
3b6e2a6Thanks @tenphi! - Adjust the default tone-window floors:lightToneis now[10, 100](was[13, 100]) anddarkToneis now[15, 95](was[10, 95]). The OKHST migration made dark schemes bottom out darker than the legacy pipeline for the same input; lifting the dark floor keeps the darkest dark-mode surfaces closer to the previous output, and lowering the light floor widens the usable light range. Override withlightTone: [13, 100]/darkTone: [10, 95]to restore the prior values.