@wordpress/theme 0.1.0
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/LICENSE.md +788 -0
- package/README.md +67 -0
- package/bin/build-tokens.js +83 -0
- package/bin/generate-primitive-tokens/index.ts +115 -0
- package/bin/terrazzo-plugin-ds-tokens-docs/index.ts +103 -0
- package/bin/terrazzo-plugin-figma-ds-token-manager/index.ts +210 -0
- package/bin/terrazzo-plugin-figma-ds-token-manager/lib.ts +1 -0
- package/bin/terrazzo-plugin-known-wpds-css-variables/index.ts +72 -0
- package/build/color-ramps/index.js +132 -0
- package/build/color-ramps/index.js.map +7 -0
- package/build/color-ramps/lib/cache-utils.js +57 -0
- package/build/color-ramps/lib/cache-utils.js.map +7 -0
- package/build/color-ramps/lib/constants.js +105 -0
- package/build/color-ramps/lib/constants.js.map +7 -0
- package/build/color-ramps/lib/find-color-with-constraints.js +141 -0
- package/build/color-ramps/lib/find-color-with-constraints.js.map +7 -0
- package/build/color-ramps/lib/index.js +264 -0
- package/build/color-ramps/lib/index.js.map +7 -0
- package/build/color-ramps/lib/ramp-configs.js +315 -0
- package/build/color-ramps/lib/ramp-configs.js.map +7 -0
- package/build/color-ramps/lib/taper-chroma.js +159 -0
- package/build/color-ramps/lib/taper-chroma.js.map +7 -0
- package/build/color-ramps/lib/types.js +17 -0
- package/build/color-ramps/lib/types.js.map +7 -0
- package/build/color-ramps/lib/utils.js +106 -0
- package/build/color-ramps/lib/utils.js.map +7 -0
- package/build/context.js +34 -0
- package/build/context.js.map +7 -0
- package/build/index.js +29 -0
- package/build/index.js.map +7 -0
- package/build/lock-unlock.js +35 -0
- package/build/lock-unlock.js.map +7 -0
- package/build/prebuilt/js/design-tokens.js +135 -0
- package/build/prebuilt/js/design-tokens.js.map +7 -0
- package/build/prebuilt/json/figma.json +1317 -0
- package/build/prebuilt/ts/design-tokens.js +354 -0
- package/build/prebuilt/ts/design-tokens.js.map +7 -0
- package/build/private-apis.js +36 -0
- package/build/private-apis.js.map +7 -0
- package/build/style.module.css.js +2 -0
- package/build/theme-provider.js +92 -0
- package/build/theme-provider.js.map +7 -0
- package/build/types/css-modules.d.js +2 -0
- package/build/types/css-modules.d.js.map +7 -0
- package/build/types.js +17 -0
- package/build/types.js.map +7 -0
- package/build/use-theme-provider-styles.js +230 -0
- package/build/use-theme-provider-styles.js.map +7 -0
- package/build-module/color-ramps/index.js +95 -0
- package/build-module/color-ramps/index.js.map +7 -0
- package/build-module/color-ramps/lib/cache-utils.js +31 -0
- package/build-module/color-ramps/lib/cache-utils.js.map +7 -0
- package/build-module/color-ramps/lib/constants.js +63 -0
- package/build-module/color-ramps/lib/constants.js.map +7 -0
- package/build-module/color-ramps/lib/find-color-with-constraints.js +112 -0
- package/build-module/color-ramps/lib/find-color-with-constraints.js.map +7 -0
- package/build-module/color-ramps/lib/index.js +235 -0
- package/build-module/color-ramps/lib/index.js.map +7 -0
- package/build-module/color-ramps/lib/ramp-configs.js +290 -0
- package/build-module/color-ramps/lib/ramp-configs.js.map +7 -0
- package/build-module/color-ramps/lib/taper-chroma.js +125 -0
- package/build-module/color-ramps/lib/taper-chroma.js.map +7 -0
- package/build-module/color-ramps/lib/types.js +1 -0
- package/build-module/color-ramps/lib/types.js.map +7 -0
- package/build-module/color-ramps/lib/utils.js +84 -0
- package/build-module/color-ramps/lib/utils.js.map +7 -0
- package/build-module/context.js +10 -0
- package/build-module/context.js.map +7 -0
- package/build-module/index.js +5 -0
- package/build-module/index.js.map +7 -0
- package/build-module/lock-unlock.js +10 -0
- package/build-module/lock-unlock.js.map +7 -0
- package/build-module/prebuilt/js/design-tokens.js +115 -0
- package/build-module/prebuilt/js/design-tokens.js.map +7 -0
- package/build-module/prebuilt/json/figma.json +1317 -0
- package/build-module/prebuilt/ts/design-tokens.js +334 -0
- package/build-module/prebuilt/ts/design-tokens.js.map +7 -0
- package/build-module/private-apis.js +12 -0
- package/build-module/private-apis.js.map +7 -0
- package/build-module/style.module.css.js +1 -0
- package/build-module/theme-provider.js +58 -0
- package/build-module/theme-provider.js.map +7 -0
- package/build-module/types/css-modules.d.js +1 -0
- package/build-module/types/css-modules.d.js.map +7 -0
- package/build-module/types.js +1 -0
- package/build-module/types.js.map +7 -0
- package/build-module/use-theme-provider-styles.js +200 -0
- package/build-module/use-theme-provider-styles.js.map +7 -0
- package/build-style/style.css +3 -0
- package/build-types/color-ramps/index.d.ts +44 -0
- package/build-types/color-ramps/index.d.ts.map +1 -0
- package/build-types/color-ramps/lib/cache-utils.d.ts +22 -0
- package/build-types/color-ramps/lib/cache-utils.d.ts.map +1 -0
- package/build-types/color-ramps/lib/constants.d.ts +38 -0
- package/build-types/color-ramps/lib/constants.d.ts.map +1 -0
- package/build-types/color-ramps/lib/find-color-with-constraints.d.ts +37 -0
- package/build-types/color-ramps/lib/find-color-with-constraints.d.ts.map +1 -0
- package/build-types/color-ramps/lib/index.d.ts +11 -0
- package/build-types/color-ramps/lib/index.d.ts.map +1 -0
- package/build-types/color-ramps/lib/ramp-configs.d.ts +7 -0
- package/build-types/color-ramps/lib/ramp-configs.d.ts.map +1 -0
- package/build-types/color-ramps/lib/taper-chroma.d.ts +32 -0
- package/build-types/color-ramps/lib/taper-chroma.d.ts.map +1 -0
- package/build-types/color-ramps/lib/types.d.ts +78 -0
- package/build-types/color-ramps/lib/types.d.ts.map +1 -0
- package/build-types/color-ramps/lib/utils.d.ts +38 -0
- package/build-types/color-ramps/lib/utils.d.ts.map +1 -0
- package/build-types/color-ramps/stories/index.story.d.ts +14 -0
- package/build-types/color-ramps/stories/index.story.d.ts.map +1 -0
- package/build-types/color-ramps/stories/ramp-table.d.ts +19 -0
- package/build-types/color-ramps/stories/ramp-table.d.ts.map +1 -0
- package/build-types/context.d.ts +10 -0
- package/build-types/context.d.ts.map +1 -0
- package/build-types/index.d.ts +2 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/lock-unlock.d.ts +2 -0
- package/build-types/lock-unlock.d.ts.map +1 -0
- package/build-types/prebuilt/js/design-tokens.d.ts +3 -0
- package/build-types/prebuilt/js/design-tokens.d.ts.map +1 -0
- package/build-types/prebuilt/ts/design-tokens.d.ts +7 -0
- package/build-types/prebuilt/ts/design-tokens.d.ts.map +1 -0
- package/build-types/private-apis.d.ts +2 -0
- package/build-types/private-apis.d.ts.map +1 -0
- package/build-types/stories/index.story.d.ts +15 -0
- package/build-types/stories/index.story.d.ts.map +1 -0
- package/build-types/theme-provider.d.ts +3 -0
- package/build-types/theme-provider.d.ts.map +1 -0
- package/build-types/types.d.ts +42 -0
- package/build-types/types.d.ts.map +1 -0
- package/build-types/use-theme-provider-styles.d.ts +17 -0
- package/build-types/use-theme-provider-styles.d.ts.map +1 -0
- package/docs/ds-tokens.md +283 -0
- package/package.json +58 -0
- package/src/color-ramps/index.ts +155 -0
- package/src/color-ramps/lib/cache-utils.ts +56 -0
- package/src/color-ramps/lib/constants.ts +85 -0
- package/src/color-ramps/lib/find-color-with-constraints.ts +190 -0
- package/src/color-ramps/lib/index.ts +369 -0
- package/src/color-ramps/lib/ramp-configs.ts +309 -0
- package/src/color-ramps/lib/taper-chroma.ts +226 -0
- package/src/color-ramps/lib/types.ts +90 -0
- package/src/color-ramps/lib/utils.ts +161 -0
- package/src/color-ramps/stories/index.story.tsx +264 -0
- package/src/color-ramps/stories/ramp-table.tsx +212 -0
- package/src/color-ramps/test/__snapshots__/index.test.ts.snap +1280 -0
- package/src/color-ramps/test/index.test.ts +94 -0
- package/src/context.ts +19 -0
- package/src/index.ts +2 -0
- package/src/lock-unlock.ts +10 -0
- package/src/prebuilt/css/design-tokens.css +401 -0
- package/src/prebuilt/js/design-tokens.js +116 -0
- package/src/prebuilt/json/figma.json +1317 -0
- package/src/prebuilt/ts/design-tokens.ts +335 -0
- package/src/private-apis.ts +12 -0
- package/src/stories/index.story.tsx +426 -0
- package/src/style.module.css +3 -0
- package/src/theme-provider.tsx +87 -0
- package/src/types/css-modules.d.ts +4 -0
- package/src/types.ts +44 -0
- package/src/use-theme-provider-styles.ts +247 -0
- package/terrazzo.config.ts +102 -0
- package/tokens/border.json +34 -0
- package/tokens/color.json +877 -0
- package/tokens/elevation.json +201 -0
- package/tokens/spacing.json +45 -0
- package/tokens/typography.json +93 -0
- package/tsconfig.json +9 -0
- package/tsconfig.tsbuildinfo +1 -0
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import Color from "colorjs.io";
|
|
2
|
+
import { getCachedContrast, getColorString } from "./cache-utils";
|
|
3
|
+
import { findColorMeetingRequirements } from "./find-color-with-constraints";
|
|
4
|
+
import {
|
|
5
|
+
clampToGamut,
|
|
6
|
+
sortByDependency,
|
|
7
|
+
computeBetterFgColorDirection,
|
|
8
|
+
adjustContrastTarget
|
|
9
|
+
} from "./utils";
|
|
10
|
+
import { LIGHTNESS_EPSILON, MAX_BISECTION_ITERATIONS } from "./constants";
|
|
11
|
+
function calculateRamp({
|
|
12
|
+
seed,
|
|
13
|
+
sortedSteps,
|
|
14
|
+
config,
|
|
15
|
+
mainDir,
|
|
16
|
+
oppDir,
|
|
17
|
+
pinLightness,
|
|
18
|
+
debug = false
|
|
19
|
+
}) {
|
|
20
|
+
const rampResults = {};
|
|
21
|
+
let SATISFIED_ALL_CONTRAST_REQUIREMENTS = true;
|
|
22
|
+
let UNSATISFIED_DIRECTION = "lighter";
|
|
23
|
+
let MAX_WEIGHTED_DEFICIT = 0;
|
|
24
|
+
const calculatedColors = /* @__PURE__ */ new Map();
|
|
25
|
+
calculatedColors.set("seed", seed);
|
|
26
|
+
for (const stepName of sortedSteps) {
|
|
27
|
+
let computeDirection2 = function(color, followDirection) {
|
|
28
|
+
if (followDirection === "main") {
|
|
29
|
+
return mainDir;
|
|
30
|
+
}
|
|
31
|
+
if (followDirection === "opposite") {
|
|
32
|
+
return oppDir;
|
|
33
|
+
}
|
|
34
|
+
if (followDirection === "best") {
|
|
35
|
+
return computeBetterFgColorDirection(
|
|
36
|
+
color,
|
|
37
|
+
contrast.preferLighter
|
|
38
|
+
).better;
|
|
39
|
+
}
|
|
40
|
+
return followDirection;
|
|
41
|
+
};
|
|
42
|
+
var computeDirection = computeDirection2;
|
|
43
|
+
const {
|
|
44
|
+
contrast,
|
|
45
|
+
lightness: stepLightnessConstraint,
|
|
46
|
+
taperChromaOptions,
|
|
47
|
+
sameAsIfPossible
|
|
48
|
+
} = config[stepName];
|
|
49
|
+
const referenceColor = calculatedColors.get(contrast.reference);
|
|
50
|
+
if (!referenceColor) {
|
|
51
|
+
throw new Error(
|
|
52
|
+
`Reference color for step ${stepName} not found: ${contrast.reference}`
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
if (sameAsIfPossible) {
|
|
56
|
+
const candidateColor = calculatedColors.get(sameAsIfPossible);
|
|
57
|
+
if (candidateColor) {
|
|
58
|
+
const candidateContrast = getCachedContrast(
|
|
59
|
+
referenceColor,
|
|
60
|
+
candidateColor
|
|
61
|
+
);
|
|
62
|
+
const adjustedTarget2 = adjustContrastTarget(contrast.target);
|
|
63
|
+
if (candidateContrast >= adjustedTarget2) {
|
|
64
|
+
calculatedColors.set(stepName, candidateColor);
|
|
65
|
+
rampResults[stepName] = {
|
|
66
|
+
color: getColorString(candidateColor),
|
|
67
|
+
warning: false
|
|
68
|
+
};
|
|
69
|
+
continue;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
const computedDir = computeDirection2(
|
|
74
|
+
referenceColor,
|
|
75
|
+
contrast.followDirection
|
|
76
|
+
);
|
|
77
|
+
const adjustedTarget = adjustContrastTarget(contrast.target);
|
|
78
|
+
let lightnessConstraint;
|
|
79
|
+
if (pinLightness?.stepName === stepName) {
|
|
80
|
+
lightnessConstraint = {
|
|
81
|
+
value: pinLightness.value,
|
|
82
|
+
type: "force"
|
|
83
|
+
};
|
|
84
|
+
} else if (stepLightnessConstraint) {
|
|
85
|
+
lightnessConstraint = {
|
|
86
|
+
value: stepLightnessConstraint(computedDir),
|
|
87
|
+
type: "onlyIfSucceeds"
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
const searchResults = findColorMeetingRequirements(
|
|
91
|
+
referenceColor,
|
|
92
|
+
seed,
|
|
93
|
+
adjustedTarget,
|
|
94
|
+
computedDir,
|
|
95
|
+
{
|
|
96
|
+
strict: false,
|
|
97
|
+
lightnessConstraint,
|
|
98
|
+
taperChromaOptions,
|
|
99
|
+
debug
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
if (!searchResults.reached && !contrast.ignoreWhenAdjustingSeed) {
|
|
103
|
+
SATISFIED_ALL_CONTRAST_REQUIREMENTS = false;
|
|
104
|
+
const deficitVsTarget = adjustedTarget - searchResults.achieved;
|
|
105
|
+
const impactWeight = 1 / getCachedContrast(seed, referenceColor);
|
|
106
|
+
const weightedDeficit = deficitVsTarget * impactWeight;
|
|
107
|
+
if (weightedDeficit > MAX_WEIGHTED_DEFICIT) {
|
|
108
|
+
MAX_WEIGHTED_DEFICIT = weightedDeficit;
|
|
109
|
+
UNSATISFIED_DIRECTION = computedDir;
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
calculatedColors.set(stepName, searchResults.color);
|
|
113
|
+
rampResults[stepName] = {
|
|
114
|
+
color: getColorString(searchResults.color),
|
|
115
|
+
warning: !contrast.ignoreWhenAdjustingSeed && !searchResults.reached
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
return {
|
|
119
|
+
rampResults,
|
|
120
|
+
SATISFIED_ALL_CONTRAST_REQUIREMENTS,
|
|
121
|
+
UNSATISFIED_DIRECTION
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function buildRamp(seedArg, config, {
|
|
125
|
+
mainDirection,
|
|
126
|
+
pinLightness,
|
|
127
|
+
debug = false,
|
|
128
|
+
rescaleToFitContrastTargets = true
|
|
129
|
+
} = {}) {
|
|
130
|
+
let seed;
|
|
131
|
+
try {
|
|
132
|
+
seed = clampToGamut(new Color(seedArg));
|
|
133
|
+
} catch (error) {
|
|
134
|
+
throw new Error(
|
|
135
|
+
`Invalid seed color "${seedArg}": ${error instanceof Error ? error.message : "Unknown error"}`
|
|
136
|
+
);
|
|
137
|
+
}
|
|
138
|
+
let mainDir = "lighter";
|
|
139
|
+
let oppDir = "darker";
|
|
140
|
+
if (mainDirection) {
|
|
141
|
+
mainDir = mainDirection;
|
|
142
|
+
oppDir = mainDirection === "darker" ? "lighter" : "darker";
|
|
143
|
+
} else {
|
|
144
|
+
const { better, worse } = computeBetterFgColorDirection(seed);
|
|
145
|
+
mainDir = better;
|
|
146
|
+
oppDir = worse;
|
|
147
|
+
}
|
|
148
|
+
const sortedSteps = sortByDependency(config);
|
|
149
|
+
const {
|
|
150
|
+
rampResults,
|
|
151
|
+
SATISFIED_ALL_CONTRAST_REQUIREMENTS,
|
|
152
|
+
UNSATISFIED_DIRECTION
|
|
153
|
+
} = calculateRamp({
|
|
154
|
+
seed,
|
|
155
|
+
sortedSteps,
|
|
156
|
+
config,
|
|
157
|
+
mainDir,
|
|
158
|
+
oppDir,
|
|
159
|
+
pinLightness,
|
|
160
|
+
debug
|
|
161
|
+
});
|
|
162
|
+
const toReturn = {
|
|
163
|
+
ramp: rampResults,
|
|
164
|
+
direction: mainDir
|
|
165
|
+
};
|
|
166
|
+
if (debug) {
|
|
167
|
+
console.log(`First run`, {
|
|
168
|
+
SATISFIED_ALL_CONTRAST_REQUIREMENTS,
|
|
169
|
+
UNSATISFIED_DIRECTION,
|
|
170
|
+
seed: seed.toString(),
|
|
171
|
+
sortedSteps,
|
|
172
|
+
config,
|
|
173
|
+
mainDir,
|
|
174
|
+
oppDir,
|
|
175
|
+
pinLightness
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (!SATISFIED_ALL_CONTRAST_REQUIREMENTS && rescaleToFitContrastTargets) {
|
|
179
|
+
let worseSeedL = seed.oklch.l;
|
|
180
|
+
let betterSeedL = UNSATISFIED_DIRECTION === "lighter" ? 0 : 1;
|
|
181
|
+
for (let i = 0; i < MAX_BISECTION_ITERATIONS && Math.abs(betterSeedL - worseSeedL) > LIGHTNESS_EPSILON; i++) {
|
|
182
|
+
const newSeed = clampToGamut(
|
|
183
|
+
seed.clone().set({
|
|
184
|
+
l: (worseSeedL + betterSeedL) / 2
|
|
185
|
+
})
|
|
186
|
+
);
|
|
187
|
+
if (debug) {
|
|
188
|
+
console.log(`Iteration ${i}`, {
|
|
189
|
+
worseSeedL,
|
|
190
|
+
newSeedL: (worseSeedL + betterSeedL) / 2,
|
|
191
|
+
betterSeedL
|
|
192
|
+
});
|
|
193
|
+
}
|
|
194
|
+
const iterationResults = calculateRamp({
|
|
195
|
+
seed: newSeed,
|
|
196
|
+
sortedSteps,
|
|
197
|
+
config,
|
|
198
|
+
mainDir,
|
|
199
|
+
oppDir,
|
|
200
|
+
pinLightness,
|
|
201
|
+
debug
|
|
202
|
+
});
|
|
203
|
+
if (iterationResults.SATISFIED_ALL_CONTRAST_REQUIREMENTS) {
|
|
204
|
+
betterSeedL = newSeed.oklch.l;
|
|
205
|
+
toReturn.ramp = iterationResults.rampResults;
|
|
206
|
+
} else if (UNSATISFIED_DIRECTION !== mainDir) {
|
|
207
|
+
betterSeedL = newSeed.oklch.l;
|
|
208
|
+
} else {
|
|
209
|
+
worseSeedL = newSeed.oklch.l;
|
|
210
|
+
}
|
|
211
|
+
if (debug) {
|
|
212
|
+
console.log(`Retry #${i}`, {
|
|
213
|
+
SATISFIED_ALL_CONTRAST_REQUIREMENTS,
|
|
214
|
+
UNSATISFIED_DIRECTION,
|
|
215
|
+
seed: newSeed.toString(),
|
|
216
|
+
sortedSteps,
|
|
217
|
+
config,
|
|
218
|
+
mainDir,
|
|
219
|
+
oppDir,
|
|
220
|
+
pinLightness
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
if (mainDir === "darker") {
|
|
226
|
+
const tmpSurface1 = toReturn.ramp.surface1;
|
|
227
|
+
toReturn.ramp.surface1 = toReturn.ramp.surface3;
|
|
228
|
+
toReturn.ramp.surface3 = tmpSurface1;
|
|
229
|
+
}
|
|
230
|
+
return toReturn;
|
|
231
|
+
}
|
|
232
|
+
export {
|
|
233
|
+
buildRamp
|
|
234
|
+
};
|
|
235
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/color-ramps/lib/index.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport Color from 'colorjs.io';\n\n/**\n * Internal dependencies\n */\nimport { getCachedContrast, getColorString } from './cache-utils';\nimport { findColorMeetingRequirements } from './find-color-with-constraints';\nimport {\n\tclampToGamut,\n\tsortByDependency,\n\tcomputeBetterFgColorDirection,\n\tadjustContrastTarget,\n} from './utils';\n\nimport type {\n\tFollowDirection,\n\tRamp,\n\tRampDirection,\n\tRampConfig,\n\tRampResult,\n} from './types';\nimport { LIGHTNESS_EPSILON, MAX_BISECTION_ITERATIONS } from './constants';\n\n/**\n * Calculate a complete color ramp based on the provided configuration.\n *\n * @param params - The calculation parameters\n * @param params.seed - The base color to build the ramp from\n * @param params.sortedSteps - Steps sorted in dependency order\n * @param params.config - Ramp configuration defining contrast requirements\n * @param params.mainDir - Primary direction for the ramp (lighter/darker)\n * @param params.oppDir - Opposite direction from mainDir\n * @param params.pinLightness - Optional lightness override for a given step\n * @param params.pinLightness.stepName\n * @param params.pinLightness.value\n * @param params.debug\n * @return Object containing ramp results and satisfaction status\n */\nfunction calculateRamp( {\n\tseed,\n\tsortedSteps,\n\tconfig,\n\tmainDir,\n\toppDir,\n\tpinLightness,\n\tdebug = false,\n}: {\n\tseed: Color;\n\tsortedSteps: ( keyof Ramp )[];\n\tconfig: RampConfig;\n\tmainDir: RampDirection;\n\toppDir: RampDirection;\n\tpinLightness?: {\n\t\tstepName: keyof Ramp;\n\t\tvalue: number;\n\t};\n\tdebug?: boolean;\n} ) {\n\tconst rampResults = {} as Record<\n\t\tkeyof Ramp,\n\t\t{ color: string; warning: boolean }\n\t>;\n\tlet SATISFIED_ALL_CONTRAST_REQUIREMENTS = true;\n\tlet UNSATISFIED_DIRECTION: RampDirection = 'lighter';\n\tlet MAX_WEIGHTED_DEFICIT = 0;\n\n\t// Keep track of the calculated colors, as they are going to be useful\n\t// when other colors reference them.\n\tconst calculatedColors = new Map< keyof Ramp | 'seed', Color >();\n\tcalculatedColors.set( 'seed', seed );\n\n\tfor ( const stepName of sortedSteps ) {\n\t\tconst {\n\t\t\tcontrast,\n\t\t\tlightness: stepLightnessConstraint,\n\t\t\ttaperChromaOptions,\n\t\t\tsameAsIfPossible,\n\t\t} = config[ stepName ];\n\t\tconst referenceColor = calculatedColors.get( contrast.reference );\n\n\t\tif ( ! referenceColor ) {\n\t\t\tthrow new Error(\n\t\t\t\t`Reference color for step ${ stepName } not found: ${ contrast.reference }`\n\t\t\t);\n\t\t}\n\n\t\t// Check if we can reuse color from the `sameAsIfPossible` config option\n\t\tif ( sameAsIfPossible ) {\n\t\t\tconst candidateColor = calculatedColors.get( sameAsIfPossible );\n\t\t\tif ( candidateColor ) {\n\t\t\t\tconst candidateContrast = getCachedContrast(\n\t\t\t\t\treferenceColor,\n\t\t\t\t\tcandidateColor\n\t\t\t\t);\n\t\t\t\tconst adjustedTarget = adjustContrastTarget( contrast.target );\n\t\t\t\t// If the candidate meets the contrast requirement, use it\n\t\t\t\tif ( candidateContrast >= adjustedTarget ) {\n\t\t\t\t\t// Store the reused color\n\t\t\t\t\tcalculatedColors.set( stepName, candidateColor );\n\t\t\t\t\trampResults[ stepName ] = {\n\t\t\t\t\t\tcolor: getColorString( candidateColor ),\n\t\t\t\t\t\twarning: false,\n\t\t\t\t\t};\n\n\t\t\t\t\tcontinue; // Skip to next step\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfunction computeDirection(\n\t\t\tcolor: Color,\n\t\t\tfollowDirection: FollowDirection\n\t\t): RampDirection {\n\t\t\tif ( followDirection === 'main' ) {\n\t\t\t\treturn mainDir;\n\t\t\t}\n\n\t\t\tif ( followDirection === 'opposite' ) {\n\t\t\t\treturn oppDir;\n\t\t\t}\n\n\t\t\tif ( followDirection === 'best' ) {\n\t\t\t\treturn computeBetterFgColorDirection(\n\t\t\t\t\tcolor,\n\t\t\t\t\tcontrast.preferLighter\n\t\t\t\t).better;\n\t\t\t}\n\n\t\t\treturn followDirection;\n\t\t}\n\n\t\tconst computedDir = computeDirection(\n\t\t\treferenceColor,\n\t\t\tcontrast.followDirection\n\t\t);\n\n\t\tconst adjustedTarget = adjustContrastTarget( contrast.target );\n\n\t\t// Define the lightness constraint, if needed.\n\t\tlet lightnessConstraint;\n\t\tif ( pinLightness?.stepName === stepName ) {\n\t\t\tlightnessConstraint = {\n\t\t\t\tvalue: pinLightness.value,\n\t\t\t\ttype: 'force',\n\t\t\t} as const;\n\t\t} else if ( stepLightnessConstraint ) {\n\t\t\tlightnessConstraint = {\n\t\t\t\tvalue: stepLightnessConstraint( computedDir ),\n\t\t\t\ttype: 'onlyIfSucceeds',\n\t\t\t} as const;\n\t\t}\n\n\t\t// Calculate the color meeting the requirements\n\t\tconst searchResults = findColorMeetingRequirements(\n\t\t\treferenceColor,\n\t\t\tseed,\n\t\t\tadjustedTarget,\n\t\t\tcomputedDir,\n\t\t\t{\n\t\t\t\tstrict: false,\n\t\t\t\tlightnessConstraint,\n\t\t\t\ttaperChromaOptions,\n\t\t\t\tdebug,\n\t\t\t}\n\t\t);\n\n\t\t// When the target contrast is not met, take note of it and use\n\t\t// that information to guide the ramp calculation bisection.\n\t\tif ( ! searchResults.reached && ! contrast.ignoreWhenAdjustingSeed ) {\n\t\t\tSATISFIED_ALL_CONTRAST_REQUIREMENTS = false;\n\n\t\t\t// Calculate constraint failure severity for seed optimization\n\t\t\t// Use the relative deficit size, weighted by how changing the seed would impact this constraint\n\t\t\tconst deficitVsTarget = adjustedTarget - searchResults.achieved;\n\n\t\t\t// Weight the deficit by how much seed adjustment would help this constraint\n\t\t\t// If seed has low contrast vs reference, adjusting seed has high impact\n\t\t\t// If seed has high contrast vs reference, adjusting seed has low impact\n\t\t\tconst impactWeight = 1 / getCachedContrast( seed, referenceColor );\n\t\t\tconst weightedDeficit = deficitVsTarget * impactWeight;\n\n\t\t\t// Track the most impactful failure for seed optimization\n\t\t\tif ( weightedDeficit > MAX_WEIGHTED_DEFICIT ) {\n\t\t\t\tMAX_WEIGHTED_DEFICIT = weightedDeficit;\n\t\t\t\tUNSATISFIED_DIRECTION = computedDir;\n\t\t\t}\n\t\t}\n\n\t\t// Store calculated color for future dependencies\n\t\tcalculatedColors.set( stepName, searchResults.color );\n\n\t\t// Add to results\n\t\trampResults[ stepName ] = {\n\t\t\tcolor: getColorString( searchResults.color ),\n\t\t\twarning:\n\t\t\t\t! contrast.ignoreWhenAdjustingSeed && ! searchResults.reached,\n\t\t};\n\t}\n\n\treturn {\n\t\trampResults,\n\t\tSATISFIED_ALL_CONTRAST_REQUIREMENTS,\n\t\tUNSATISFIED_DIRECTION,\n\t};\n}\n\nexport function buildRamp(\n\tseedArg: string,\n\tconfig: RampConfig,\n\t{\n\t\tmainDirection,\n\t\tpinLightness,\n\t\tdebug = false,\n\t\trescaleToFitContrastTargets = true,\n\t}: {\n\t\tmainDirection?: RampDirection;\n\t\tpinLightness?: {\n\t\t\tstepName: keyof Ramp;\n\t\t\tvalue: number;\n\t\t};\n\t\trescaleToFitContrastTargets?: boolean;\n\t\tdebug?: boolean;\n\t} = {}\n): RampResult {\n\tlet seed: Color;\n\ttry {\n\t\tseed = clampToGamut( new Color( seedArg ) );\n\t} catch ( error ) {\n\t\tthrow new Error(\n\t\t\t`Invalid seed color \"${ seedArg }\": ${\n\t\t\t\terror instanceof Error ? error.message : 'Unknown error'\n\t\t\t}`\n\t\t);\n\t}\n\n\tlet mainDir: RampDirection = 'lighter';\n\tlet oppDir: RampDirection = 'darker';\n\n\tif ( mainDirection ) {\n\t\tmainDir = mainDirection;\n\t\toppDir = mainDirection === 'darker' ? 'lighter' : 'darker';\n\t} else {\n\t\tconst { better, worse } = computeBetterFgColorDirection( seed );\n\t\tmainDir = better;\n\t\toppDir = worse;\n\t}\n\n\t// Get the correct calculation order based on dependencies\n\tconst sortedSteps = sortByDependency( config );\n\n\t// Calculate the ramp with the initial seed.\n\tconst {\n\t\trampResults,\n\t\tSATISFIED_ALL_CONTRAST_REQUIREMENTS,\n\t\tUNSATISFIED_DIRECTION,\n\t} = calculateRamp( {\n\t\tseed,\n\t\tsortedSteps,\n\t\tconfig,\n\t\tmainDir,\n\t\toppDir,\n\t\tpinLightness,\n\t\tdebug,\n\t} );\n\tconst toReturn = {\n\t\tramp: rampResults,\n\t\tdirection: mainDir,\n\t} as RampResult;\n\n\tif ( debug ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.log( `First run`, {\n\t\t\tSATISFIED_ALL_CONTRAST_REQUIREMENTS,\n\t\t\tUNSATISFIED_DIRECTION,\n\t\t\tseed: seed.toString(),\n\t\t\tsortedSteps,\n\t\t\tconfig,\n\t\t\tmainDir,\n\t\t\toppDir,\n\t\t\tpinLightness,\n\t\t} );\n\t}\n\n\tif (\n\t\t! SATISFIED_ALL_CONTRAST_REQUIREMENTS &&\n\t\trescaleToFitContrastTargets\n\t) {\n\t\tlet worseSeedL = seed.oklch.l;\n\t\t// For a scale with the \"lighter\" direction, the contrast can be improved\n\t\t// by darkening the seed. For \"darker\" direction, by lightening the seed.\n\t\tlet betterSeedL = UNSATISFIED_DIRECTION === 'lighter' ? 0 : 1;\n\n\t\t// Binary search: try a new seed and recompute the whole ramp\n\t\t// (TODO: try a smarter approach?)\n\t\tfor (\n\t\t\tlet i = 0;\n\t\t\ti < MAX_BISECTION_ITERATIONS &&\n\t\t\tMath.abs( betterSeedL - worseSeedL ) > LIGHTNESS_EPSILON;\n\t\t\ti++\n\t\t) {\n\t\t\tconst newSeed = clampToGamut(\n\t\t\t\tseed.clone().set( {\n\t\t\t\t\tl: ( worseSeedL + betterSeedL ) / 2,\n\t\t\t\t} )\n\t\t\t);\n\n\t\t\tif ( debug ) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log( `Iteration ${ i }`, {\n\t\t\t\t\tworseSeedL,\n\t\t\t\t\tnewSeedL: ( worseSeedL + betterSeedL ) / 2,\n\t\t\t\t\tbetterSeedL,\n\t\t\t\t} );\n\t\t\t}\n\n\t\t\tconst iterationResults = calculateRamp( {\n\t\t\t\tseed: newSeed,\n\t\t\t\tsortedSteps,\n\t\t\t\tconfig,\n\t\t\t\tmainDir,\n\t\t\t\toppDir,\n\t\t\t\tpinLightness,\n\t\t\t\tdebug,\n\t\t\t} );\n\n\t\t\tif ( iterationResults.SATISFIED_ALL_CONTRAST_REQUIREMENTS ) {\n\t\t\t\tbetterSeedL = newSeed.oklch.l;\n\t\t\t\t// Only update toReturn when the ramp satisfies all constraints.\n\t\t\t\ttoReturn.ramp = iterationResults.rampResults;\n\t\t\t} else if ( UNSATISFIED_DIRECTION !== mainDir ) {\n\t\t\t\t// Failing constraint is in opposite direction to main ramp direction\n\t\t\t\t// We've moved too far in mainDir, constrain the search\n\t\t\t\tbetterSeedL = newSeed.oklch.l;\n\t\t\t} else {\n\t\t\t\t// Failing constraint is in same direction as main ramp direction\n\t\t\t\t// We haven't moved far enough in mainDir, continue searching\n\t\t\t\tworseSeedL = newSeed.oklch.l;\n\t\t\t}\n\n\t\t\tif ( debug ) {\n\t\t\t\t// eslint-disable-next-line no-console\n\t\t\t\tconsole.log( `Retry #${ i }`, {\n\t\t\t\t\tSATISFIED_ALL_CONTRAST_REQUIREMENTS,\n\t\t\t\t\tUNSATISFIED_DIRECTION,\n\t\t\t\t\tseed: newSeed.toString(),\n\t\t\t\t\tsortedSteps,\n\t\t\t\t\tconfig,\n\t\t\t\t\tmainDir,\n\t\t\t\t\toppDir,\n\t\t\t\t\tpinLightness,\n\t\t\t\t} );\n\t\t\t}\n\t\t}\n\t}\n\n\t// Swap surface1 and surface3 for darker ramps to maintain visual elevation hierarchy.\n\t// This ensures surface1 appears \"behind\" surface2, and surface3 appears \"in front\",\n\t// regardless of the ramp's main direction.\n\tif ( mainDir === 'darker' ) {\n\t\tconst tmpSurface1 = toReturn.ramp.surface1;\n\t\ttoReturn.ramp.surface1 = toReturn.ramp.surface3;\n\t\ttoReturn.ramp.surface3 = tmpSurface1;\n\t}\n\n\treturn toReturn;\n}\n"],
|
|
5
|
+
"mappings": "AAGA,OAAO,WAAW;AAKlB,SAAS,mBAAmB,sBAAsB;AAClD,SAAS,oCAAoC;AAC7C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AASP,SAAS,mBAAmB,gCAAgC;AAiB5D,SAAS,cAAe;AAAA,EACvB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA,QAAQ;AACT,GAWI;AACH,QAAM,cAAc,CAAC;AAIrB,MAAI,sCAAsC;AAC1C,MAAI,wBAAuC;AAC3C,MAAI,uBAAuB;AAI3B,QAAM,mBAAmB,oBAAI,IAAkC;AAC/D,mBAAiB,IAAK,QAAQ,IAAK;AAEnC,aAAY,YAAY,aAAc;AAsCrC,QAASA,oBAAT,SACC,OACA,iBACgB;AAChB,UAAK,oBAAoB,QAAS;AACjC,eAAO;AAAA,MACR;AAEA,UAAK,oBAAoB,YAAa;AACrC,eAAO;AAAA,MACR;AAEA,UAAK,oBAAoB,QAAS;AACjC,eAAO;AAAA,UACN;AAAA,UACA,SAAS;AAAA,QACV,EAAE;AAAA,MACH;AAEA,aAAO;AAAA,IACR;AApBS,2BAAAA;AArCT,UAAM;AAAA,MACL;AAAA,MACA,WAAW;AAAA,MACX;AAAA,MACA;AAAA,IACD,IAAI,OAAQ,QAAS;AACrB,UAAM,iBAAiB,iBAAiB,IAAK,SAAS,SAAU;AAEhE,QAAK,CAAE,gBAAiB;AACvB,YAAM,IAAI;AAAA,QACT,4BAA6B,QAAS,eAAgB,SAAS,SAAU;AAAA,MAC1E;AAAA,IACD;AAGA,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AACD,YAAM,UAAU;AAAA,QACf,KAAK,MAAM,EAAE,IAAK;AAAA,UACjB,IAAK,aAAa,eAAgB;AAAA,QACnC,CAAE;AAAA,MACH;AAEA,UAAK,OAAQ;AAEZ,gBAAQ,IAAK,aAAc,CAAE,IAAI;AAAA,UAChC;AAAA,UACA,WAAY,aAAa,eAAgB;AAAA,UACzC;AAAA,QACD,CAAE;AAAA,MACH;AAEA,YAAM,mBAAmB,cAAe;AAAA,QACvC,MAAM;AAAA,QACN;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACD,CAAE;AAEF,UAAK,iBAAiB,qCAAsC;AAC3D,sBAAc,QAAQ,MAAM;AAE5B,iBAAS,OAAO,iBAAiB;AAAA,MAClC,WAAY,0BAA0B,SAAU;AAG/C,sBAAc,QAAQ,MAAM;AAAA,MAC7B,OAAO;AAGN,qBAAa,QAAQ,MAAM;AAAA,MAC5B;AAEA,UAAK,OAAQ;AAEZ,gBAAQ,IAAK,UAAW,CAAE,IAAI;AAAA,UAC7B;AAAA,UACA;AAAA,UACA,MAAM,QAAQ,SAAS;AAAA,UACvB;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,UACA;AAAA,QACD,CAAE;AAAA,MACH;AAAA,IACD;AAAA,EACD;AAKA,MAAK,YAAY,UAAW;AAC3B,UAAM,cAAc,SAAS,KAAK;AAClC,aAAS,KAAK,WAAW,SAAS,KAAK;AACvC,aAAS,KAAK,WAAW;AAAA,EAC1B;AAEA,SAAO;AACR;",
|
|
6
|
+
"names": ["computeDirection", "adjustedTarget"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
const lightnessConstraintForegroundHighContrast = (direction) => direction === "lighter" ? 0.9551 : 0.235;
|
|
2
|
+
const lightnessConstraintForegroundMediumContrast = (direction) => direction === "lighter" ? 0.77 : 0.56;
|
|
3
|
+
const lightnessConstraintBgFill = (direction) => direction === "lighter" ? 0.67 : 0.45;
|
|
4
|
+
const BG_SURFACE_TAPER_CHROMA = {
|
|
5
|
+
alpha: 0.7
|
|
6
|
+
};
|
|
7
|
+
const FG_TAPER_CHROMA = {
|
|
8
|
+
alpha: 0.6,
|
|
9
|
+
kLight: 0.2,
|
|
10
|
+
kDark: 0.2
|
|
11
|
+
};
|
|
12
|
+
const STROKE_TAPER_CHROMA = {
|
|
13
|
+
alpha: 0.6,
|
|
14
|
+
radiusDark: 0.01,
|
|
15
|
+
radiusLight: 0.01,
|
|
16
|
+
kLight: 0.8,
|
|
17
|
+
kDark: 0.8
|
|
18
|
+
};
|
|
19
|
+
const ACCENT_SURFACE_TAPER_CHROMA = {
|
|
20
|
+
alpha: 0.75,
|
|
21
|
+
radiusDark: 0.01,
|
|
22
|
+
radiusLight: 0.01
|
|
23
|
+
};
|
|
24
|
+
const fgSurface4Config = {
|
|
25
|
+
contrast: {
|
|
26
|
+
reference: "surface3",
|
|
27
|
+
followDirection: "main",
|
|
28
|
+
target: 7,
|
|
29
|
+
preferLighter: true
|
|
30
|
+
},
|
|
31
|
+
lightness: lightnessConstraintForegroundHighContrast,
|
|
32
|
+
taperChromaOptions: FG_TAPER_CHROMA
|
|
33
|
+
};
|
|
34
|
+
const BG_RAMP_CONFIG = {
|
|
35
|
+
// Surface
|
|
36
|
+
surface1: {
|
|
37
|
+
contrast: {
|
|
38
|
+
reference: "surface2",
|
|
39
|
+
followDirection: "opposite",
|
|
40
|
+
target: 1.02,
|
|
41
|
+
ignoreWhenAdjustingSeed: true
|
|
42
|
+
},
|
|
43
|
+
taperChromaOptions: BG_SURFACE_TAPER_CHROMA
|
|
44
|
+
},
|
|
45
|
+
surface2: {
|
|
46
|
+
contrast: {
|
|
47
|
+
reference: "seed",
|
|
48
|
+
followDirection: "main",
|
|
49
|
+
target: 1
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
surface3: {
|
|
53
|
+
contrast: {
|
|
54
|
+
reference: "surface2",
|
|
55
|
+
followDirection: "main",
|
|
56
|
+
target: 1.02
|
|
57
|
+
},
|
|
58
|
+
taperChromaOptions: BG_SURFACE_TAPER_CHROMA
|
|
59
|
+
},
|
|
60
|
+
surface4: {
|
|
61
|
+
contrast: {
|
|
62
|
+
reference: "surface2",
|
|
63
|
+
followDirection: "main",
|
|
64
|
+
target: 1.08
|
|
65
|
+
},
|
|
66
|
+
taperChromaOptions: BG_SURFACE_TAPER_CHROMA
|
|
67
|
+
},
|
|
68
|
+
surface5: {
|
|
69
|
+
contrast: {
|
|
70
|
+
reference: "surface2",
|
|
71
|
+
followDirection: "main",
|
|
72
|
+
target: 1.2
|
|
73
|
+
},
|
|
74
|
+
taperChromaOptions: BG_SURFACE_TAPER_CHROMA
|
|
75
|
+
},
|
|
76
|
+
surface6: {
|
|
77
|
+
contrast: {
|
|
78
|
+
reference: "surface2",
|
|
79
|
+
followDirection: "main",
|
|
80
|
+
target: 1.4
|
|
81
|
+
},
|
|
82
|
+
taperChromaOptions: BG_SURFACE_TAPER_CHROMA
|
|
83
|
+
},
|
|
84
|
+
// Bg fill
|
|
85
|
+
bgFill1: {
|
|
86
|
+
contrast: {
|
|
87
|
+
reference: "surface2",
|
|
88
|
+
followDirection: "main",
|
|
89
|
+
target: 4
|
|
90
|
+
},
|
|
91
|
+
lightness: lightnessConstraintBgFill
|
|
92
|
+
},
|
|
93
|
+
bgFill2: {
|
|
94
|
+
contrast: {
|
|
95
|
+
reference: "bgFill1",
|
|
96
|
+
followDirection: "main",
|
|
97
|
+
target: 1.2
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
bgFillInverted1: {
|
|
101
|
+
contrast: {
|
|
102
|
+
reference: "bgFillInverted2",
|
|
103
|
+
followDirection: "opposite",
|
|
104
|
+
target: 1.2
|
|
105
|
+
}
|
|
106
|
+
},
|
|
107
|
+
bgFillInverted2: fgSurface4Config,
|
|
108
|
+
bgFillDark: {
|
|
109
|
+
contrast: {
|
|
110
|
+
reference: "surface3",
|
|
111
|
+
followDirection: "darker",
|
|
112
|
+
// This is what causes the token to be always dark
|
|
113
|
+
target: 7,
|
|
114
|
+
ignoreWhenAdjustingSeed: true
|
|
115
|
+
},
|
|
116
|
+
lightness: lightnessConstraintForegroundHighContrast,
|
|
117
|
+
taperChromaOptions: FG_TAPER_CHROMA
|
|
118
|
+
},
|
|
119
|
+
// Stroke
|
|
120
|
+
stroke1: {
|
|
121
|
+
contrast: {
|
|
122
|
+
reference: "stroke3",
|
|
123
|
+
followDirection: "opposite",
|
|
124
|
+
target: 2.2
|
|
125
|
+
},
|
|
126
|
+
taperChromaOptions: STROKE_TAPER_CHROMA
|
|
127
|
+
},
|
|
128
|
+
stroke2: {
|
|
129
|
+
contrast: {
|
|
130
|
+
reference: "stroke3",
|
|
131
|
+
followDirection: "opposite",
|
|
132
|
+
target: 1.5
|
|
133
|
+
},
|
|
134
|
+
taperChromaOptions: STROKE_TAPER_CHROMA
|
|
135
|
+
},
|
|
136
|
+
stroke3: {
|
|
137
|
+
contrast: {
|
|
138
|
+
reference: "surface3",
|
|
139
|
+
followDirection: "main",
|
|
140
|
+
target: 3
|
|
141
|
+
},
|
|
142
|
+
taperChromaOptions: STROKE_TAPER_CHROMA
|
|
143
|
+
},
|
|
144
|
+
stroke4: {
|
|
145
|
+
contrast: {
|
|
146
|
+
reference: "stroke3",
|
|
147
|
+
followDirection: "main",
|
|
148
|
+
target: 1.5
|
|
149
|
+
},
|
|
150
|
+
taperChromaOptions: STROKE_TAPER_CHROMA
|
|
151
|
+
},
|
|
152
|
+
// fgSurface
|
|
153
|
+
fgSurface1: {
|
|
154
|
+
contrast: {
|
|
155
|
+
reference: "surface3",
|
|
156
|
+
followDirection: "main",
|
|
157
|
+
target: 2,
|
|
158
|
+
preferLighter: true
|
|
159
|
+
},
|
|
160
|
+
taperChromaOptions: FG_TAPER_CHROMA
|
|
161
|
+
},
|
|
162
|
+
fgSurface2: {
|
|
163
|
+
contrast: {
|
|
164
|
+
reference: "surface3",
|
|
165
|
+
followDirection: "main",
|
|
166
|
+
target: 3,
|
|
167
|
+
preferLighter: true
|
|
168
|
+
},
|
|
169
|
+
taperChromaOptions: FG_TAPER_CHROMA
|
|
170
|
+
},
|
|
171
|
+
fgSurface3: {
|
|
172
|
+
contrast: {
|
|
173
|
+
reference: "surface3",
|
|
174
|
+
followDirection: "main",
|
|
175
|
+
target: 4.5,
|
|
176
|
+
preferLighter: true
|
|
177
|
+
},
|
|
178
|
+
lightness: lightnessConstraintForegroundMediumContrast,
|
|
179
|
+
taperChromaOptions: FG_TAPER_CHROMA
|
|
180
|
+
},
|
|
181
|
+
fgSurface4: fgSurface4Config,
|
|
182
|
+
// fgFill
|
|
183
|
+
fgFill: {
|
|
184
|
+
contrast: {
|
|
185
|
+
reference: "bgFill1",
|
|
186
|
+
followDirection: "best",
|
|
187
|
+
target: 4.5,
|
|
188
|
+
preferLighter: true
|
|
189
|
+
},
|
|
190
|
+
lightness: lightnessConstraintForegroundHighContrast,
|
|
191
|
+
taperChromaOptions: FG_TAPER_CHROMA
|
|
192
|
+
},
|
|
193
|
+
fgFillInverted: {
|
|
194
|
+
contrast: {
|
|
195
|
+
reference: "bgFillInverted1",
|
|
196
|
+
followDirection: "best",
|
|
197
|
+
target: 4.5,
|
|
198
|
+
preferLighter: true
|
|
199
|
+
},
|
|
200
|
+
lightness: lightnessConstraintForegroundHighContrast,
|
|
201
|
+
taperChromaOptions: FG_TAPER_CHROMA
|
|
202
|
+
},
|
|
203
|
+
fgFillDark: {
|
|
204
|
+
contrast: {
|
|
205
|
+
reference: "bgFillDark",
|
|
206
|
+
followDirection: "best",
|
|
207
|
+
target: 4.5,
|
|
208
|
+
preferLighter: true
|
|
209
|
+
},
|
|
210
|
+
lightness: lightnessConstraintForegroundHighContrast,
|
|
211
|
+
taperChromaOptions: FG_TAPER_CHROMA
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
const ACCENT_RAMP_CONFIG = {
|
|
215
|
+
...BG_RAMP_CONFIG,
|
|
216
|
+
surface1: {
|
|
217
|
+
...BG_RAMP_CONFIG.surface1,
|
|
218
|
+
taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA
|
|
219
|
+
},
|
|
220
|
+
surface2: {
|
|
221
|
+
contrast: {
|
|
222
|
+
reference: "bgFill1",
|
|
223
|
+
followDirection: "opposite",
|
|
224
|
+
target: BG_RAMP_CONFIG.bgFill1.contrast.target,
|
|
225
|
+
ignoreWhenAdjustingSeed: true
|
|
226
|
+
},
|
|
227
|
+
taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA
|
|
228
|
+
},
|
|
229
|
+
surface3: {
|
|
230
|
+
...BG_RAMP_CONFIG.surface3,
|
|
231
|
+
taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA
|
|
232
|
+
},
|
|
233
|
+
surface4: {
|
|
234
|
+
...BG_RAMP_CONFIG.surface4,
|
|
235
|
+
taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA
|
|
236
|
+
},
|
|
237
|
+
surface5: {
|
|
238
|
+
...BG_RAMP_CONFIG.surface5,
|
|
239
|
+
taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA
|
|
240
|
+
},
|
|
241
|
+
surface6: {
|
|
242
|
+
...BG_RAMP_CONFIG.surface6,
|
|
243
|
+
taperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA
|
|
244
|
+
},
|
|
245
|
+
bgFill1: {
|
|
246
|
+
contrast: {
|
|
247
|
+
reference: "seed",
|
|
248
|
+
followDirection: "main",
|
|
249
|
+
target: 1
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
stroke1: {
|
|
253
|
+
...BG_RAMP_CONFIG.stroke1
|
|
254
|
+
},
|
|
255
|
+
stroke2: {
|
|
256
|
+
...BG_RAMP_CONFIG.stroke2
|
|
257
|
+
},
|
|
258
|
+
stroke3: {
|
|
259
|
+
...BG_RAMP_CONFIG.stroke3,
|
|
260
|
+
sameAsIfPossible: "fgSurface3",
|
|
261
|
+
taperChromaOptions: void 0
|
|
262
|
+
},
|
|
263
|
+
stroke4: {
|
|
264
|
+
...BG_RAMP_CONFIG.stroke4,
|
|
265
|
+
taperChromaOptions: void 0
|
|
266
|
+
},
|
|
267
|
+
// fgSurface: do not de-saturate
|
|
268
|
+
fgSurface1: {
|
|
269
|
+
...BG_RAMP_CONFIG.fgSurface1,
|
|
270
|
+
taperChromaOptions: void 0
|
|
271
|
+
},
|
|
272
|
+
fgSurface2: {
|
|
273
|
+
...BG_RAMP_CONFIG.fgSurface2,
|
|
274
|
+
taperChromaOptions: void 0
|
|
275
|
+
},
|
|
276
|
+
fgSurface3: {
|
|
277
|
+
...BG_RAMP_CONFIG.fgSurface3,
|
|
278
|
+
taperChromaOptions: void 0,
|
|
279
|
+
sameAsIfPossible: "bgFill1"
|
|
280
|
+
},
|
|
281
|
+
fgSurface4: {
|
|
282
|
+
...BG_RAMP_CONFIG.fgSurface4,
|
|
283
|
+
taperChromaOptions: void 0
|
|
284
|
+
}
|
|
285
|
+
};
|
|
286
|
+
export {
|
|
287
|
+
ACCENT_RAMP_CONFIG,
|
|
288
|
+
BG_RAMP_CONFIG
|
|
289
|
+
};
|
|
290
|
+
//# sourceMappingURL=ramp-configs.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/color-ramps/lib/ramp-configs.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { RampStepConfig, RampConfig, RampDirection } from './types';\nimport type { TaperChromaOptions } from './taper-chroma';\n\nconst lightnessConstraintForegroundHighContrast = (\n\tdirection: RampDirection\n) =>\n\tdirection === 'lighter'\n\t\t? 0.9551 // lightness of #f0f0f0 (ie $gray-100)\n\t\t: 0.235; // lightness of #1e1e1e (ie $gray-900)\nconst lightnessConstraintForegroundMediumContrast = (\n\tdirection: RampDirection\n) =>\n\tdirection === 'lighter'\n\t\t? 0.77 // lightness of #b4b4b4\n\t\t: 0.56; // lightness of #747474\nconst lightnessConstraintBgFill = ( direction: RampDirection ) =>\n\tdirection === 'lighter'\n\t\t? 0.67 // lightness of #969696 (7:1 vs black)\n\t\t: 0.45; // lightness of #555555 (7:1 vs white)\n\nconst BG_SURFACE_TAPER_CHROMA: TaperChromaOptions = {\n\talpha: 0.7,\n};\nconst FG_TAPER_CHROMA: TaperChromaOptions = {\n\talpha: 0.6,\n\tkLight: 0.2,\n\tkDark: 0.2,\n};\nconst STROKE_TAPER_CHROMA: TaperChromaOptions = {\n\talpha: 0.6,\n\tradiusDark: 0.01,\n\tradiusLight: 0.01,\n\tkLight: 0.8,\n\tkDark: 0.8,\n};\nconst ACCENT_SURFACE_TAPER_CHROMA: TaperChromaOptions = {\n\talpha: 0.75,\n\tradiusDark: 0.01,\n\tradiusLight: 0.01,\n};\n\nconst fgSurface4Config: RampStepConfig = {\n\tcontrast: {\n\t\treference: 'surface3',\n\t\tfollowDirection: 'main',\n\t\ttarget: 7,\n\t\tpreferLighter: true,\n\t},\n\tlightness: lightnessConstraintForegroundHighContrast,\n\ttaperChromaOptions: FG_TAPER_CHROMA,\n};\n\nexport const BG_RAMP_CONFIG: RampConfig = {\n\t// Surface\n\tsurface1: {\n\t\tcontrast: {\n\t\t\treference: 'surface2',\n\t\t\tfollowDirection: 'opposite',\n\t\t\ttarget: 1.02,\n\t\t\tignoreWhenAdjustingSeed: true,\n\t\t},\n\t\ttaperChromaOptions: BG_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface2: {\n\t\tcontrast: {\n\t\t\treference: 'seed',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 1,\n\t\t},\n\t},\n\tsurface3: {\n\t\tcontrast: {\n\t\t\treference: 'surface2',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 1.02,\n\t\t},\n\t\ttaperChromaOptions: BG_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface4: {\n\t\tcontrast: {\n\t\t\treference: 'surface2',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 1.08,\n\t\t},\n\t\ttaperChromaOptions: BG_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface5: {\n\t\tcontrast: {\n\t\t\treference: 'surface2',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 1.2,\n\t\t},\n\t\ttaperChromaOptions: BG_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface6: {\n\t\tcontrast: {\n\t\t\treference: 'surface2',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 1.4,\n\t\t},\n\t\ttaperChromaOptions: BG_SURFACE_TAPER_CHROMA,\n\t},\n\t// Bg fill\n\tbgFill1: {\n\t\tcontrast: {\n\t\t\treference: 'surface2',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 4,\n\t\t},\n\t\tlightness: lightnessConstraintBgFill,\n\t},\n\tbgFill2: {\n\t\tcontrast: {\n\t\t\treference: 'bgFill1',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 1.2,\n\t\t},\n\t},\n\tbgFillInverted1: {\n\t\tcontrast: {\n\t\t\treference: 'bgFillInverted2',\n\t\t\tfollowDirection: 'opposite',\n\t\t\ttarget: 1.2,\n\t\t},\n\t},\n\tbgFillInverted2: fgSurface4Config,\n\tbgFillDark: {\n\t\tcontrast: {\n\t\t\treference: 'surface3',\n\t\t\tfollowDirection: 'darker', // This is what causes the token to be always dark\n\t\t\ttarget: 7,\n\t\t\tignoreWhenAdjustingSeed: true,\n\t\t},\n\t\tlightness: lightnessConstraintForegroundHighContrast,\n\t\ttaperChromaOptions: FG_TAPER_CHROMA,\n\t},\n\t// Stroke\n\tstroke1: {\n\t\tcontrast: {\n\t\t\treference: 'stroke3',\n\t\t\tfollowDirection: 'opposite',\n\t\t\ttarget: 2.2,\n\t\t},\n\t\ttaperChromaOptions: STROKE_TAPER_CHROMA,\n\t},\n\tstroke2: {\n\t\tcontrast: {\n\t\t\treference: 'stroke3',\n\t\t\tfollowDirection: 'opposite',\n\t\t\ttarget: 1.5,\n\t\t},\n\t\ttaperChromaOptions: STROKE_TAPER_CHROMA,\n\t},\n\tstroke3: {\n\t\tcontrast: {\n\t\t\treference: 'surface3',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 3,\n\t\t},\n\t\ttaperChromaOptions: STROKE_TAPER_CHROMA,\n\t},\n\tstroke4: {\n\t\tcontrast: {\n\t\t\treference: 'stroke3',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 1.5,\n\t\t},\n\t\ttaperChromaOptions: STROKE_TAPER_CHROMA,\n\t},\n\t// fgSurface\n\tfgSurface1: {\n\t\tcontrast: {\n\t\t\treference: 'surface3',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 2,\n\t\t\tpreferLighter: true,\n\t\t},\n\t\ttaperChromaOptions: FG_TAPER_CHROMA,\n\t},\n\tfgSurface2: {\n\t\tcontrast: {\n\t\t\treference: 'surface3',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 3,\n\t\t\tpreferLighter: true,\n\t\t},\n\t\ttaperChromaOptions: FG_TAPER_CHROMA,\n\t},\n\tfgSurface3: {\n\t\tcontrast: {\n\t\t\treference: 'surface3',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 4.5,\n\t\t\tpreferLighter: true,\n\t\t},\n\t\tlightness: lightnessConstraintForegroundMediumContrast,\n\t\ttaperChromaOptions: FG_TAPER_CHROMA,\n\t},\n\tfgSurface4: fgSurface4Config,\n\t// fgFill\n\tfgFill: {\n\t\tcontrast: {\n\t\t\treference: 'bgFill1',\n\t\t\tfollowDirection: 'best',\n\t\t\ttarget: 4.5,\n\t\t\tpreferLighter: true,\n\t\t},\n\t\tlightness: lightnessConstraintForegroundHighContrast,\n\t\ttaperChromaOptions: FG_TAPER_CHROMA,\n\t},\n\tfgFillInverted: {\n\t\tcontrast: {\n\t\t\treference: 'bgFillInverted1',\n\t\t\tfollowDirection: 'best',\n\t\t\ttarget: 4.5,\n\t\t\tpreferLighter: true,\n\t\t},\n\t\tlightness: lightnessConstraintForegroundHighContrast,\n\t\ttaperChromaOptions: FG_TAPER_CHROMA,\n\t},\n\tfgFillDark: {\n\t\tcontrast: {\n\t\t\treference: 'bgFillDark',\n\t\t\tfollowDirection: 'best',\n\t\t\ttarget: 4.5,\n\t\t\tpreferLighter: true,\n\t\t},\n\t\tlightness: lightnessConstraintForegroundHighContrast,\n\t\ttaperChromaOptions: FG_TAPER_CHROMA,\n\t},\n};\n\n// BG_RAMP: seed => surface2 => {bgFill, surface3 => all other tokens}\n// ACCENT_RAMP: seed => bgFill1 => surface2 => surface3 => all other tokens\nexport const ACCENT_RAMP_CONFIG: RampConfig = {\n\t...BG_RAMP_CONFIG,\n\tsurface1: {\n\t\t...BG_RAMP_CONFIG.surface1,\n\t\ttaperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface2: {\n\t\tcontrast: {\n\t\t\treference: 'bgFill1',\n\t\t\tfollowDirection: 'opposite',\n\t\t\ttarget: BG_RAMP_CONFIG.bgFill1.contrast.target,\n\t\t\tignoreWhenAdjustingSeed: true,\n\t\t},\n\t\ttaperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface3: {\n\t\t...BG_RAMP_CONFIG.surface3,\n\t\ttaperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface4: {\n\t\t...BG_RAMP_CONFIG.surface4,\n\t\ttaperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface5: {\n\t\t...BG_RAMP_CONFIG.surface5,\n\t\ttaperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA,\n\t},\n\tsurface6: {\n\t\t...BG_RAMP_CONFIG.surface6,\n\t\ttaperChromaOptions: ACCENT_SURFACE_TAPER_CHROMA,\n\t},\n\tbgFill1: {\n\t\tcontrast: {\n\t\t\treference: 'seed',\n\t\t\tfollowDirection: 'main',\n\t\t\ttarget: 1,\n\t\t},\n\t},\n\tstroke1: {\n\t\t...BG_RAMP_CONFIG.stroke1,\n\t},\n\tstroke2: {\n\t\t...BG_RAMP_CONFIG.stroke2,\n\t},\n\tstroke3: {\n\t\t...BG_RAMP_CONFIG.stroke3,\n\t\tsameAsIfPossible: 'fgSurface3',\n\t\ttaperChromaOptions: undefined,\n\t},\n\tstroke4: {\n\t\t...BG_RAMP_CONFIG.stroke4,\n\t\ttaperChromaOptions: undefined,\n\t},\n\t// fgSurface: do not de-saturate\n\tfgSurface1: {\n\t\t...BG_RAMP_CONFIG.fgSurface1,\n\t\ttaperChromaOptions: undefined,\n\t},\n\tfgSurface2: {\n\t\t...BG_RAMP_CONFIG.fgSurface2,\n\t\ttaperChromaOptions: undefined,\n\t},\n\tfgSurface3: {\n\t\t...BG_RAMP_CONFIG.fgSurface3,\n\t\ttaperChromaOptions: undefined,\n\t\tsameAsIfPossible: 'bgFill1',\n\t},\n\tfgSurface4: {\n\t\t...BG_RAMP_CONFIG.fgSurface4,\n\t\ttaperChromaOptions: undefined,\n\t},\n};\n"],
|
|
5
|
+
"mappings": "AAMA,MAAM,4CAA4C,CACjD,cAEA,cAAc,YACX,SACA;AACJ,MAAM,8CAA8C,CACnD,cAEA,cAAc,YACX,OACA;AACJ,MAAM,4BAA4B,CAAE,cACnC,cAAc,YACX,OACA;AAEJ,MAAM,0BAA8C;AAAA,EACnD,OAAO;AACR;AACA,MAAM,kBAAsC;AAAA,EAC3C,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AACR;AACA,MAAM,sBAA0C;AAAA,EAC/C,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,QAAQ;AAAA,EACR,OAAO;AACR;AACA,MAAM,8BAAkD;AAAA,EACvD,OAAO;AAAA,EACP,YAAY;AAAA,EACZ,aAAa;AACd;AAEA,MAAM,mBAAmC;AAAA,EACxC,UAAU;AAAA,IACT,WAAW;AAAA,IACX,iBAAiB;AAAA,IACjB,QAAQ;AAAA,IACR,eAAe;AAAA,EAChB;AAAA,EACA,WAAW;AAAA,EACX,oBAAoB;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