okchroma 0.1.6 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist-lib/index.cjs +125 -122
- package/dist-lib/index.mjs +125 -122
- package/dist-lib/types/engine/requirements/spec.d.ts +2 -1
- package/package.json +3 -3
package/dist-lib/index.cjs
CHANGED
|
@@ -405,7 +405,7 @@ var NEUTRAL_TINT_POINTS = {
|
|
|
405
405
|
[0.801, 0.653],
|
|
406
406
|
// wash-7 │
|
|
407
407
|
[0.738, 0.505],
|
|
408
|
-
//
|
|
408
|
+
// wax-74
|
|
409
409
|
[0.6, 0.4],
|
|
410
410
|
// knee (ex-scaffold) the drop-off: hue fades as you climb
|
|
411
411
|
[0.56, 0.347],
|
|
@@ -431,7 +431,7 @@ var NEUTRAL_TINT_POINTS = {
|
|
|
431
431
|
[0.42, 0.653],
|
|
432
432
|
// wash-7
|
|
433
433
|
[0.55, 0.505],
|
|
434
|
-
//
|
|
434
|
+
// wax-74
|
|
435
435
|
[0.6, 0.4],
|
|
436
436
|
// knee (ex-scaffold)
|
|
437
437
|
[0.64, 0.347],
|
|
@@ -800,8 +800,118 @@ function perceptualDarkC(L, H2, nativeC, keep = KEEP_DARK, gamut = MASTER_GAMUT)
|
|
|
800
800
|
return solveCForApparent(L, H2, grayApparentL(L, gamut) + keep * meanBoost(L, nativeC, gamut), gamut);
|
|
801
801
|
}
|
|
802
802
|
|
|
803
|
+
// src/engine/tokenNames.ts
|
|
804
|
+
var SHARED_NAMES = {
|
|
805
|
+
1: "paper-99",
|
|
806
|
+
2: "paper-97",
|
|
807
|
+
// stop 3 renamed wash-3 → paper-3 (owner 2026-07-24, elevation round): it is a
|
|
808
|
+
// PLANE in both themes (light sink / dark pop), so it belongs to the surface band.
|
|
809
|
+
// NAME ONLY — generation is index-keyed and unchanged; the wash-collision machinery
|
|
810
|
+
// (collision.ts WASH_STOPS) deliberately still spans stops 3–7. (The requirement
|
|
811
|
+
// spec's `group` label followed the band to 'paper' on 2026-08-31 — labels only,
|
|
812
|
+
// the spans never moved; see spec.ts groupOf.)
|
|
813
|
+
// Stage B (owner 2026-08-07, names only): relabeled to the ROOT_L-derived digit,
|
|
814
|
+
// paper-95 — same band, same index.
|
|
815
|
+
3: "paper-95",
|
|
816
|
+
4: "wash-92",
|
|
817
|
+
5: "wash-89",
|
|
818
|
+
6: "wash-85",
|
|
819
|
+
7: "wash-80",
|
|
820
|
+
8: "wax-74",
|
|
821
|
+
// THE INK BAND (C49, owner 2026-08-05): the first text stop + emphasis fill (the
|
|
822
|
+
// 2026-07-29 highlight collapse — the old highlight-9 and on-highlight are
|
|
823
|
+
// deleted; this stop carries both jobs, its on-color a paper token), the between
|
|
824
|
+
// text stop (a value the retired text-cta hover state used to generate bespokely,
|
|
825
|
+
// promoted to a normal stop), and the strong text stop. The three read as states
|
|
826
|
+
// ARE the text-style cta (owner 2026-08-12). C49 restored the top
|
|
827
|
+
// two pre-collapse stop INDICES (11, and the off-scale anchor's 12 — emitted as a
|
|
828
|
+
// literal in cssRender, not through this table) with the between stop taking the
|
|
829
|
+
// vacated index 10; the indices (9/10/11) are unchanged since.
|
|
830
|
+
9: "lead-53",
|
|
831
|
+
10: "ink-42",
|
|
832
|
+
11: "ink-30"
|
|
833
|
+
};
|
|
834
|
+
var SCALE_STOP_COUNT = Object.keys(SHARED_NAMES).length;
|
|
835
|
+
function stopTokenName(stop) {
|
|
836
|
+
const name = SHARED_NAMES[stop];
|
|
837
|
+
if (!name) throw new Error(`stopTokenName: unexpected stop ${stop}`);
|
|
838
|
+
return name;
|
|
839
|
+
}
|
|
840
|
+
var PAPER_100 = "paper-100";
|
|
841
|
+
var INK_0 = "ink-0";
|
|
842
|
+
var STAMP_FILL = "stamp-fill";
|
|
843
|
+
var STAMP_FILL_HOVER = "stamp-fill-hover";
|
|
844
|
+
var STAMP_FILL_PRESSED = "stamp-fill-pressed";
|
|
845
|
+
var STAMP_EDGE = "stamp-edge";
|
|
846
|
+
var STAMP_ON = "stamp-on";
|
|
847
|
+
var STAMP_STATE_LEAVES = {
|
|
848
|
+
[STAMP_FILL]: "stamp/fill",
|
|
849
|
+
[STAMP_FILL_HOVER]: "stamp/fill-hover",
|
|
850
|
+
[STAMP_FILL_PRESSED]: "stamp/fill-pressed",
|
|
851
|
+
[STAMP_EDGE]: "stamp/edge",
|
|
852
|
+
[STAMP_ON]: "stamp/on"
|
|
853
|
+
};
|
|
854
|
+
var STAMP_LEAF = {
|
|
855
|
+
FILL: STAMP_STATE_LEAVES[STAMP_FILL],
|
|
856
|
+
FILL_HOVER: STAMP_STATE_LEAVES[STAMP_FILL_HOVER],
|
|
857
|
+
FILL_PRESSED: STAMP_STATE_LEAVES[STAMP_FILL_PRESSED],
|
|
858
|
+
EDGE: STAMP_STATE_LEAVES[STAMP_EDGE],
|
|
859
|
+
ON: STAMP_STATE_LEAVES[STAMP_ON]
|
|
860
|
+
};
|
|
861
|
+
var SYSTEM_LEAF = {
|
|
862
|
+
ABS_BLACK: "system/abs-black",
|
|
863
|
+
ABS_WHITE: "system/abs-white",
|
|
864
|
+
SURFACE: {
|
|
865
|
+
DIM: "system/surface/dim",
|
|
866
|
+
LOW: "system/surface/low",
|
|
867
|
+
MID: "system/surface/mid",
|
|
868
|
+
HIGH: "system/surface/high"
|
|
869
|
+
},
|
|
870
|
+
ALPHA: {
|
|
871
|
+
TRANSPARENT: "system/alpha/transparent",
|
|
872
|
+
SCRIM: "system/alpha/abs-black-060",
|
|
873
|
+
INK: "system/alpha/ink",
|
|
874
|
+
// the DIRECTIONAL ladders (owner 2026-08-31, renaming the 2026-08-18 bare rungs
|
|
875
|
+
// and the 2026-08-29 inverse ladder): away-from-bg is the page-polarity pole
|
|
876
|
+
// (black in light, white in dark), toward-bg the flipped pole — STATE LAYERS for
|
|
877
|
+
// INVERTED grounds, whose polarity is opposite the page's. (Never call toward-bg
|
|
878
|
+
// a "wash": that word belongs to the tinted band stops.) The reversal lives in
|
|
879
|
+
// the engine: a consumer on an inverted ground names one token and never picks a
|
|
880
|
+
// pole. Colored fills never ride these; their states stay engine-solved stops.
|
|
881
|
+
// Rungs are two-digit percent, harmonizing with shadow-04/08/12.
|
|
882
|
+
AWAY_FROM_BG_06: "system/alpha/away-from-bg/06",
|
|
883
|
+
AWAY_FROM_BG_08: "system/alpha/away-from-bg/08",
|
|
884
|
+
AWAY_FROM_BG_16: "system/alpha/away-from-bg/16",
|
|
885
|
+
TOWARD_BG_06: "system/alpha/toward-bg/06",
|
|
886
|
+
TOWARD_BG_08: "system/alpha/toward-bg/08",
|
|
887
|
+
TOWARD_BG_16: "system/alpha/toward-bg/16",
|
|
888
|
+
SHADOW_04: "system/alpha/shadow-04",
|
|
889
|
+
SHADOW_08: "system/alpha/shadow-08",
|
|
890
|
+
SHADOW_12: "system/alpha/shadow-12"
|
|
891
|
+
}
|
|
892
|
+
};
|
|
893
|
+
var SURFACE_PLANE_LAW = {
|
|
894
|
+
[SYSTEM_LEAF.SURFACE.DIM]: { light: SHARED_NAMES[3], dark: PAPER_100 },
|
|
895
|
+
[SYSTEM_LEAF.SURFACE.LOW]: { light: SHARED_NAMES[2], dark: SHARED_NAMES[1] },
|
|
896
|
+
[SYSTEM_LEAF.SURFACE.MID]: { light: SHARED_NAMES[1], dark: SHARED_NAMES[2] },
|
|
897
|
+
[SYSTEM_LEAF.SURFACE.HIGH]: { light: PAPER_100, dark: SHARED_NAMES[3] }
|
|
898
|
+
};
|
|
899
|
+
var TOKEN_ORDER = [
|
|
900
|
+
...Object.values(SHARED_NAMES),
|
|
901
|
+
STAMP_FILL,
|
|
902
|
+
STAMP_FILL_HOVER,
|
|
903
|
+
STAMP_FILL_PRESSED,
|
|
904
|
+
STAMP_ON,
|
|
905
|
+
"identity"
|
|
906
|
+
];
|
|
907
|
+
function tokenOrder(name) {
|
|
908
|
+
const i = TOKEN_ORDER.indexOf(name);
|
|
909
|
+
return i === -1 ? TOKEN_ORDER.length : i;
|
|
910
|
+
}
|
|
911
|
+
|
|
803
912
|
// src/engine/requirements/spec.ts
|
|
804
|
-
var
|
|
913
|
+
var inkLane = (g2) => g2 === "lead" || g2 === "ink";
|
|
914
|
+
var groupOf = (stop) => (stop === 0 ? PAPER_100 : stopTokenName(stop)).split("-")[0];
|
|
805
915
|
var PAPER0_DARK_ROOT_L = 0.16;
|
|
806
916
|
var PL_LADDER = { hue: "warm-drift", L: "perceptual", chroma: "ladder" };
|
|
807
917
|
var PL_TEXT = { hue: "warm-drift", L: "perceptual", chroma: "brand" };
|
|
@@ -816,7 +926,7 @@ var ONS = { onFill: { metric: "apca-pole", enforce: true, ratioFloor: 4.5, coEnf
|
|
|
816
926
|
var LIGHT = {
|
|
817
927
|
stops: [
|
|
818
928
|
// paper-100 (paper-0 pre-Stage-B): the resolved ladder extreme — in light it genuinely is white (rootL 1.0, zero chroma)
|
|
819
|
-
{ stop: 0, rootL: 1, group:
|
|
929
|
+
{ stop: 0, rootL: 1, group: groupOf(0), produce: { hue: "warm-drift", L: "fixed", chroma: "ladder" }, satFraction: SCALE_C_LIGHT[0].sat, baseC: SCALE_C_LIGHT[0].base },
|
|
820
930
|
// paper/wash/wax-74: perceptual ladder/envelope blend on the geometric ROOT_L_LIGHT scaffold. Separation
|
|
821
931
|
// falls out of the shape (see above) — no min-separation require. Only stop 8 carries a require: the WCAG
|
|
822
932
|
// 3:1 vs the resolved paper-97 (paper-2) (re-solves automatically since it references paper-97 (paper-2)).
|
|
@@ -832,9 +942,9 @@ var LIGHT = {
|
|
|
832
942
|
// ink text: perceptual + contrast-required. lead-53 (ink-9) is ALSO the emphasis fill (the
|
|
833
943
|
// highlight-9 collapse, owner 2026-07-29). ink-42 (ink-10) is the between text stop (C49) —
|
|
834
944
|
// a normal stop like its neighbors; the three together are the text-register cta.
|
|
835
|
-
{ stop: 9, rootL: ROOT_L_LIGHT[9], group:
|
|
836
|
-
{ stop: 10, rootL: ROOT_L_LIGHT[10], group:
|
|
837
|
-
{ stop: 11, rootL: ROOT_L_LIGHT[11], group:
|
|
945
|
+
{ stop: 9, rootL: ROOT_L_LIGHT[9], group: groupOf(9), produce: PL_TEXT, chromaMult: SCALE_C_LIGHT[9].inkMult, inkMaxC: SCALE_C_LIGHT[9].inkMaxC, chromaFloor: SCALE_C_LIGHT[9].chromaFloor, require: T9 },
|
|
946
|
+
{ stop: 10, rootL: ROOT_L_LIGHT[10], group: groupOf(10), produce: PL_TEXT, chromaMult: SCALE_C_LIGHT[10].inkMult, inkMaxC: SCALE_C_LIGHT[10].inkMaxC, chromaFloor: SCALE_C_LIGHT[10].chromaFloor, require: T10 },
|
|
947
|
+
{ stop: 11, rootL: ROOT_L_LIGHT[11], group: groupOf(11), produce: PL_TEXT, chromaMult: SCALE_C_LIGHT[11].inkMult, inkMaxC: SCALE_C_LIGHT[11].inkMaxC, chromaFloor: SCALE_C_LIGHT[11].chromaFloor, require: T11 }
|
|
838
948
|
],
|
|
839
949
|
roles: [
|
|
840
950
|
{ role: "cta", produce: { hue: "constant", L: "anchor", chroma: "brand" }, floorL: 0, chromaMult: 1 },
|
|
@@ -847,7 +957,7 @@ var DARK = {
|
|
|
847
957
|
stops: [
|
|
848
958
|
// paper-100 (paper-0 pre-Stage-B): the resolved ladder extreme — one seam BELOW paper-99 (paper-1), deep and brand-tinted, never the
|
|
849
959
|
// absolute void (the old hard-coded #000000 was "too much"). Lift applies like the rest of the scale.
|
|
850
|
-
{ stop: 0, rootL: PAPER0_DARK_ROOT_L, group:
|
|
960
|
+
{ stop: 0, rootL: PAPER0_DARK_ROOT_L, group: groupOf(0), produce: P_LIFT, satFraction: SCALE_C_DARK[0].sat },
|
|
851
961
|
// paper/wash 1–7: perceptual on the dark scaffold. stop 8: FIXED at the hand-placed scaffold BUT with the
|
|
852
962
|
// 3:1 non-text require DECLARED (the Stage-5 flip, owner-approved) — the blue-recede failure is prevented
|
|
853
963
|
// BY RULE, not by patch. The require now genuinely PLACES the stop rather than catching a few low-luminance
|
|
@@ -864,9 +974,9 @@ var DARK = {
|
|
|
864
974
|
})),
|
|
865
975
|
// ink text: perceptual + the contrast requires DECLARED in dark too (Stage-5 flip): the scaffold already
|
|
866
976
|
// clears them for every hue (the gate proves it), so values don't move — but the guarantee is now a rule.
|
|
867
|
-
{ stop: 9, rootL: ROOT_L_DARK[9], group:
|
|
868
|
-
{ stop: 10, rootL: ROOT_L_DARK[10], group:
|
|
869
|
-
{ stop: 11, rootL: ROOT_L_DARK[11], group:
|
|
977
|
+
{ stop: 9, rootL: ROOT_L_DARK[9], group: groupOf(9), produce: P_TEXT, chromaMult: SCALE_C_DARK[9].inkMult, inkMaxC: SCALE_C_DARK[9].inkMaxC, chromaFloor: SCALE_C_DARK[9].chromaFloor, require: T9 },
|
|
978
|
+
{ stop: 10, rootL: ROOT_L_DARK[10], group: groupOf(10), produce: P_TEXT, chromaMult: SCALE_C_DARK[10].inkMult, inkMaxC: SCALE_C_DARK[10].inkMaxC, chromaFloor: SCALE_C_DARK[10].chromaFloor, require: T10 },
|
|
979
|
+
{ stop: 11, rootL: ROOT_L_DARK[11], group: groupOf(11), produce: P_TEXT, chromaMult: SCALE_C_DARK[11].inkMult, inkMaxC: SCALE_C_DARK[11].inkMaxC, chromaFloor: SCALE_C_DARK[11].chromaFloor, require: T11 }
|
|
870
980
|
],
|
|
871
981
|
roles: [
|
|
872
982
|
{ role: "cta", produce: { hue: "constant", L: "anchor", chroma: "brand" }, floorL: DARK_CTA_MIN_L, chromaMult: 1 },
|
|
@@ -2303,7 +2413,7 @@ function resolveRamp(hex, mode, spec, opts) {
|
|
|
2303
2413
|
let placed;
|
|
2304
2414
|
let clamped = false, unresolvable;
|
|
2305
2415
|
if (mode === "light") {
|
|
2306
|
-
if (sp.group
|
|
2416
|
+
if (inkLane(sp.group)) {
|
|
2307
2417
|
if (!sp.require) throw new Error(`light ink stop ${sp.stop} must declare a contrast require`);
|
|
2308
2418
|
placed = placeLightText(ctx, sp.rootL, sp.chromaMult ?? 1, maxLForOf(sp.require, sp.stop, false), INK_DEEPEN, sp.inkMaxC);
|
|
2309
2419
|
clamped = true;
|
|
@@ -2327,8 +2437,8 @@ function resolveRamp(hex, mode, spec, opts) {
|
|
|
2327
2437
|
}
|
|
2328
2438
|
} else {
|
|
2329
2439
|
const d = dctx;
|
|
2330
|
-
const inkTwin = sp.group
|
|
2331
|
-
const chromaAt = sp.group
|
|
2440
|
+
const inkTwin = inkLane(sp.group) && ctx.opts?.deltaCarry && ctx.opts?.chromaCurve ? ctx.opts.deltaLightStops?.find((s) => s.stop === sp.stop) : void 0;
|
|
2441
|
+
const chromaAt = inkLane(sp.group) ? inkTwin ? ((_L) => inkTwin.C) : darkInkChromaAt(ctx, d, sp.chromaFloor ?? chromaFloorBase(sp.stop), sp.chromaMult ?? 1, sp.inkMaxC) : darkScaleChromaAt(ctx, d, Math.max(0, sp.stop - 1), sp.satFraction ?? 1);
|
|
2332
2442
|
let spineH = null;
|
|
2333
2443
|
const dl = ctx.opts?.deltaLightStops;
|
|
2334
2444
|
const ls = dl && sp.stop >= 1 && sp.stop <= 8 ? dl.find((s) => s.stop === sp.stop) : void 0;
|
|
@@ -2348,7 +2458,7 @@ function resolveRamp(hex, mode, spec, opts) {
|
|
|
2348
2458
|
}
|
|
2349
2459
|
if (ctx.opts.deltaHKPlace) L = perceptualRungL(sp.rootL, ls.C, ls.H);
|
|
2350
2460
|
if (ctx.opts.deltaLiftFloor) L = Math.max(L, sp.rootL);
|
|
2351
|
-
if (ctx.opts.deltaChromaEq && sp.group
|
|
2461
|
+
if (ctx.opts.deltaChromaEq && !inkLane(sp.group)) C2 = ctx.cAt("dark", L, perceptualDarkC(L, ls.H, ctx.brandC));
|
|
2352
2462
|
placed = { L, C: C2, H: spineH ?? ls.H };
|
|
2353
2463
|
} else if (sp.produce.L === "fixed") {
|
|
2354
2464
|
placed = ls ? placeDarkDelta(d, sp.rootL, chromaAt, ls) : { L: sp.rootL, C: chromaAt(sp.rootL), H: d.darkHueAtL(sp.rootL) };
|
|
@@ -3358,113 +3468,6 @@ function resolveTheme(input) {
|
|
|
3358
3468
|
};
|
|
3359
3469
|
}
|
|
3360
3470
|
|
|
3361
|
-
// src/engine/tokenNames.ts
|
|
3362
|
-
var SHARED_NAMES = {
|
|
3363
|
-
1: "paper-99",
|
|
3364
|
-
2: "paper-97",
|
|
3365
|
-
// stop 3 renamed wash-3 → paper-3 (owner 2026-07-24, elevation round): it is a
|
|
3366
|
-
// PLANE in both themes (light sink / dark pop), so it belongs to the surface band.
|
|
3367
|
-
// NAME ONLY — generation is index-keyed and unchanged; the internal wash machinery
|
|
3368
|
-
// (reqtoken groupOf, collision WASH_STOPS) deliberately still spans stops 3–7.
|
|
3369
|
-
// Stage B (owner 2026-08-07, names only): relabeled to the ROOT_L-derived digit,
|
|
3370
|
-
// paper-95 — same band, same index.
|
|
3371
|
-
3: "paper-95",
|
|
3372
|
-
4: "wash-92",
|
|
3373
|
-
5: "wash-89",
|
|
3374
|
-
6: "wash-85",
|
|
3375
|
-
7: "wash-80",
|
|
3376
|
-
8: "wax-74",
|
|
3377
|
-
// THE INK BAND (C49, owner 2026-08-05): the first text stop + emphasis fill (the
|
|
3378
|
-
// 2026-07-29 highlight collapse — the old highlight-9 and on-highlight are
|
|
3379
|
-
// deleted; this stop carries both jobs, its on-color a paper token), the between
|
|
3380
|
-
// text stop (a value the retired text-cta hover state used to generate bespokely,
|
|
3381
|
-
// promoted to a normal stop), and the strong text stop. The three read as states
|
|
3382
|
-
// ARE the text-style cta (owner 2026-08-12). C49 restored the top
|
|
3383
|
-
// two pre-collapse stop INDICES (11, and the off-scale anchor's 12 — emitted as a
|
|
3384
|
-
// literal in cssRender, not through this table) with the between stop taking the
|
|
3385
|
-
// vacated index 10; the indices (9/10/11) are unchanged since.
|
|
3386
|
-
9: "lead-53",
|
|
3387
|
-
10: "ink-42",
|
|
3388
|
-
11: "ink-30"
|
|
3389
|
-
};
|
|
3390
|
-
var SCALE_STOP_COUNT = Object.keys(SHARED_NAMES).length;
|
|
3391
|
-
function stopTokenName(stop) {
|
|
3392
|
-
const name = SHARED_NAMES[stop];
|
|
3393
|
-
if (!name) throw new Error(`stopTokenName: unexpected stop ${stop}`);
|
|
3394
|
-
return name;
|
|
3395
|
-
}
|
|
3396
|
-
var PAPER_100 = "paper-100";
|
|
3397
|
-
var INK_0 = "ink-0";
|
|
3398
|
-
var STAMP_FILL = "stamp-fill";
|
|
3399
|
-
var STAMP_FILL_HOVER = "stamp-fill-hover";
|
|
3400
|
-
var STAMP_FILL_PRESSED = "stamp-fill-pressed";
|
|
3401
|
-
var STAMP_EDGE = "stamp-edge";
|
|
3402
|
-
var STAMP_ON = "stamp-on";
|
|
3403
|
-
var STAMP_STATE_LEAVES = {
|
|
3404
|
-
[STAMP_FILL]: "stamp/fill",
|
|
3405
|
-
[STAMP_FILL_HOVER]: "stamp/fill-hover",
|
|
3406
|
-
[STAMP_FILL_PRESSED]: "stamp/fill-pressed",
|
|
3407
|
-
[STAMP_EDGE]: "stamp/edge",
|
|
3408
|
-
[STAMP_ON]: "stamp/on"
|
|
3409
|
-
};
|
|
3410
|
-
var STAMP_LEAF = {
|
|
3411
|
-
FILL: STAMP_STATE_LEAVES[STAMP_FILL],
|
|
3412
|
-
FILL_HOVER: STAMP_STATE_LEAVES[STAMP_FILL_HOVER],
|
|
3413
|
-
FILL_PRESSED: STAMP_STATE_LEAVES[STAMP_FILL_PRESSED],
|
|
3414
|
-
EDGE: STAMP_STATE_LEAVES[STAMP_EDGE],
|
|
3415
|
-
ON: STAMP_STATE_LEAVES[STAMP_ON]
|
|
3416
|
-
};
|
|
3417
|
-
var SYSTEM_LEAF = {
|
|
3418
|
-
ABS_BLACK: "system/abs-black",
|
|
3419
|
-
ABS_WHITE: "system/abs-white",
|
|
3420
|
-
SURFACE: {
|
|
3421
|
-
DIM: "system/surface/dim",
|
|
3422
|
-
LOW: "system/surface/low",
|
|
3423
|
-
MID: "system/surface/mid",
|
|
3424
|
-
HIGH: "system/surface/high"
|
|
3425
|
-
},
|
|
3426
|
-
ALPHA: {
|
|
3427
|
-
TRANSPARENT: "system/alpha/transparent",
|
|
3428
|
-
SCRIM: "system/alpha/abs-black-060",
|
|
3429
|
-
INK: "system/alpha/ink",
|
|
3430
|
-
// the DIRECTIONAL ladders (owner 2026-08-31, renaming the 2026-08-18 bare rungs
|
|
3431
|
-
// and the 2026-08-29 inverse ladder): away-from-bg is the page-polarity pole
|
|
3432
|
-
// (black in light, white in dark), toward-bg the flipped pole — STATE LAYERS for
|
|
3433
|
-
// INVERTED grounds, whose polarity is opposite the page's. (Never call toward-bg
|
|
3434
|
-
// a "wash": that word belongs to the tinted band stops.) The reversal lives in
|
|
3435
|
-
// the engine: a consumer on an inverted ground names one token and never picks a
|
|
3436
|
-
// pole. Colored fills never ride these; their states stay engine-solved stops.
|
|
3437
|
-
// Rungs are two-digit percent, harmonizing with shadow-04/08/12.
|
|
3438
|
-
AWAY_FROM_BG_06: "system/alpha/away-from-bg/06",
|
|
3439
|
-
AWAY_FROM_BG_08: "system/alpha/away-from-bg/08",
|
|
3440
|
-
AWAY_FROM_BG_16: "system/alpha/away-from-bg/16",
|
|
3441
|
-
TOWARD_BG_06: "system/alpha/toward-bg/06",
|
|
3442
|
-
TOWARD_BG_08: "system/alpha/toward-bg/08",
|
|
3443
|
-
TOWARD_BG_16: "system/alpha/toward-bg/16",
|
|
3444
|
-
SHADOW_04: "system/alpha/shadow-04",
|
|
3445
|
-
SHADOW_08: "system/alpha/shadow-08",
|
|
3446
|
-
SHADOW_12: "system/alpha/shadow-12"
|
|
3447
|
-
}
|
|
3448
|
-
};
|
|
3449
|
-
var SURFACE_PLANE_LAW = {
|
|
3450
|
-
[SYSTEM_LEAF.SURFACE.DIM]: { light: SHARED_NAMES[3], dark: PAPER_100 },
|
|
3451
|
-
[SYSTEM_LEAF.SURFACE.LOW]: { light: SHARED_NAMES[2], dark: SHARED_NAMES[1] },
|
|
3452
|
-
[SYSTEM_LEAF.SURFACE.MID]: { light: SHARED_NAMES[1], dark: SHARED_NAMES[2] },
|
|
3453
|
-
[SYSTEM_LEAF.SURFACE.HIGH]: { light: PAPER_100, dark: SHARED_NAMES[3] }
|
|
3454
|
-
};
|
|
3455
|
-
var TOKEN_ORDER = [
|
|
3456
|
-
...Object.values(SHARED_NAMES),
|
|
3457
|
-
STAMP_FILL,
|
|
3458
|
-
STAMP_FILL_HOVER,
|
|
3459
|
-
STAMP_FILL_PRESSED,
|
|
3460
|
-
STAMP_ON,
|
|
3461
|
-
"identity"
|
|
3462
|
-
];
|
|
3463
|
-
function tokenOrder(name) {
|
|
3464
|
-
const i = TOKEN_ORDER.indexOf(name);
|
|
3465
|
-
return i === -1 ? TOKEN_ORDER.length : i;
|
|
3466
|
-
}
|
|
3467
|
-
|
|
3468
3471
|
// src/engine/cssRender.ts
|
|
3469
3472
|
var { brandPrimary: CSS_BRAND, brandSecondary: CSS_SECONDARY, neutral: CSS_NEUTRAL } = CSS_FAMILY;
|
|
3470
3473
|
function toHex2(r, g2, b) {
|
package/dist-lib/index.mjs
CHANGED
|
@@ -326,7 +326,7 @@ var NEUTRAL_TINT_POINTS = {
|
|
|
326
326
|
[0.801, 0.653],
|
|
327
327
|
// wash-7 │
|
|
328
328
|
[0.738, 0.505],
|
|
329
|
-
//
|
|
329
|
+
// wax-74
|
|
330
330
|
[0.6, 0.4],
|
|
331
331
|
// knee (ex-scaffold) the drop-off: hue fades as you climb
|
|
332
332
|
[0.56, 0.347],
|
|
@@ -352,7 +352,7 @@ var NEUTRAL_TINT_POINTS = {
|
|
|
352
352
|
[0.42, 0.653],
|
|
353
353
|
// wash-7
|
|
354
354
|
[0.55, 0.505],
|
|
355
|
-
//
|
|
355
|
+
// wax-74
|
|
356
356
|
[0.6, 0.4],
|
|
357
357
|
// knee (ex-scaffold)
|
|
358
358
|
[0.64, 0.347],
|
|
@@ -721,8 +721,118 @@ function perceptualDarkC(L, H2, nativeC, keep = KEEP_DARK, gamut = MASTER_GAMUT)
|
|
|
721
721
|
return solveCForApparent(L, H2, grayApparentL(L, gamut) + keep * meanBoost(L, nativeC, gamut), gamut);
|
|
722
722
|
}
|
|
723
723
|
|
|
724
|
+
// src/engine/tokenNames.ts
|
|
725
|
+
var SHARED_NAMES = {
|
|
726
|
+
1: "paper-99",
|
|
727
|
+
2: "paper-97",
|
|
728
|
+
// stop 3 renamed wash-3 → paper-3 (owner 2026-07-24, elevation round): it is a
|
|
729
|
+
// PLANE in both themes (light sink / dark pop), so it belongs to the surface band.
|
|
730
|
+
// NAME ONLY — generation is index-keyed and unchanged; the wash-collision machinery
|
|
731
|
+
// (collision.ts WASH_STOPS) deliberately still spans stops 3–7. (The requirement
|
|
732
|
+
// spec's `group` label followed the band to 'paper' on 2026-08-31 — labels only,
|
|
733
|
+
// the spans never moved; see spec.ts groupOf.)
|
|
734
|
+
// Stage B (owner 2026-08-07, names only): relabeled to the ROOT_L-derived digit,
|
|
735
|
+
// paper-95 — same band, same index.
|
|
736
|
+
3: "paper-95",
|
|
737
|
+
4: "wash-92",
|
|
738
|
+
5: "wash-89",
|
|
739
|
+
6: "wash-85",
|
|
740
|
+
7: "wash-80",
|
|
741
|
+
8: "wax-74",
|
|
742
|
+
// THE INK BAND (C49, owner 2026-08-05): the first text stop + emphasis fill (the
|
|
743
|
+
// 2026-07-29 highlight collapse — the old highlight-9 and on-highlight are
|
|
744
|
+
// deleted; this stop carries both jobs, its on-color a paper token), the between
|
|
745
|
+
// text stop (a value the retired text-cta hover state used to generate bespokely,
|
|
746
|
+
// promoted to a normal stop), and the strong text stop. The three read as states
|
|
747
|
+
// ARE the text-style cta (owner 2026-08-12). C49 restored the top
|
|
748
|
+
// two pre-collapse stop INDICES (11, and the off-scale anchor's 12 — emitted as a
|
|
749
|
+
// literal in cssRender, not through this table) with the between stop taking the
|
|
750
|
+
// vacated index 10; the indices (9/10/11) are unchanged since.
|
|
751
|
+
9: "lead-53",
|
|
752
|
+
10: "ink-42",
|
|
753
|
+
11: "ink-30"
|
|
754
|
+
};
|
|
755
|
+
var SCALE_STOP_COUNT = Object.keys(SHARED_NAMES).length;
|
|
756
|
+
function stopTokenName(stop) {
|
|
757
|
+
const name = SHARED_NAMES[stop];
|
|
758
|
+
if (!name) throw new Error(`stopTokenName: unexpected stop ${stop}`);
|
|
759
|
+
return name;
|
|
760
|
+
}
|
|
761
|
+
var PAPER_100 = "paper-100";
|
|
762
|
+
var INK_0 = "ink-0";
|
|
763
|
+
var STAMP_FILL = "stamp-fill";
|
|
764
|
+
var STAMP_FILL_HOVER = "stamp-fill-hover";
|
|
765
|
+
var STAMP_FILL_PRESSED = "stamp-fill-pressed";
|
|
766
|
+
var STAMP_EDGE = "stamp-edge";
|
|
767
|
+
var STAMP_ON = "stamp-on";
|
|
768
|
+
var STAMP_STATE_LEAVES = {
|
|
769
|
+
[STAMP_FILL]: "stamp/fill",
|
|
770
|
+
[STAMP_FILL_HOVER]: "stamp/fill-hover",
|
|
771
|
+
[STAMP_FILL_PRESSED]: "stamp/fill-pressed",
|
|
772
|
+
[STAMP_EDGE]: "stamp/edge",
|
|
773
|
+
[STAMP_ON]: "stamp/on"
|
|
774
|
+
};
|
|
775
|
+
var STAMP_LEAF = {
|
|
776
|
+
FILL: STAMP_STATE_LEAVES[STAMP_FILL],
|
|
777
|
+
FILL_HOVER: STAMP_STATE_LEAVES[STAMP_FILL_HOVER],
|
|
778
|
+
FILL_PRESSED: STAMP_STATE_LEAVES[STAMP_FILL_PRESSED],
|
|
779
|
+
EDGE: STAMP_STATE_LEAVES[STAMP_EDGE],
|
|
780
|
+
ON: STAMP_STATE_LEAVES[STAMP_ON]
|
|
781
|
+
};
|
|
782
|
+
var SYSTEM_LEAF = {
|
|
783
|
+
ABS_BLACK: "system/abs-black",
|
|
784
|
+
ABS_WHITE: "system/abs-white",
|
|
785
|
+
SURFACE: {
|
|
786
|
+
DIM: "system/surface/dim",
|
|
787
|
+
LOW: "system/surface/low",
|
|
788
|
+
MID: "system/surface/mid",
|
|
789
|
+
HIGH: "system/surface/high"
|
|
790
|
+
},
|
|
791
|
+
ALPHA: {
|
|
792
|
+
TRANSPARENT: "system/alpha/transparent",
|
|
793
|
+
SCRIM: "system/alpha/abs-black-060",
|
|
794
|
+
INK: "system/alpha/ink",
|
|
795
|
+
// the DIRECTIONAL ladders (owner 2026-08-31, renaming the 2026-08-18 bare rungs
|
|
796
|
+
// and the 2026-08-29 inverse ladder): away-from-bg is the page-polarity pole
|
|
797
|
+
// (black in light, white in dark), toward-bg the flipped pole — STATE LAYERS for
|
|
798
|
+
// INVERTED grounds, whose polarity is opposite the page's. (Never call toward-bg
|
|
799
|
+
// a "wash": that word belongs to the tinted band stops.) The reversal lives in
|
|
800
|
+
// the engine: a consumer on an inverted ground names one token and never picks a
|
|
801
|
+
// pole. Colored fills never ride these; their states stay engine-solved stops.
|
|
802
|
+
// Rungs are two-digit percent, harmonizing with shadow-04/08/12.
|
|
803
|
+
AWAY_FROM_BG_06: "system/alpha/away-from-bg/06",
|
|
804
|
+
AWAY_FROM_BG_08: "system/alpha/away-from-bg/08",
|
|
805
|
+
AWAY_FROM_BG_16: "system/alpha/away-from-bg/16",
|
|
806
|
+
TOWARD_BG_06: "system/alpha/toward-bg/06",
|
|
807
|
+
TOWARD_BG_08: "system/alpha/toward-bg/08",
|
|
808
|
+
TOWARD_BG_16: "system/alpha/toward-bg/16",
|
|
809
|
+
SHADOW_04: "system/alpha/shadow-04",
|
|
810
|
+
SHADOW_08: "system/alpha/shadow-08",
|
|
811
|
+
SHADOW_12: "system/alpha/shadow-12"
|
|
812
|
+
}
|
|
813
|
+
};
|
|
814
|
+
var SURFACE_PLANE_LAW = {
|
|
815
|
+
[SYSTEM_LEAF.SURFACE.DIM]: { light: SHARED_NAMES[3], dark: PAPER_100 },
|
|
816
|
+
[SYSTEM_LEAF.SURFACE.LOW]: { light: SHARED_NAMES[2], dark: SHARED_NAMES[1] },
|
|
817
|
+
[SYSTEM_LEAF.SURFACE.MID]: { light: SHARED_NAMES[1], dark: SHARED_NAMES[2] },
|
|
818
|
+
[SYSTEM_LEAF.SURFACE.HIGH]: { light: PAPER_100, dark: SHARED_NAMES[3] }
|
|
819
|
+
};
|
|
820
|
+
var TOKEN_ORDER = [
|
|
821
|
+
...Object.values(SHARED_NAMES),
|
|
822
|
+
STAMP_FILL,
|
|
823
|
+
STAMP_FILL_HOVER,
|
|
824
|
+
STAMP_FILL_PRESSED,
|
|
825
|
+
STAMP_ON,
|
|
826
|
+
"identity"
|
|
827
|
+
];
|
|
828
|
+
function tokenOrder(name) {
|
|
829
|
+
const i = TOKEN_ORDER.indexOf(name);
|
|
830
|
+
return i === -1 ? TOKEN_ORDER.length : i;
|
|
831
|
+
}
|
|
832
|
+
|
|
724
833
|
// src/engine/requirements/spec.ts
|
|
725
|
-
var
|
|
834
|
+
var inkLane = (g2) => g2 === "lead" || g2 === "ink";
|
|
835
|
+
var groupOf = (stop) => (stop === 0 ? PAPER_100 : stopTokenName(stop)).split("-")[0];
|
|
726
836
|
var PAPER0_DARK_ROOT_L = 0.16;
|
|
727
837
|
var PL_LADDER = { hue: "warm-drift", L: "perceptual", chroma: "ladder" };
|
|
728
838
|
var PL_TEXT = { hue: "warm-drift", L: "perceptual", chroma: "brand" };
|
|
@@ -737,7 +847,7 @@ var ONS = { onFill: { metric: "apca-pole", enforce: true, ratioFloor: 4.5, coEnf
|
|
|
737
847
|
var LIGHT = {
|
|
738
848
|
stops: [
|
|
739
849
|
// paper-100 (paper-0 pre-Stage-B): the resolved ladder extreme — in light it genuinely is white (rootL 1.0, zero chroma)
|
|
740
|
-
{ stop: 0, rootL: 1, group:
|
|
850
|
+
{ stop: 0, rootL: 1, group: groupOf(0), produce: { hue: "warm-drift", L: "fixed", chroma: "ladder" }, satFraction: SCALE_C_LIGHT[0].sat, baseC: SCALE_C_LIGHT[0].base },
|
|
741
851
|
// paper/wash/wax-74: perceptual ladder/envelope blend on the geometric ROOT_L_LIGHT scaffold. Separation
|
|
742
852
|
// falls out of the shape (see above) — no min-separation require. Only stop 8 carries a require: the WCAG
|
|
743
853
|
// 3:1 vs the resolved paper-97 (paper-2) (re-solves automatically since it references paper-97 (paper-2)).
|
|
@@ -753,9 +863,9 @@ var LIGHT = {
|
|
|
753
863
|
// ink text: perceptual + contrast-required. lead-53 (ink-9) is ALSO the emphasis fill (the
|
|
754
864
|
// highlight-9 collapse, owner 2026-07-29). ink-42 (ink-10) is the between text stop (C49) —
|
|
755
865
|
// a normal stop like its neighbors; the three together are the text-register cta.
|
|
756
|
-
{ stop: 9, rootL: ROOT_L_LIGHT[9], group:
|
|
757
|
-
{ stop: 10, rootL: ROOT_L_LIGHT[10], group:
|
|
758
|
-
{ stop: 11, rootL: ROOT_L_LIGHT[11], group:
|
|
866
|
+
{ stop: 9, rootL: ROOT_L_LIGHT[9], group: groupOf(9), produce: PL_TEXT, chromaMult: SCALE_C_LIGHT[9].inkMult, inkMaxC: SCALE_C_LIGHT[9].inkMaxC, chromaFloor: SCALE_C_LIGHT[9].chromaFloor, require: T9 },
|
|
867
|
+
{ stop: 10, rootL: ROOT_L_LIGHT[10], group: groupOf(10), produce: PL_TEXT, chromaMult: SCALE_C_LIGHT[10].inkMult, inkMaxC: SCALE_C_LIGHT[10].inkMaxC, chromaFloor: SCALE_C_LIGHT[10].chromaFloor, require: T10 },
|
|
868
|
+
{ stop: 11, rootL: ROOT_L_LIGHT[11], group: groupOf(11), produce: PL_TEXT, chromaMult: SCALE_C_LIGHT[11].inkMult, inkMaxC: SCALE_C_LIGHT[11].inkMaxC, chromaFloor: SCALE_C_LIGHT[11].chromaFloor, require: T11 }
|
|
759
869
|
],
|
|
760
870
|
roles: [
|
|
761
871
|
{ role: "cta", produce: { hue: "constant", L: "anchor", chroma: "brand" }, floorL: 0, chromaMult: 1 },
|
|
@@ -768,7 +878,7 @@ var DARK = {
|
|
|
768
878
|
stops: [
|
|
769
879
|
// paper-100 (paper-0 pre-Stage-B): the resolved ladder extreme — one seam BELOW paper-99 (paper-1), deep and brand-tinted, never the
|
|
770
880
|
// absolute void (the old hard-coded #000000 was "too much"). Lift applies like the rest of the scale.
|
|
771
|
-
{ stop: 0, rootL: PAPER0_DARK_ROOT_L, group:
|
|
881
|
+
{ stop: 0, rootL: PAPER0_DARK_ROOT_L, group: groupOf(0), produce: P_LIFT, satFraction: SCALE_C_DARK[0].sat },
|
|
772
882
|
// paper/wash 1–7: perceptual on the dark scaffold. stop 8: FIXED at the hand-placed scaffold BUT with the
|
|
773
883
|
// 3:1 non-text require DECLARED (the Stage-5 flip, owner-approved) — the blue-recede failure is prevented
|
|
774
884
|
// BY RULE, not by patch. The require now genuinely PLACES the stop rather than catching a few low-luminance
|
|
@@ -785,9 +895,9 @@ var DARK = {
|
|
|
785
895
|
})),
|
|
786
896
|
// ink text: perceptual + the contrast requires DECLARED in dark too (Stage-5 flip): the scaffold already
|
|
787
897
|
// clears them for every hue (the gate proves it), so values don't move — but the guarantee is now a rule.
|
|
788
|
-
{ stop: 9, rootL: ROOT_L_DARK[9], group:
|
|
789
|
-
{ stop: 10, rootL: ROOT_L_DARK[10], group:
|
|
790
|
-
{ stop: 11, rootL: ROOT_L_DARK[11], group:
|
|
898
|
+
{ stop: 9, rootL: ROOT_L_DARK[9], group: groupOf(9), produce: P_TEXT, chromaMult: SCALE_C_DARK[9].inkMult, inkMaxC: SCALE_C_DARK[9].inkMaxC, chromaFloor: SCALE_C_DARK[9].chromaFloor, require: T9 },
|
|
899
|
+
{ stop: 10, rootL: ROOT_L_DARK[10], group: groupOf(10), produce: P_TEXT, chromaMult: SCALE_C_DARK[10].inkMult, inkMaxC: SCALE_C_DARK[10].inkMaxC, chromaFloor: SCALE_C_DARK[10].chromaFloor, require: T10 },
|
|
900
|
+
{ stop: 11, rootL: ROOT_L_DARK[11], group: groupOf(11), produce: P_TEXT, chromaMult: SCALE_C_DARK[11].inkMult, inkMaxC: SCALE_C_DARK[11].inkMaxC, chromaFloor: SCALE_C_DARK[11].chromaFloor, require: T11 }
|
|
791
901
|
],
|
|
792
902
|
roles: [
|
|
793
903
|
{ role: "cta", produce: { hue: "constant", L: "anchor", chroma: "brand" }, floorL: DARK_CTA_MIN_L, chromaMult: 1 },
|
|
@@ -2224,7 +2334,7 @@ function resolveRamp(hex, mode, spec, opts) {
|
|
|
2224
2334
|
let placed;
|
|
2225
2335
|
let clamped = false, unresolvable;
|
|
2226
2336
|
if (mode === "light") {
|
|
2227
|
-
if (sp.group
|
|
2337
|
+
if (inkLane(sp.group)) {
|
|
2228
2338
|
if (!sp.require) throw new Error(`light ink stop ${sp.stop} must declare a contrast require`);
|
|
2229
2339
|
placed = placeLightText(ctx, sp.rootL, sp.chromaMult ?? 1, maxLForOf(sp.require, sp.stop, false), INK_DEEPEN, sp.inkMaxC);
|
|
2230
2340
|
clamped = true;
|
|
@@ -2248,8 +2358,8 @@ function resolveRamp(hex, mode, spec, opts) {
|
|
|
2248
2358
|
}
|
|
2249
2359
|
} else {
|
|
2250
2360
|
const d = dctx;
|
|
2251
|
-
const inkTwin = sp.group
|
|
2252
|
-
const chromaAt = sp.group
|
|
2361
|
+
const inkTwin = inkLane(sp.group) && ctx.opts?.deltaCarry && ctx.opts?.chromaCurve ? ctx.opts.deltaLightStops?.find((s) => s.stop === sp.stop) : void 0;
|
|
2362
|
+
const chromaAt = inkLane(sp.group) ? inkTwin ? ((_L) => inkTwin.C) : darkInkChromaAt(ctx, d, sp.chromaFloor ?? chromaFloorBase(sp.stop), sp.chromaMult ?? 1, sp.inkMaxC) : darkScaleChromaAt(ctx, d, Math.max(0, sp.stop - 1), sp.satFraction ?? 1);
|
|
2253
2363
|
let spineH = null;
|
|
2254
2364
|
const dl = ctx.opts?.deltaLightStops;
|
|
2255
2365
|
const ls = dl && sp.stop >= 1 && sp.stop <= 8 ? dl.find((s) => s.stop === sp.stop) : void 0;
|
|
@@ -2269,7 +2379,7 @@ function resolveRamp(hex, mode, spec, opts) {
|
|
|
2269
2379
|
}
|
|
2270
2380
|
if (ctx.opts.deltaHKPlace) L = perceptualRungL(sp.rootL, ls.C, ls.H);
|
|
2271
2381
|
if (ctx.opts.deltaLiftFloor) L = Math.max(L, sp.rootL);
|
|
2272
|
-
if (ctx.opts.deltaChromaEq && sp.group
|
|
2382
|
+
if (ctx.opts.deltaChromaEq && !inkLane(sp.group)) C2 = ctx.cAt("dark", L, perceptualDarkC(L, ls.H, ctx.brandC));
|
|
2273
2383
|
placed = { L, C: C2, H: spineH ?? ls.H };
|
|
2274
2384
|
} else if (sp.produce.L === "fixed") {
|
|
2275
2385
|
placed = ls ? placeDarkDelta(d, sp.rootL, chromaAt, ls) : { L: sp.rootL, C: chromaAt(sp.rootL), H: d.darkHueAtL(sp.rootL) };
|
|
@@ -3279,113 +3389,6 @@ function resolveTheme(input) {
|
|
|
3279
3389
|
};
|
|
3280
3390
|
}
|
|
3281
3391
|
|
|
3282
|
-
// src/engine/tokenNames.ts
|
|
3283
|
-
var SHARED_NAMES = {
|
|
3284
|
-
1: "paper-99",
|
|
3285
|
-
2: "paper-97",
|
|
3286
|
-
// stop 3 renamed wash-3 → paper-3 (owner 2026-07-24, elevation round): it is a
|
|
3287
|
-
// PLANE in both themes (light sink / dark pop), so it belongs to the surface band.
|
|
3288
|
-
// NAME ONLY — generation is index-keyed and unchanged; the internal wash machinery
|
|
3289
|
-
// (reqtoken groupOf, collision WASH_STOPS) deliberately still spans stops 3–7.
|
|
3290
|
-
// Stage B (owner 2026-08-07, names only): relabeled to the ROOT_L-derived digit,
|
|
3291
|
-
// paper-95 — same band, same index.
|
|
3292
|
-
3: "paper-95",
|
|
3293
|
-
4: "wash-92",
|
|
3294
|
-
5: "wash-89",
|
|
3295
|
-
6: "wash-85",
|
|
3296
|
-
7: "wash-80",
|
|
3297
|
-
8: "wax-74",
|
|
3298
|
-
// THE INK BAND (C49, owner 2026-08-05): the first text stop + emphasis fill (the
|
|
3299
|
-
// 2026-07-29 highlight collapse — the old highlight-9 and on-highlight are
|
|
3300
|
-
// deleted; this stop carries both jobs, its on-color a paper token), the between
|
|
3301
|
-
// text stop (a value the retired text-cta hover state used to generate bespokely,
|
|
3302
|
-
// promoted to a normal stop), and the strong text stop. The three read as states
|
|
3303
|
-
// ARE the text-style cta (owner 2026-08-12). C49 restored the top
|
|
3304
|
-
// two pre-collapse stop INDICES (11, and the off-scale anchor's 12 — emitted as a
|
|
3305
|
-
// literal in cssRender, not through this table) with the between stop taking the
|
|
3306
|
-
// vacated index 10; the indices (9/10/11) are unchanged since.
|
|
3307
|
-
9: "lead-53",
|
|
3308
|
-
10: "ink-42",
|
|
3309
|
-
11: "ink-30"
|
|
3310
|
-
};
|
|
3311
|
-
var SCALE_STOP_COUNT = Object.keys(SHARED_NAMES).length;
|
|
3312
|
-
function stopTokenName(stop) {
|
|
3313
|
-
const name = SHARED_NAMES[stop];
|
|
3314
|
-
if (!name) throw new Error(`stopTokenName: unexpected stop ${stop}`);
|
|
3315
|
-
return name;
|
|
3316
|
-
}
|
|
3317
|
-
var PAPER_100 = "paper-100";
|
|
3318
|
-
var INK_0 = "ink-0";
|
|
3319
|
-
var STAMP_FILL = "stamp-fill";
|
|
3320
|
-
var STAMP_FILL_HOVER = "stamp-fill-hover";
|
|
3321
|
-
var STAMP_FILL_PRESSED = "stamp-fill-pressed";
|
|
3322
|
-
var STAMP_EDGE = "stamp-edge";
|
|
3323
|
-
var STAMP_ON = "stamp-on";
|
|
3324
|
-
var STAMP_STATE_LEAVES = {
|
|
3325
|
-
[STAMP_FILL]: "stamp/fill",
|
|
3326
|
-
[STAMP_FILL_HOVER]: "stamp/fill-hover",
|
|
3327
|
-
[STAMP_FILL_PRESSED]: "stamp/fill-pressed",
|
|
3328
|
-
[STAMP_EDGE]: "stamp/edge",
|
|
3329
|
-
[STAMP_ON]: "stamp/on"
|
|
3330
|
-
};
|
|
3331
|
-
var STAMP_LEAF = {
|
|
3332
|
-
FILL: STAMP_STATE_LEAVES[STAMP_FILL],
|
|
3333
|
-
FILL_HOVER: STAMP_STATE_LEAVES[STAMP_FILL_HOVER],
|
|
3334
|
-
FILL_PRESSED: STAMP_STATE_LEAVES[STAMP_FILL_PRESSED],
|
|
3335
|
-
EDGE: STAMP_STATE_LEAVES[STAMP_EDGE],
|
|
3336
|
-
ON: STAMP_STATE_LEAVES[STAMP_ON]
|
|
3337
|
-
};
|
|
3338
|
-
var SYSTEM_LEAF = {
|
|
3339
|
-
ABS_BLACK: "system/abs-black",
|
|
3340
|
-
ABS_WHITE: "system/abs-white",
|
|
3341
|
-
SURFACE: {
|
|
3342
|
-
DIM: "system/surface/dim",
|
|
3343
|
-
LOW: "system/surface/low",
|
|
3344
|
-
MID: "system/surface/mid",
|
|
3345
|
-
HIGH: "system/surface/high"
|
|
3346
|
-
},
|
|
3347
|
-
ALPHA: {
|
|
3348
|
-
TRANSPARENT: "system/alpha/transparent",
|
|
3349
|
-
SCRIM: "system/alpha/abs-black-060",
|
|
3350
|
-
INK: "system/alpha/ink",
|
|
3351
|
-
// the DIRECTIONAL ladders (owner 2026-08-31, renaming the 2026-08-18 bare rungs
|
|
3352
|
-
// and the 2026-08-29 inverse ladder): away-from-bg is the page-polarity pole
|
|
3353
|
-
// (black in light, white in dark), toward-bg the flipped pole — STATE LAYERS for
|
|
3354
|
-
// INVERTED grounds, whose polarity is opposite the page's. (Never call toward-bg
|
|
3355
|
-
// a "wash": that word belongs to the tinted band stops.) The reversal lives in
|
|
3356
|
-
// the engine: a consumer on an inverted ground names one token and never picks a
|
|
3357
|
-
// pole. Colored fills never ride these; their states stay engine-solved stops.
|
|
3358
|
-
// Rungs are two-digit percent, harmonizing with shadow-04/08/12.
|
|
3359
|
-
AWAY_FROM_BG_06: "system/alpha/away-from-bg/06",
|
|
3360
|
-
AWAY_FROM_BG_08: "system/alpha/away-from-bg/08",
|
|
3361
|
-
AWAY_FROM_BG_16: "system/alpha/away-from-bg/16",
|
|
3362
|
-
TOWARD_BG_06: "system/alpha/toward-bg/06",
|
|
3363
|
-
TOWARD_BG_08: "system/alpha/toward-bg/08",
|
|
3364
|
-
TOWARD_BG_16: "system/alpha/toward-bg/16",
|
|
3365
|
-
SHADOW_04: "system/alpha/shadow-04",
|
|
3366
|
-
SHADOW_08: "system/alpha/shadow-08",
|
|
3367
|
-
SHADOW_12: "system/alpha/shadow-12"
|
|
3368
|
-
}
|
|
3369
|
-
};
|
|
3370
|
-
var SURFACE_PLANE_LAW = {
|
|
3371
|
-
[SYSTEM_LEAF.SURFACE.DIM]: { light: SHARED_NAMES[3], dark: PAPER_100 },
|
|
3372
|
-
[SYSTEM_LEAF.SURFACE.LOW]: { light: SHARED_NAMES[2], dark: SHARED_NAMES[1] },
|
|
3373
|
-
[SYSTEM_LEAF.SURFACE.MID]: { light: SHARED_NAMES[1], dark: SHARED_NAMES[2] },
|
|
3374
|
-
[SYSTEM_LEAF.SURFACE.HIGH]: { light: PAPER_100, dark: SHARED_NAMES[3] }
|
|
3375
|
-
};
|
|
3376
|
-
var TOKEN_ORDER = [
|
|
3377
|
-
...Object.values(SHARED_NAMES),
|
|
3378
|
-
STAMP_FILL,
|
|
3379
|
-
STAMP_FILL_HOVER,
|
|
3380
|
-
STAMP_FILL_PRESSED,
|
|
3381
|
-
STAMP_ON,
|
|
3382
|
-
"identity"
|
|
3383
|
-
];
|
|
3384
|
-
function tokenOrder(name) {
|
|
3385
|
-
const i = TOKEN_ORDER.indexOf(name);
|
|
3386
|
-
return i === -1 ? TOKEN_ORDER.length : i;
|
|
3387
|
-
}
|
|
3388
|
-
|
|
3389
3392
|
// src/engine/cssRender.ts
|
|
3390
3393
|
var { brandPrimary: CSS_BRAND, brandSecondary: CSS_SECONDARY, neutral: CSS_NEUTRAL } = CSS_FAMILY;
|
|
3391
3394
|
function toHex2(r, g2, b) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export type Group = 'paper' | 'wash' | '
|
|
1
|
+
export type Group = 'paper' | 'wash' | 'wax' | 'lead' | 'ink';
|
|
2
|
+
export declare const inkLane: (g: string) => boolean;
|
|
2
3
|
export type Producer = {
|
|
3
4
|
hue: 'warm-drift' | 'warm-torsion' | 'constant';
|
|
4
5
|
L: 'perceptual' | 'perceptual-lift' | 'fixed';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "okchroma",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "Color token engine: one brand hex in, a full WCAG-enforced light+dark token system out (CSS variables, DTCG JSON, Figma variables)",
|
|
6
6
|
"repository": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"audit:alpha": "esbuild scripts/alpha-audit.ts --bundle --platform=node --outfile=dist/alpha-audit.js && node dist/alpha-audit.js",
|
|
34
34
|
"audit:alpha:bless": "esbuild scripts/alpha-audit.ts --bundle --platform=node --outfile=dist/alpha-audit.js && node dist/alpha-audit.js --bless",
|
|
35
35
|
"audit:bless": "esbuild scripts/dark-audit.ts --bundle --platform=node --outfile=dist/dark-audit.js && node dist/dark-audit.js --bless",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"band-audit": "esbuild scripts/band-audit.ts --bundle --platform=node --outfile=dist/band-audit.js && node dist/band-audit.js",
|
|
37
|
+
"band-audit:bless": "esbuild scripts/band-audit.ts --bundle --platform=node --outfile=dist/band-audit.js && node dist/band-audit.js --bless",
|
|
38
38
|
"audit:divergence": "esbuild scripts/divergence-audit.ts --bundle --platform=node --outfile=dist/divergence-audit.js && node dist/divergence-audit.js",
|
|
39
39
|
"audit:divergence:bless": "esbuild scripts/divergence-audit.ts --bundle --platform=node --outfile=dist/divergence-audit.js && node dist/divergence-audit.js --bless",
|
|
40
40
|
"smooth": "esbuild scripts/smoothness-audit.ts --bundle --platform=node --outfile=dist/smoothness-audit.js && node dist/smoothness-audit.js",
|