@wordpress/theme 0.2.0 → 0.2.1-next.16d95556a.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/README.md +5 -1
- package/bin/generate-primitive-tokens/index.ts +1 -1
- package/build/color-ramps/index.js +5 -5
- package/build/color-ramps/index.js.map +2 -2
- package/build/color-ramps/lib/default-ramps.js +154 -154
- package/build/color-ramps/lib/default-ramps.js.map +2 -2
- package/build/color-ramps/lib/index.js +16 -9
- package/build/color-ramps/lib/index.js.map +2 -2
- package/build/color-ramps/lib/types.js.map +1 -1
- package/build/use-theme-provider-styles.js +1 -4
- package/build/use-theme-provider-styles.js.map +2 -2
- package/build-module/color-ramps/index.js +5 -5
- package/build-module/color-ramps/index.js.map +2 -2
- package/build-module/color-ramps/lib/default-ramps.js +154 -154
- package/build-module/color-ramps/lib/default-ramps.js.map +2 -2
- package/build-module/color-ramps/lib/index.js +16 -9
- package/build-module/color-ramps/lib/index.js.map +2 -2
- package/build-module/use-theme-provider-styles.js +1 -4
- package/build-module/use-theme-provider-styles.js.map +2 -2
- package/build-types/color-ramps/lib/index.d.ts.map +1 -1
- package/build-types/color-ramps/lib/types.d.ts +2 -4
- package/build-types/color-ramps/lib/types.d.ts.map +1 -1
- package/build-types/color-ramps/stories/index.story.d.ts.map +1 -1
- package/build-types/color-ramps/stories/ramp-table.d.ts +2 -4
- package/build-types/color-ramps/stories/ramp-table.d.ts.map +1 -1
- package/build-types/use-theme-provider-styles.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/color-ramps/index.ts +5 -5
- package/src/color-ramps/lib/default-ramps.ts +154 -154
- package/src/color-ramps/lib/index.ts +26 -22
- package/src/color-ramps/lib/types.ts +2 -7
- package/src/color-ramps/stories/index.story.tsx +4 -1
- package/src/color-ramps/stories/ramp-table.tsx +15 -26
- package/src/color-ramps/test/__snapshots__/index.test.ts.snap +11717 -41231
- package/src/color-ramps/test/index.test.ts +2 -2
- package/src/use-theme-provider-styles.ts +1 -4
- package/tsconfig.bin.tsbuildinfo +1 -1
- package/tsconfig.src.tsbuildinfo +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Theme
|
|
2
|
+
|
|
3
|
+
<div class="callout callout-alert">
|
|
4
|
+
This package is still experimental. “Experimental” means this is an early implementation subject to drastic and breaking changes.
|
|
5
|
+
</div>
|
|
2
6
|
|
|
3
7
|
A theming package that's part of the WordPress Design System. It has two parts:
|
|
4
8
|
|
|
@@ -87,7 +87,7 @@ function generatePrimitiveColorTokens() {
|
|
|
87
87
|
ramp.ramp
|
|
88
88
|
) ) {
|
|
89
89
|
colorJson.color.primitive[ scaleName ][ tokenName ] = {
|
|
90
|
-
$value: transformColorStringToDTCGValue( tokenValue
|
|
90
|
+
$value: transformColorStringToDTCGValue( tokenValue ),
|
|
91
91
|
};
|
|
92
92
|
}
|
|
93
93
|
} );
|
|
@@ -46,7 +46,7 @@ function getBgRampInfo(ramp) {
|
|
|
46
46
|
pinLightness: {
|
|
47
47
|
stepName: STEP_TO_PIN,
|
|
48
48
|
value: (0, import_utils.clampAccentScaleReferenceLightness)(
|
|
49
|
-
(0, import_fn.get)((0, import_fn.parse)(ramp.ramp[STEP_TO_PIN]
|
|
49
|
+
(0, import_fn.get)((0, import_fn.parse)(ramp.ramp[STEP_TO_PIN]), [import_fn.OKLCH, "l"]),
|
|
50
50
|
ramp.direction
|
|
51
51
|
)
|
|
52
52
|
}
|
|
@@ -68,8 +68,8 @@ function checkAccessibleCombinations({
|
|
|
68
68
|
import_constants.CONTRAST_COMBINATIONS.forEach(({ bgs, fgs, target }) => {
|
|
69
69
|
for (const bg of bgs) {
|
|
70
70
|
for (const fg of fgs) {
|
|
71
|
-
const bgColor = (0, import_fn.parse)(ramp.ramp[bg]
|
|
72
|
-
const fgColor = (0, import_fn.parse)(ramp.ramp[fg]
|
|
71
|
+
const bgColor = (0, import_fn.parse)(ramp.ramp[bg]);
|
|
72
|
+
const fgColor = (0, import_fn.parse)(ramp.ramp[fg]);
|
|
73
73
|
if ((0, import_color_utils.getContrast)(bgColor, fgColor) < target) {
|
|
74
74
|
unmetTargets.push({
|
|
75
75
|
bgName: bg,
|
|
@@ -87,8 +87,8 @@ function checkAccessibleCombinations({
|
|
|
87
87
|
import_constants.CONTRAST_COMBINATIONS.forEach(({ bgs, fgs, target }) => {
|
|
88
88
|
for (const bg of bgs) {
|
|
89
89
|
for (const fg of fgs) {
|
|
90
|
-
const bgColor = (0, import_fn.parse)(bgRamp.ramp[bg]
|
|
91
|
-
const fgColor = (0, import_fn.parse)(ramp.ramp[fg]
|
|
90
|
+
const bgColor = (0, import_fn.parse)(bgRamp.ramp[bg]);
|
|
91
|
+
const fgColor = (0, import_fn.parse)(ramp.ramp[fg]);
|
|
92
92
|
if ((0, import_color_utils.getContrast)(bgColor, fgColor) < target) {
|
|
93
93
|
unmetTargets.push({
|
|
94
94
|
bgName: bg,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../src/color-ramps/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * External dependencies\n */\nimport { get, OKLCH, parse, serialize } from 'colorjs.io/fn';\n\n/**\n * Internal dependencies\n */\nimport './lib/register-color-spaces';\nimport { buildRamp } from './lib/index';\nimport { clampAccentScaleReferenceLightness } from './lib/utils';\nimport { BG_RAMP_CONFIG, ACCENT_RAMP_CONFIG } from './lib/ramp-configs';\nimport type {\n\tRampResult as InternalRampResult,\n\tRampDirection,\n\tRamp,\n} from './lib/types';\nimport { getContrast } from './lib/color-utils';\nimport { CONTRAST_COMBINATIONS } from './lib/constants';\nexport { DEFAULT_SEED_COLORS } from './lib/constants';\n\n/**\n * Creates a background ramp.\n * @param seed The seed color for the background ramp.\n */\nexport function buildBgRamp( seed: string ) {\n\tif ( typeof seed !== 'string' || seed.trim() === '' ) {\n\t\tthrow new Error( 'Seed color must be a non-empty string' );\n\t}\n\n\treturn buildRamp( seed, BG_RAMP_CONFIG );\n}\n\nconst STEP_TO_PIN = 'surface2';\nfunction getBgRampInfo( ramp: InternalRampResult ): {\n\tmainDirection: RampDirection;\n\tpinLightness: {\n\t\tstepName: keyof Ramp;\n\t\tvalue: number;\n\t};\n} {\n\treturn {\n\t\tmainDirection: ramp.direction,\n\t\tpinLightness: {\n\t\t\tstepName: STEP_TO_PIN,\n\t\t\tvalue: clampAccentScaleReferenceLightness(\n\t\t\t\tget( parse( ramp.ramp[ STEP_TO_PIN ]
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAA6C;AAK7C,mCAAO;AACP,iBAA0B;AAC1B,mBAAmD;AACnD,0BAAmD;AAMnD,yBAA4B;AAC5B,uBAAsC;AACtC,IAAAA,oBAAoC;AAM7B,SAAS,YAAa,MAAe;AAC3C,MAAK,OAAO,SAAS,YAAY,KAAK,KAAK,MAAM,IAAK;AACrD,UAAM,IAAI,MAAO,uCAAwC;AAAA,EAC1D;AAEA,aAAO,sBAAW,MAAM,kCAAe;AACxC;AAEA,IAAM,cAAc;AACpB,SAAS,cAAe,MAMtB;AACD,SAAO;AAAA,IACN,eAAe,KAAK;AAAA,IACpB,cAAc;AAAA,MACb,UAAU;AAAA,MACV,WAAO;AAAA,YACN,mBAAK,iBAAO,KAAK,KAAM,WAAY,
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport { get, OKLCH, parse, serialize } from 'colorjs.io/fn';\n\n/**\n * Internal dependencies\n */\nimport './lib/register-color-spaces';\nimport { buildRamp } from './lib/index';\nimport { clampAccentScaleReferenceLightness } from './lib/utils';\nimport { BG_RAMP_CONFIG, ACCENT_RAMP_CONFIG } from './lib/ramp-configs';\nimport type {\n\tRampResult as InternalRampResult,\n\tRampDirection,\n\tRamp,\n} from './lib/types';\nimport { getContrast } from './lib/color-utils';\nimport { CONTRAST_COMBINATIONS } from './lib/constants';\nexport { DEFAULT_SEED_COLORS } from './lib/constants';\n\n/**\n * Creates a background ramp.\n * @param seed The seed color for the background ramp.\n */\nexport function buildBgRamp( seed: string ) {\n\tif ( typeof seed !== 'string' || seed.trim() === '' ) {\n\t\tthrow new Error( 'Seed color must be a non-empty string' );\n\t}\n\n\treturn buildRamp( seed, BG_RAMP_CONFIG );\n}\n\nconst STEP_TO_PIN = 'surface2';\nfunction getBgRampInfo( ramp: InternalRampResult ): {\n\tmainDirection: RampDirection;\n\tpinLightness: {\n\t\tstepName: keyof Ramp;\n\t\tvalue: number;\n\t};\n} {\n\treturn {\n\t\tmainDirection: ramp.direction,\n\t\tpinLightness: {\n\t\t\tstepName: STEP_TO_PIN,\n\t\t\tvalue: clampAccentScaleReferenceLightness(\n\t\t\t\tget( parse( ramp.ramp[ STEP_TO_PIN ] ), [ OKLCH, 'l' ] ),\n\t\t\t\tramp.direction\n\t\t\t),\n\t\t},\n\t};\n}\n\n/**\n * Creates an accent ramp (ie used by primary, success, info, warning and error\n * ramps).\n * @param seed The seed color for the accent ramp.\n * @param bgRamp The ramp of the background on which the accent is shown.\n */\nexport function buildAccentRamp(\n\tseed: string,\n\tbgRamp?: InternalRampResult\n): InternalRampResult {\n\tif ( typeof seed !== 'string' || seed.trim() === '' ) {\n\t\tthrow new Error( 'Seed color must be a non-empty string' );\n\t}\n\n\tconst bgRampInfo = bgRamp ? getBgRampInfo( bgRamp ) : undefined;\n\treturn buildRamp( seed, ACCENT_RAMP_CONFIG, bgRampInfo );\n}\n\n/**\n * Checks that all bg/fg combinations generated by the ramps meet contrast\n * targets.\n * @param params\n * @param params.bgRamp\n * @param params.accentRamps\n */\nexport function checkAccessibleCombinations( {\n\tbgRamp,\n\taccentRamps = [],\n}: {\n\tbgRamp: InternalRampResult;\n\taccentRamps?: InternalRampResult[];\n} ) {\n\tconst unmetTargets: {\n\t\tbgName: keyof Ramp;\n\t\tbgColor: string;\n\t\tfgName: keyof Ramp;\n\t\tfgColor: string;\n\t\tunmetContrast: number;\n\t}[] = [];\n\n\t// Assess combinations within each ramp\n\t[ bgRamp, ...accentRamps ].forEach( ( ramp ) => {\n\t\tCONTRAST_COMBINATIONS.forEach( ( { bgs, fgs, target } ) => {\n\t\t\tfor ( const bg of bgs ) {\n\t\t\t\tfor ( const fg of fgs ) {\n\t\t\t\t\tconst bgColor = parse( ramp.ramp[ bg ] );\n\t\t\t\t\tconst fgColor = parse( ramp.ramp[ fg ] );\n\t\t\t\t\tif ( getContrast( bgColor, fgColor ) < target ) {\n\t\t\t\t\t\tunmetTargets.push( {\n\t\t\t\t\t\t\tbgName: bg,\n\t\t\t\t\t\t\tbgColor: serialize( bgColor ),\n\t\t\t\t\t\t\tfgName: fg,\n\t\t\t\t\t\t\tfgColor: serialize( fgColor ),\n\t\t\t\t\t\t\tunmetContrast: target,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n\t// Assess each accent ramp's fg color against bg ramp\n\taccentRamps.forEach( ( ramp ) => {\n\t\tCONTRAST_COMBINATIONS.forEach( ( { bgs, fgs, target } ) => {\n\t\t\tfor ( const bg of bgs ) {\n\t\t\t\tfor ( const fg of fgs ) {\n\t\t\t\t\tconst bgColor = parse( bgRamp.ramp[ bg ] );\n\t\t\t\t\tconst fgColor = parse( ramp.ramp[ fg ] );\n\t\t\t\t\tif ( getContrast( bgColor, fgColor ) < target ) {\n\t\t\t\t\t\tunmetTargets.push( {\n\t\t\t\t\t\t\tbgName: bg,\n\t\t\t\t\t\t\tbgColor: serialize( bgColor ),\n\t\t\t\t\t\t\tfgName: fg,\n\t\t\t\t\t\t\tfgColor: serialize( fgColor ),\n\t\t\t\t\t\t\tunmetContrast: target,\n\t\t\t\t\t\t} );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t} );\n\n\treturn unmetTargets;\n}\n\nexport type RampResult = InternalRampResult;\n"],
|
|
5
|
+
"m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AQ,IAAI,QAAS;AAC/C,yBAAa,KAAM;AAAA,cAClB,QAAQ;AAAA,cACR,aAAS,qBAAW,OAAQ;AAAA,cAC5B,QAAQ;AAAA,cACR,aAAS,qBAAW,OAAQ;AAAA,cAC5B,eAAe;AAAA,YAChB,CAAE;AAAA,UACH;AAAA,QACD;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,cAAY,QAAS,CAAE,SAAU;AAChC,2CAAsB,QAAS,CAAE,EAAE,KAAK,KAAK,OAAO,MAAO;AAC1D,iBAAY,MAAM,KAAM;AACvB,mBAAY,MAAM,KAAM;AACvB,gBAAM,cAAU,iBAAO,OAAO,KAAM,EAAG,CAAE;AACzC,gBAAM,cAAU,iBAAO,KAAK,KAAM,EAAG,CAAE;AACvC,kBAAK,gCAAa,SAAS,OAAQ,IAAI,QAAS;AAC/C,yBAAa,KAAM;AAAA,cAClB,QAAQ;AAAA,cACR,aAAS,qBAAW,OAAQ;AAAA,cAC5B,QAAQ;AAAA,cACR,aAAS,qBAAW,OAAQ;AAAA,cAC5B,eAAe;AAAA,YAChB,CAAE;AAAA,UACH;AAAA,QACD;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,SAAO;AACR;",
|
|
6
6
|
"names": ["import_constants"]
|
|
7
7
|
}
|
|
@@ -25,190 +25,190 @@ module.exports = __toCommonJS(default_ramps_exports);
|
|
|
25
25
|
var DEFAULT_RAMPS = {
|
|
26
26
|
bg: {
|
|
27
27
|
ramp: {
|
|
28
|
-
surface2:
|
|
29
|
-
bgFill1:
|
|
30
|
-
fgFill:
|
|
31
|
-
bgFill2:
|
|
32
|
-
surface6:
|
|
33
|
-
surface5:
|
|
34
|
-
surface4:
|
|
35
|
-
surface3:
|
|
36
|
-
fgSurface4:
|
|
37
|
-
fgSurface3:
|
|
38
|
-
fgSurface2:
|
|
39
|
-
fgSurface1:
|
|
40
|
-
stroke3:
|
|
41
|
-
stroke4:
|
|
42
|
-
stroke2:
|
|
43
|
-
stroke1:
|
|
44
|
-
bgFillDark:
|
|
45
|
-
fgFillDark:
|
|
46
|
-
bgFillInverted2:
|
|
47
|
-
bgFillInverted1:
|
|
48
|
-
fgFillInverted:
|
|
49
|
-
surface1:
|
|
28
|
+
surface2: "#f8f8f8",
|
|
29
|
+
bgFill1: "#555",
|
|
30
|
+
fgFill: "#f0f0f0",
|
|
31
|
+
bgFill2: "#494949",
|
|
32
|
+
surface6: "#d3d3d3",
|
|
33
|
+
surface5: "#e3e3e3",
|
|
34
|
+
surface4: "#eaeaea",
|
|
35
|
+
surface3: "#fff",
|
|
36
|
+
fgSurface4: "#1e1e1e",
|
|
37
|
+
fgSurface3: "#6e6e6e",
|
|
38
|
+
fgSurface2: "#8b8b8b",
|
|
39
|
+
fgSurface1: "#ababab",
|
|
40
|
+
stroke3: "#8b8b8b",
|
|
41
|
+
stroke4: "#6d6d6d",
|
|
42
|
+
stroke2: "#adadad",
|
|
43
|
+
stroke1: "#cfcfcf",
|
|
44
|
+
bgFillDark: "#1e1e1e",
|
|
45
|
+
fgFillDark: "#f0f0f0",
|
|
46
|
+
bgFillInverted2: "#1e1e1e",
|
|
47
|
+
bgFillInverted1: "#2d2d2d",
|
|
48
|
+
fgFillInverted: "#f0f0f0",
|
|
49
|
+
surface1: "#f0f0f0"
|
|
50
50
|
},
|
|
51
51
|
direction: "darker"
|
|
52
52
|
},
|
|
53
53
|
primary: {
|
|
54
54
|
ramp: {
|
|
55
|
-
bgFill1:
|
|
56
|
-
fgFill:
|
|
57
|
-
bgFill2:
|
|
58
|
-
surface2:
|
|
59
|
-
surface6:
|
|
60
|
-
surface5:
|
|
61
|
-
surface4:
|
|
62
|
-
surface3:
|
|
63
|
-
fgSurface4:
|
|
64
|
-
fgSurface3:
|
|
65
|
-
fgSurface2:
|
|
66
|
-
fgSurface1:
|
|
67
|
-
stroke3:
|
|
68
|
-
stroke4:
|
|
69
|
-
stroke2:
|
|
70
|
-
stroke1:
|
|
71
|
-
bgFillDark:
|
|
72
|
-
fgFillDark:
|
|
73
|
-
bgFillInverted2:
|
|
74
|
-
bgFillInverted1:
|
|
75
|
-
fgFillInverted:
|
|
76
|
-
surface1:
|
|
55
|
+
bgFill1: "#3858e9",
|
|
56
|
+
fgFill: "#eff0f2",
|
|
57
|
+
bgFill2: "#2e49da",
|
|
58
|
+
surface2: "#f6f8fc",
|
|
59
|
+
surface6: "#c7d3ef",
|
|
60
|
+
surface5: "#dce3f5",
|
|
61
|
+
surface4: "#e5ebf7",
|
|
62
|
+
surface3: "#fff",
|
|
63
|
+
fgSurface4: "#080071",
|
|
64
|
+
fgSurface3: "#3858e9",
|
|
65
|
+
fgSurface2: "#5881ff",
|
|
66
|
+
fgSurface1: "#84a9ff",
|
|
67
|
+
stroke3: "#3858e9",
|
|
68
|
+
stroke4: "#2337c8",
|
|
69
|
+
stroke2: "#6d83bf",
|
|
70
|
+
stroke1: "#91a2cf",
|
|
71
|
+
bgFillDark: "#1b1e26",
|
|
72
|
+
fgFillDark: "#eff0f2",
|
|
73
|
+
bgFillInverted2: "#1b1e26",
|
|
74
|
+
bgFillInverted1: "#12009f",
|
|
75
|
+
fgFillInverted: "#eff0f2",
|
|
76
|
+
surface1: "#edf0fa"
|
|
77
77
|
},
|
|
78
78
|
direction: "darker"
|
|
79
79
|
},
|
|
80
80
|
info: {
|
|
81
81
|
ramp: {
|
|
82
|
-
bgFill1:
|
|
83
|
-
fgFill:
|
|
84
|
-
bgFill2:
|
|
85
|
-
surface2:
|
|
86
|
-
surface6:
|
|
87
|
-
surface5:
|
|
88
|
-
surface4:
|
|
89
|
-
surface3:
|
|
90
|
-
fgSurface4:
|
|
91
|
-
fgSurface3:
|
|
92
|
-
fgSurface2:
|
|
93
|
-
fgSurface1:
|
|
94
|
-
stroke3:
|
|
95
|
-
stroke4:
|
|
96
|
-
stroke2:
|
|
97
|
-
stroke1:
|
|
98
|
-
bgFillDark:
|
|
99
|
-
fgFillDark:
|
|
100
|
-
bgFillInverted2:
|
|
101
|
-
bgFillInverted1:
|
|
102
|
-
fgFillInverted:
|
|
103
|
-
surface1:
|
|
82
|
+
bgFill1: "#0090ff",
|
|
83
|
+
fgFill: "#1b1e23",
|
|
84
|
+
bgFill2: "#0081ef",
|
|
85
|
+
surface2: "#f5f9fd",
|
|
86
|
+
surface6: "#bed6f1",
|
|
87
|
+
surface5: "#d5e5f6",
|
|
88
|
+
surface4: "#e0ebf8",
|
|
89
|
+
surface3: "#fff",
|
|
90
|
+
fgSurface4: "#001758",
|
|
91
|
+
fgSurface3: "#006dd9",
|
|
92
|
+
fgSurface2: "#008cfb",
|
|
93
|
+
fgSurface1: "#53b1ff",
|
|
94
|
+
stroke3: "#006dd9",
|
|
95
|
+
stroke4: "#004eb8",
|
|
96
|
+
stroke2: "#5d8fc6",
|
|
97
|
+
stroke1: "#8aaed6",
|
|
98
|
+
bgFillDark: "#1b1e23",
|
|
99
|
+
fgFillDark: "#eff0f2",
|
|
100
|
+
bgFillInverted2: "#1b1e23",
|
|
101
|
+
bgFillInverted1: "#002675",
|
|
102
|
+
fgFillInverted: "#eff0f2",
|
|
103
|
+
surface1: "#eaf1fa"
|
|
104
104
|
},
|
|
105
105
|
direction: "darker"
|
|
106
106
|
},
|
|
107
107
|
success: {
|
|
108
108
|
ramp: {
|
|
109
|
-
bgFill1:
|
|
110
|
-
fgFill:
|
|
111
|
-
bgFill2:
|
|
112
|
-
surface2:
|
|
113
|
-
surface6:
|
|
114
|
-
surface5:
|
|
115
|
-
surface4:
|
|
116
|
-
surface3:
|
|
117
|
-
fgSurface4:
|
|
118
|
-
fgSurface3:
|
|
119
|
-
fgSurface2:
|
|
120
|
-
fgSurface1:
|
|
121
|
-
stroke3:
|
|
122
|
-
stroke4:
|
|
123
|
-
stroke2:
|
|
124
|
-
stroke1:
|
|
125
|
-
bgFillDark:
|
|
126
|
-
fgFillDark:
|
|
127
|
-
bgFillInverted2:
|
|
128
|
-
bgFillInverted1:
|
|
129
|
-
fgFillInverted:
|
|
130
|
-
surface1:
|
|
109
|
+
bgFill1: "#4ab866",
|
|
110
|
+
fgFill: "#1b1f1c",
|
|
111
|
+
bgFill2: "#37a857",
|
|
112
|
+
surface2: "#f0fcf2",
|
|
113
|
+
surface6: "#7eea95",
|
|
114
|
+
surface5: "#b7f2c1",
|
|
115
|
+
surface4: "#cdf5d3",
|
|
116
|
+
surface3: "#fff",
|
|
117
|
+
fgSurface4: "#002b00",
|
|
118
|
+
fgSurface3: "#008031",
|
|
119
|
+
fgSurface2: "#2c9f4e",
|
|
120
|
+
fgSurface1: "#54c16f",
|
|
121
|
+
stroke3: "#008031",
|
|
122
|
+
stroke4: "#006314",
|
|
123
|
+
stroke2: "#61986b",
|
|
124
|
+
stroke1: "#77ba84",
|
|
125
|
+
bgFillDark: "#1b1f1c",
|
|
126
|
+
fgFillDark: "#edf2ed",
|
|
127
|
+
bgFillInverted2: "#1b1f1c",
|
|
128
|
+
bgFillInverted1: "#003800",
|
|
129
|
+
fgFillInverted: "#edf2ed",
|
|
130
|
+
surface1: "#ddf8e1"
|
|
131
131
|
},
|
|
132
132
|
direction: "darker"
|
|
133
133
|
},
|
|
134
134
|
caution: {
|
|
135
135
|
ramp: {
|
|
136
|
-
bgFill1:
|
|
137
|
-
fgFill:
|
|
138
|
-
bgFill2:
|
|
139
|
-
surface2:
|
|
140
|
-
surface6:
|
|
141
|
-
surface5:
|
|
142
|
-
surface4:
|
|
143
|
-
surface3:
|
|
144
|
-
fgSurface4:
|
|
145
|
-
fgSurface3:
|
|
146
|
-
fgSurface2:
|
|
147
|
-
fgSurface1:
|
|
148
|
-
stroke3:
|
|
149
|
-
stroke4:
|
|
150
|
-
stroke2:
|
|
151
|
-
stroke1:
|
|
152
|
-
bgFillDark:
|
|
153
|
-
fgFillDark:
|
|
154
|
-
bgFillInverted2:
|
|
155
|
-
bgFillInverted1:
|
|
156
|
-
fgFillInverted:
|
|
157
|
-
surface1:
|
|
136
|
+
bgFill1: "#f0d149",
|
|
137
|
+
fgFill: "#1f1e1b",
|
|
138
|
+
bgFill2: "#ddbe30",
|
|
139
|
+
surface2: "#fdf9e7",
|
|
140
|
+
surface6: "#ecd367",
|
|
141
|
+
surface5: "#f5e399",
|
|
142
|
+
surface4: "#f8ebb5",
|
|
143
|
+
surface3: "#fff",
|
|
144
|
+
fgSurface4: "#291d00",
|
|
145
|
+
fgSurface3: "#876b00",
|
|
146
|
+
fgSurface2: "#a78900",
|
|
147
|
+
fgSurface1: "#c9aa00",
|
|
148
|
+
stroke3: "#876b00",
|
|
149
|
+
stroke4: "#675000",
|
|
150
|
+
stroke2: "#978c60",
|
|
151
|
+
stroke1: "#b8ab75",
|
|
152
|
+
bgFillDark: "#1f1e1b",
|
|
153
|
+
fgFillDark: "#f6f1da",
|
|
154
|
+
bgFillInverted2: "#1f1e1b",
|
|
155
|
+
bgFillInverted1: "#3a2b00",
|
|
156
|
+
fgFillInverted: "#f6f1da",
|
|
157
|
+
surface1: "#faf1cd"
|
|
158
158
|
},
|
|
159
159
|
direction: "darker"
|
|
160
160
|
},
|
|
161
161
|
warning: {
|
|
162
162
|
ramp: {
|
|
163
|
-
bgFill1:
|
|
164
|
-
fgFill:
|
|
165
|
-
bgFill2:
|
|
166
|
-
surface2:
|
|
167
|
-
surface6:
|
|
168
|
-
surface5:
|
|
169
|
-
surface4:
|
|
170
|
-
surface3:
|
|
171
|
-
fgSurface4:
|
|
172
|
-
fgSurface3:
|
|
173
|
-
fgSurface2:
|
|
174
|
-
fgSurface1:
|
|
175
|
-
stroke3:
|
|
176
|
-
stroke4:
|
|
177
|
-
stroke2:
|
|
178
|
-
stroke1:
|
|
179
|
-
bgFillDark:
|
|
180
|
-
fgFillDark:
|
|
181
|
-
bgFillInverted2:
|
|
182
|
-
bgFillInverted1:
|
|
183
|
-
fgFillInverted:
|
|
184
|
-
surface1:
|
|
163
|
+
bgFill1: "#f0b849",
|
|
164
|
+
fgFill: "#1f1e1b",
|
|
165
|
+
bgFill2: "#dea633",
|
|
166
|
+
surface2: "#fdf7ee",
|
|
167
|
+
surface6: "#f1ce90",
|
|
168
|
+
surface5: "#f6e0bb",
|
|
169
|
+
surface4: "#f8e9cd",
|
|
170
|
+
surface3: "#fff",
|
|
171
|
+
fgSurface4: "#2f1800",
|
|
172
|
+
fgSurface3: "#976300",
|
|
173
|
+
fgSurface2: "#b78100",
|
|
174
|
+
fgSurface1: "#d9a22e",
|
|
175
|
+
stroke3: "#976300",
|
|
176
|
+
stroke4: "#754900",
|
|
177
|
+
stroke2: "#9f8860",
|
|
178
|
+
stroke1: "#c2a776",
|
|
179
|
+
bgFillDark: "#1f1e1b",
|
|
180
|
+
fgFillDark: "#f3f0e9",
|
|
181
|
+
bgFillInverted2: "#1f1e1b",
|
|
182
|
+
bgFillInverted1: "#432600",
|
|
183
|
+
fgFillInverted: "#f3f0e9",
|
|
184
|
+
surface1: "#faefdc"
|
|
185
185
|
},
|
|
186
186
|
direction: "darker"
|
|
187
187
|
},
|
|
188
188
|
error: {
|
|
189
189
|
ramp: {
|
|
190
|
-
bgFill1:
|
|
191
|
-
fgFill:
|
|
192
|
-
bgFill2:
|
|
193
|
-
surface2:
|
|
194
|
-
surface6:
|
|
195
|
-
surface5:
|
|
196
|
-
surface4:
|
|
197
|
-
surface3:
|
|
198
|
-
fgSurface4:
|
|
199
|
-
fgSurface3:
|
|
200
|
-
fgSurface2:
|
|
201
|
-
fgSurface1:
|
|
202
|
-
stroke3:
|
|
203
|
-
stroke4:
|
|
204
|
-
stroke2:
|
|
205
|
-
stroke1:
|
|
206
|
-
bgFillDark:
|
|
207
|
-
fgFillDark:
|
|
208
|
-
bgFillInverted2:
|
|
209
|
-
bgFillInverted1:
|
|
210
|
-
fgFillInverted:
|
|
211
|
-
surface1:
|
|
190
|
+
bgFill1: "#cc1818",
|
|
191
|
+
fgFill: "#f2efef",
|
|
192
|
+
bgFill2: "#bc0001",
|
|
193
|
+
surface2: "#fdf6f5",
|
|
194
|
+
surface6: "#f5c9c2",
|
|
195
|
+
surface5: "#f9dcd8",
|
|
196
|
+
surface4: "#fae5e2",
|
|
197
|
+
surface3: "#fff",
|
|
198
|
+
fgSurface4: "#4a0000",
|
|
199
|
+
fgSurface3: "#cc1818",
|
|
200
|
+
fgSurface2: "#f84d41",
|
|
201
|
+
fgSurface1: "#ff8373",
|
|
202
|
+
stroke3: "#cc1818",
|
|
203
|
+
stroke4: "#a70000",
|
|
204
|
+
stroke2: "#ca675c",
|
|
205
|
+
stroke1: "#dc8e83",
|
|
206
|
+
bgFillDark: "#231c1b",
|
|
207
|
+
fgFillDark: "#f2efef",
|
|
208
|
+
bgFillInverted2: "#231c1b",
|
|
209
|
+
bgFillInverted1: "#680000",
|
|
210
|
+
fgFillInverted: "#f2efef",
|
|
211
|
+
surface1: "#fcedea"
|
|
212
212
|
},
|
|
213
213
|
direction: "darker"
|
|
214
214
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/color-ramps/lib/default-ramps.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { RampResult } from './types';\nimport type { DEFAULT_SEED_COLORS } from './constants';\n\nexport const DEFAULT_RAMPS: Record<\n\tkeyof typeof DEFAULT_SEED_COLORS,\n\tRampResult\n> = {\n\tbg: {\n\t\tramp: {\n\t\t\tsurface2:
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,gBAGT;AAAA,EACH,IAAI;AAAA,IACH,MAAM;AAAA,MACL,UAAU
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { RampResult } from './types';\nimport type { DEFAULT_SEED_COLORS } from './constants';\n\nexport const DEFAULT_RAMPS: Record<\n\tkeyof typeof DEFAULT_SEED_COLORS,\n\tRampResult\n> = {\n\tbg: {\n\t\tramp: {\n\t\t\tsurface2: '#f8f8f8',\n\t\t\tbgFill1: '#555',\n\t\t\tfgFill: '#f0f0f0',\n\t\t\tbgFill2: '#494949',\n\t\t\tsurface6: '#d3d3d3',\n\t\t\tsurface5: '#e3e3e3',\n\t\t\tsurface4: '#eaeaea',\n\t\t\tsurface3: '#fff',\n\t\t\tfgSurface4: '#1e1e1e',\n\t\t\tfgSurface3: '#6e6e6e',\n\t\t\tfgSurface2: '#8b8b8b',\n\t\t\tfgSurface1: '#ababab',\n\t\t\tstroke3: '#8b8b8b',\n\t\t\tstroke4: '#6d6d6d',\n\t\t\tstroke2: '#adadad',\n\t\t\tstroke1: '#cfcfcf',\n\t\t\tbgFillDark: '#1e1e1e',\n\t\t\tfgFillDark: '#f0f0f0',\n\t\t\tbgFillInverted2: '#1e1e1e',\n\t\t\tbgFillInverted1: '#2d2d2d',\n\t\t\tfgFillInverted: '#f0f0f0',\n\t\t\tsurface1: '#f0f0f0',\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\tprimary: {\n\t\tramp: {\n\t\t\tbgFill1: '#3858e9',\n\t\t\tfgFill: '#eff0f2',\n\t\t\tbgFill2: '#2e49da',\n\t\t\tsurface2: '#f6f8fc',\n\t\t\tsurface6: '#c7d3ef',\n\t\t\tsurface5: '#dce3f5',\n\t\t\tsurface4: '#e5ebf7',\n\t\t\tsurface3: '#fff',\n\t\t\tfgSurface4: '#080071',\n\t\t\tfgSurface3: '#3858e9',\n\t\t\tfgSurface2: '#5881ff',\n\t\t\tfgSurface1: '#84a9ff',\n\t\t\tstroke3: '#3858e9',\n\t\t\tstroke4: '#2337c8',\n\t\t\tstroke2: '#6d83bf',\n\t\t\tstroke1: '#91a2cf',\n\t\t\tbgFillDark: '#1b1e26',\n\t\t\tfgFillDark: '#eff0f2',\n\t\t\tbgFillInverted2: '#1b1e26',\n\t\t\tbgFillInverted1: '#12009f',\n\t\t\tfgFillInverted: '#eff0f2',\n\t\t\tsurface1: '#edf0fa',\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\tinfo: {\n\t\tramp: {\n\t\t\tbgFill1: '#0090ff',\n\t\t\tfgFill: '#1b1e23',\n\t\t\tbgFill2: '#0081ef',\n\t\t\tsurface2: '#f5f9fd',\n\t\t\tsurface6: '#bed6f1',\n\t\t\tsurface5: '#d5e5f6',\n\t\t\tsurface4: '#e0ebf8',\n\t\t\tsurface3: '#fff',\n\t\t\tfgSurface4: '#001758',\n\t\t\tfgSurface3: '#006dd9',\n\t\t\tfgSurface2: '#008cfb',\n\t\t\tfgSurface1: '#53b1ff',\n\t\t\tstroke3: '#006dd9',\n\t\t\tstroke4: '#004eb8',\n\t\t\tstroke2: '#5d8fc6',\n\t\t\tstroke1: '#8aaed6',\n\t\t\tbgFillDark: '#1b1e23',\n\t\t\tfgFillDark: '#eff0f2',\n\t\t\tbgFillInverted2: '#1b1e23',\n\t\t\tbgFillInverted1: '#002675',\n\t\t\tfgFillInverted: '#eff0f2',\n\t\t\tsurface1: '#eaf1fa',\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\tsuccess: {\n\t\tramp: {\n\t\t\tbgFill1: '#4ab866',\n\t\t\tfgFill: '#1b1f1c',\n\t\t\tbgFill2: '#37a857',\n\t\t\tsurface2: '#f0fcf2',\n\t\t\tsurface6: '#7eea95',\n\t\t\tsurface5: '#b7f2c1',\n\t\t\tsurface4: '#cdf5d3',\n\t\t\tsurface3: '#fff',\n\t\t\tfgSurface4: '#002b00',\n\t\t\tfgSurface3: '#008031',\n\t\t\tfgSurface2: '#2c9f4e',\n\t\t\tfgSurface1: '#54c16f',\n\t\t\tstroke3: '#008031',\n\t\t\tstroke4: '#006314',\n\t\t\tstroke2: '#61986b',\n\t\t\tstroke1: '#77ba84',\n\t\t\tbgFillDark: '#1b1f1c',\n\t\t\tfgFillDark: '#edf2ed',\n\t\t\tbgFillInverted2: '#1b1f1c',\n\t\t\tbgFillInverted1: '#003800',\n\t\t\tfgFillInverted: '#edf2ed',\n\t\t\tsurface1: '#ddf8e1',\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\tcaution: {\n\t\tramp: {\n\t\t\tbgFill1: '#f0d149',\n\t\t\tfgFill: '#1f1e1b',\n\t\t\tbgFill2: '#ddbe30',\n\t\t\tsurface2: '#fdf9e7',\n\t\t\tsurface6: '#ecd367',\n\t\t\tsurface5: '#f5e399',\n\t\t\tsurface4: '#f8ebb5',\n\t\t\tsurface3: '#fff',\n\t\t\tfgSurface4: '#291d00',\n\t\t\tfgSurface3: '#876b00',\n\t\t\tfgSurface2: '#a78900',\n\t\t\tfgSurface1: '#c9aa00',\n\t\t\tstroke3: '#876b00',\n\t\t\tstroke4: '#675000',\n\t\t\tstroke2: '#978c60',\n\t\t\tstroke1: '#b8ab75',\n\t\t\tbgFillDark: '#1f1e1b',\n\t\t\tfgFillDark: '#f6f1da',\n\t\t\tbgFillInverted2: '#1f1e1b',\n\t\t\tbgFillInverted1: '#3a2b00',\n\t\t\tfgFillInverted: '#f6f1da',\n\t\t\tsurface1: '#faf1cd',\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\twarning: {\n\t\tramp: {\n\t\t\tbgFill1: '#f0b849',\n\t\t\tfgFill: '#1f1e1b',\n\t\t\tbgFill2: '#dea633',\n\t\t\tsurface2: '#fdf7ee',\n\t\t\tsurface6: '#f1ce90',\n\t\t\tsurface5: '#f6e0bb',\n\t\t\tsurface4: '#f8e9cd',\n\t\t\tsurface3: '#fff',\n\t\t\tfgSurface4: '#2f1800',\n\t\t\tfgSurface3: '#976300',\n\t\t\tfgSurface2: '#b78100',\n\t\t\tfgSurface1: '#d9a22e',\n\t\t\tstroke3: '#976300',\n\t\t\tstroke4: '#754900',\n\t\t\tstroke2: '#9f8860',\n\t\t\tstroke1: '#c2a776',\n\t\t\tbgFillDark: '#1f1e1b',\n\t\t\tfgFillDark: '#f3f0e9',\n\t\t\tbgFillInverted2: '#1f1e1b',\n\t\t\tbgFillInverted1: '#432600',\n\t\t\tfgFillInverted: '#f3f0e9',\n\t\t\tsurface1: '#faefdc',\n\t\t},\n\t\tdirection: 'darker',\n\t},\n\terror: {\n\t\tramp: {\n\t\t\tbgFill1: '#cc1818',\n\t\t\tfgFill: '#f2efef',\n\t\t\tbgFill2: '#bc0001',\n\t\t\tsurface2: '#fdf6f5',\n\t\t\tsurface6: '#f5c9c2',\n\t\t\tsurface5: '#f9dcd8',\n\t\t\tsurface4: '#fae5e2',\n\t\t\tsurface3: '#fff',\n\t\t\tfgSurface4: '#4a0000',\n\t\t\tfgSurface3: '#cc1818',\n\t\t\tfgSurface2: '#f84d41',\n\t\t\tfgSurface1: '#ff8373',\n\t\t\tstroke3: '#cc1818',\n\t\t\tstroke4: '#a70000',\n\t\t\tstroke2: '#ca675c',\n\t\t\tstroke1: '#dc8e83',\n\t\t\tbgFillDark: '#231c1b',\n\t\t\tfgFillDark: '#f2efef',\n\t\t\tbgFillInverted2: '#231c1b',\n\t\t\tbgFillInverted1: '#680000',\n\t\t\tfgFillInverted: '#f2efef',\n\t\t\tsurface1: '#fcedea',\n\t\t},\n\t\tdirection: 'darker',\n\t},\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAMO,IAAM,gBAGT;AAAA,EACH,IAAI;AAAA,IACH,MAAM;AAAA,MACL,UAAU;AAAA,MACV,SAAS;AAAA,MACT,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU;AAAA,MACV,UAAU;AAAA,MACV,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,SAAS;AAAA,MACT,SAAS;AAAA,MACT,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,EACZ;AAAA,EACA,SAAS;AAAA,IACR,MAAM;AAAA,MACL,SAAS;AAAA,MACT,QAAQ;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YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,SAAS;AAAA,MACT,SAAS;AAAA,MACT,SAAS;AAAA,MACT,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,iBAAiB;AAAA,MACjB,gBAAgB;AAAA,MAChB,UAAU;AAAA,IACX;AAAA,IACA,WAAW;AAAA,EACZ;AACD;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -37,6 +37,7 @@ function calculateRamp({
|
|
|
37
37
|
pinLightness
|
|
38
38
|
}) {
|
|
39
39
|
const rampResults = {};
|
|
40
|
+
let warnings;
|
|
40
41
|
let maxDeficit = -Infinity;
|
|
41
42
|
let maxDeficitDirection = "lighter";
|
|
42
43
|
let maxDeficitStep;
|
|
@@ -84,10 +85,7 @@ function calculateRamp({
|
|
|
84
85
|
const adjustedTarget2 = (0, import_utils.adjustContrastTarget)(contrast.target);
|
|
85
86
|
if (candidateContrast >= adjustedTarget2) {
|
|
86
87
|
calculatedColors.set(stepName, candidateColor);
|
|
87
|
-
rampResults[stepName] =
|
|
88
|
-
color: (0, import_color_utils.getColorString)(candidateColor),
|
|
89
|
-
warning: false
|
|
90
|
-
};
|
|
88
|
+
rampResults[stepName] = (0, import_color_utils.getColorString)(candidateColor);
|
|
91
89
|
continue;
|
|
92
90
|
}
|
|
93
91
|
}
|
|
@@ -124,13 +122,15 @@ function calculateRamp({
|
|
|
124
122
|
maxDeficitStep = stepName;
|
|
125
123
|
}
|
|
126
124
|
calculatedColors.set(stepName, searchResults.color);
|
|
127
|
-
rampResults[stepName] =
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
125
|
+
rampResults[stepName] = (0, import_color_utils.getColorString)(searchResults.color);
|
|
126
|
+
if (!searchResults.reached && !contrast.ignoreWhenAdjustingSeed) {
|
|
127
|
+
warnings ??= [];
|
|
128
|
+
warnings.push(stepName);
|
|
129
|
+
}
|
|
131
130
|
}
|
|
132
131
|
return {
|
|
133
132
|
rampResults,
|
|
133
|
+
warnings,
|
|
134
134
|
maxDeficit,
|
|
135
135
|
maxDeficitDirection,
|
|
136
136
|
maxDeficitStep
|
|
@@ -160,7 +160,13 @@ function buildRamp(seedArg, config, {
|
|
|
160
160
|
oppDir = worse;
|
|
161
161
|
}
|
|
162
162
|
const sortedSteps = (0, import_utils.sortByDependency)(config);
|
|
163
|
-
const {
|
|
163
|
+
const {
|
|
164
|
+
rampResults,
|
|
165
|
+
warnings,
|
|
166
|
+
maxDeficit,
|
|
167
|
+
maxDeficitDirection,
|
|
168
|
+
maxDeficitStep
|
|
169
|
+
} = calculateRamp({
|
|
164
170
|
seed,
|
|
165
171
|
sortedSteps,
|
|
166
172
|
config,
|
|
@@ -212,6 +218,7 @@ function buildRamp(seedArg, config, {
|
|
|
212
218
|
}
|
|
213
219
|
return {
|
|
214
220
|
ramp: bestRamp,
|
|
221
|
+
warnings,
|
|
215
222
|
direction: mainDir
|
|
216
223
|
};
|
|
217
224
|
}
|