@wordpress/theme 0.2.0 → 0.2.1-next.dc3f6d3c1.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.
Files changed (76) hide show
  1. package/README.md +5 -1
  2. package/bin/generate-primitive-tokens/index.ts +1 -1
  3. package/build/color-ramps/index.js +17 -13
  4. package/build/color-ramps/index.js.map +2 -2
  5. package/build/color-ramps/lib/color-utils.js +5 -0
  6. package/build/color-ramps/lib/color-utils.js.map +2 -2
  7. package/build/color-ramps/lib/constants.js +1 -1
  8. package/build/color-ramps/lib/constants.js.map +1 -1
  9. package/build/color-ramps/lib/default-ramps.js +154 -154
  10. package/build/color-ramps/lib/default-ramps.js.map +2 -2
  11. package/build/color-ramps/lib/find-color-with-constraints.js +1 -1
  12. package/build/color-ramps/lib/find-color-with-constraints.js.map +2 -2
  13. package/build/color-ramps/lib/index.js +18 -11
  14. package/build/color-ramps/lib/index.js.map +2 -2
  15. package/build/color-ramps/lib/ramp-configs.js +2 -2
  16. package/build/color-ramps/lib/ramp-configs.js.map +1 -1
  17. package/build/color-ramps/lib/types.js.map +1 -1
  18. package/build/color-ramps/lib/utils.js +4 -8
  19. package/build/color-ramps/lib/utils.js.map +2 -2
  20. package/build/prebuilt/json/figma.json +51 -51
  21. package/build/use-theme-provider-styles.js +1 -4
  22. package/build/use-theme-provider-styles.js.map +2 -2
  23. package/build-module/color-ramps/index.js +18 -14
  24. package/build-module/color-ramps/index.js.map +2 -2
  25. package/build-module/color-ramps/lib/color-utils.js +7 -1
  26. package/build-module/color-ramps/lib/color-utils.js.map +2 -2
  27. package/build-module/color-ramps/lib/constants.js +1 -1
  28. package/build-module/color-ramps/lib/constants.js.map +1 -1
  29. package/build-module/color-ramps/lib/default-ramps.js +154 -154
  30. package/build-module/color-ramps/lib/default-ramps.js.map +2 -2
  31. package/build-module/color-ramps/lib/find-color-with-constraints.js +2 -2
  32. package/build-module/color-ramps/lib/find-color-with-constraints.js.map +2 -2
  33. package/build-module/color-ramps/lib/index.js +17 -11
  34. package/build-module/color-ramps/lib/index.js.map +2 -2
  35. package/build-module/color-ramps/lib/ramp-configs.js +2 -2
  36. package/build-module/color-ramps/lib/ramp-configs.js.map +1 -1
  37. package/build-module/color-ramps/lib/utils.js +0 -3
  38. package/build-module/color-ramps/lib/utils.js.map +2 -2
  39. package/build-module/prebuilt/json/figma.json +51 -51
  40. package/build-module/use-theme-provider-styles.js +1 -4
  41. package/build-module/use-theme-provider-styles.js.map +2 -2
  42. package/build-types/color-ramps/index.d.ts +1 -0
  43. package/build-types/color-ramps/index.d.ts.map +1 -1
  44. package/build-types/color-ramps/lib/color-utils.d.ts +5 -0
  45. package/build-types/color-ramps/lib/color-utils.d.ts.map +1 -1
  46. package/build-types/color-ramps/lib/constants.d.ts +1 -1
  47. package/build-types/color-ramps/lib/constants.d.ts.map +1 -1
  48. package/build-types/color-ramps/lib/index.d.ts.map +1 -1
  49. package/build-types/color-ramps/lib/types.d.ts +2 -4
  50. package/build-types/color-ramps/lib/types.d.ts.map +1 -1
  51. package/build-types/color-ramps/lib/utils.d.ts +0 -5
  52. package/build-types/color-ramps/lib/utils.d.ts.map +1 -1
  53. package/build-types/color-ramps/stories/index.story.d.ts.map +1 -1
  54. package/build-types/color-ramps/stories/ramp-table.d.ts +2 -4
  55. package/build-types/color-ramps/stories/ramp-table.d.ts.map +1 -1
  56. package/build-types/use-theme-provider-styles.d.ts.map +1 -1
  57. package/package.json +4 -4
  58. package/src/color-ramps/index.ts +17 -12
  59. package/src/color-ramps/lib/color-utils.ts +11 -0
  60. package/src/color-ramps/lib/constants.ts +3 -3
  61. package/src/color-ramps/lib/default-ramps.ts +154 -154
  62. package/src/color-ramps/lib/find-color-with-constraints.ts +2 -2
  63. package/src/color-ramps/lib/index.ts +27 -24
  64. package/src/color-ramps/lib/ramp-configs.ts +2 -2
  65. package/src/color-ramps/lib/types.ts +2 -7
  66. package/src/color-ramps/lib/utils.ts +1 -8
  67. package/src/color-ramps/stories/index.story.tsx +11 -5
  68. package/src/color-ramps/stories/ramp-table.tsx +15 -26
  69. package/src/color-ramps/test/__snapshots__/index.test.ts.snap +11717 -41231
  70. package/src/color-ramps/test/index.test.ts +2 -2
  71. package/src/prebuilt/css/design-tokens.css +51 -51
  72. package/src/prebuilt/json/figma.json +51 -51
  73. package/src/use-theme-provider-styles.ts +1 -4
  74. package/tokens/color.json +88 -88
  75. package/tsconfig.bin.tsbuildinfo +1 -1
  76. package/tsconfig.src.tsbuildinfo +1 -1
package/README.md CHANGED
@@ -1,4 +1,8 @@
1
- # (Experimental) Theme
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.color ),
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].color), [import_fn.OKLCH, "l"]),
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,15 +68,17 @@ 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].color);
72
- const fgColor = (0, import_fn.parse)(ramp.ramp[fg].color);
73
- if ((0, import_color_utils.getContrast)(bgColor, fgColor) < target) {
71
+ const bgColor = ramp.ramp[bg];
72
+ const fgColor = ramp.ramp[fg];
73
+ const achievedContrast = (0, import_color_utils.getContrast)(bgColor, fgColor);
74
+ if (achievedContrast < target) {
74
75
  unmetTargets.push({
75
76
  bgName: bg,
76
- bgColor: (0, import_fn.serialize)(bgColor),
77
+ bgColor,
77
78
  fgName: fg,
78
- fgColor: (0, import_fn.serialize)(fgColor),
79
- unmetContrast: target
79
+ fgColor,
80
+ unmetContrast: target,
81
+ achievedContrast
80
82
  });
81
83
  }
82
84
  }
@@ -87,15 +89,17 @@ function checkAccessibleCombinations({
87
89
  import_constants.CONTRAST_COMBINATIONS.forEach(({ bgs, fgs, target }) => {
88
90
  for (const bg of bgs) {
89
91
  for (const fg of fgs) {
90
- const bgColor = (0, import_fn.parse)(bgRamp.ramp[bg].color);
91
- const fgColor = (0, import_fn.parse)(ramp.ramp[fg].color);
92
- if ((0, import_color_utils.getContrast)(bgColor, fgColor) < target) {
92
+ const bgColor = bgRamp.ramp[bg];
93
+ const fgColor = ramp.ramp[fg];
94
+ const achievedContrast = (0, import_color_utils.getContrast)(bgColor, fgColor);
95
+ if (achievedContrast < target) {
93
96
  unmetTargets.push({
94
97
  bgName: bg,
95
- bgColor: (0, import_fn.serialize)(bgColor),
98
+ bgColor,
96
99
  fgName: fg,
97
- fgColor: (0, import_fn.serialize)(fgColor),
98
- unmetContrast: target
100
+ fgColor,
101
+ unmetContrast: target,
102
+ achievedContrast
99
103
  });
100
104
  }
101
105
  }
@@ -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 ].color ), [ 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 ].color );\n\t\t\t\t\tconst fgColor = parse( ramp.ramp[ fg ].color );\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 ].color );\n\t\t\t\t\tconst fgColor = parse( ramp.ramp[ fg ].color );\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
- "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,EAAE,KAAM,GAAG,CAAE,iBAAO,GAAI,CAAE;AAAA,QAC7D,KAAK;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;AAQO,SAAS,gBACf,MACA,QACqB;AACrB,MAAK,OAAO,SAAS,YAAY,KAAK,KAAK,MAAM,IAAK;AACrD,UAAM,IAAI,MAAO,uCAAwC;AAAA,EAC1D;AAEA,QAAM,aAAa,SAAS,cAAe,MAAO,IAAI;AACtD,aAAO,sBAAW,MAAM,wCAAoB,UAAW;AACxD;AASO,SAAS,4BAA6B;AAAA,EAC5C;AAAA,EACA,cAAc,CAAC;AAChB,GAGI;AACH,QAAM,eAMA,CAAC;AAGP,GAAE,QAAQ,GAAG,WAAY,EAAE,QAAS,CAAE,SAAU;AAC/C,2CAAsB,QAAS,CAAE,EAAE,KAAK,KAAK,OAAO,MAAO;AAC1D,iBAAY,MAAM,KAAM;AACvB,mBAAY,MAAM,KAAM;AACvB,gBAAM,cAAU,iBAAO,KAAK,KAAM,EAAG,EAAE,KAAM;AAC7C,gBAAM,cAAU,iBAAO,KAAK,KAAM,EAAG,EAAE,KAAM;AAC7C,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,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,EAAE,KAAM;AAC/C,gBAAM,cAAU,iBAAO,KAAK,KAAM,EAAG,EAAE,KAAM;AAC7C,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;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport { get, OKLCH, parse } 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\tachievedContrast: 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 = ramp.ramp[ bg ];\n\t\t\t\t\tconst fgColor = ramp.ramp[ fg ];\n\t\t\t\t\tconst achievedContrast = getContrast( bgColor, fgColor );\n\t\t\t\t\tif ( achievedContrast < 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,\n\t\t\t\t\t\t\tfgName: fg,\n\t\t\t\t\t\t\tfgColor,\n\t\t\t\t\t\t\tunmetContrast: target,\n\t\t\t\t\t\t\tachievedContrast,\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 = bgRamp.ramp[ bg ];\n\t\t\t\t\tconst fgColor = ramp.ramp[ fg ];\n\t\t\t\t\tconst achievedContrast = getContrast( bgColor, fgColor );\n\t\t\t\t\tif ( achievedContrast < 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,\n\t\t\t\t\t\t\tfgName: fg,\n\t\t\t\t\t\t\tfgColor,\n\t\t\t\t\t\t\tunmetContrast: target,\n\t\t\t\t\t\t\tachievedContrast,\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
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAAkC;AAKlC,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,CAAE,GAAG,CAAE,iBAAO,GAAI,CAAE;AAAA,QACvD,KAAK;AAAA,MACN;AAAA,IACD;AAAA,EACD;AACD;AAQO,SAAS,gBACf,MACA,QACqB;AACrB,MAAK,OAAO,SAAS,YAAY,KAAK,KAAK,MAAM,IAAK;AACrD,UAAM,IAAI,MAAO,uCAAwC;AAAA,EAC1D;AAEA,QAAM,aAAa,SAAS,cAAe,MAAO,IAAI;AACtD,aAAO,sBAAW,MAAM,wCAAoB,UAAW;AACxD;AASO,SAAS,4BAA6B;AAAA,EAC5C;AAAA,EACA,cAAc,CAAC;AAChB,GAGI;AACH,QAAM,eAOA,CAAC;AAGP,GAAE,QAAQ,GAAG,WAAY,EAAE,QAAS,CAAE,SAAU;AAC/C,2CAAsB,QAAS,CAAE,EAAE,KAAK,KAAK,OAAO,MAAO;AAC1D,iBAAY,MAAM,KAAM;AACvB,mBAAY,MAAM,KAAM;AACvB,gBAAM,UAAU,KAAK,KAAM,EAAG;AAC9B,gBAAM,UAAU,KAAK,KAAM,EAAG;AAC9B,gBAAM,uBAAmB,gCAAa,SAAS,OAAQ;AACvD,cAAK,mBAAmB,QAAS;AAChC,yBAAa,KAAM;AAAA,cAClB,QAAQ;AAAA,cACR;AAAA,cACA,QAAQ;AAAA,cACR;AAAA,cACA,eAAe;AAAA,cACf;AAAA,YACD,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,UAAU,OAAO,KAAM,EAAG;AAChC,gBAAM,UAAU,KAAK,KAAM,EAAG;AAC9B,gBAAM,uBAAmB,gCAAa,SAAS,OAAQ;AACvD,cAAK,mBAAmB,QAAS;AAChC,yBAAa,KAAM;AAAA,cAClB,QAAQ;AAAA,cACR;AAAA,cACA,QAAQ;AAAA,cACR;AAAA,cACA,eAAe;AAAA,cACf;AAAA,YACD,CAAE;AAAA,UACH;AAAA,QACD;AAAA,MACD;AAAA,IACD,CAAE;AAAA,EACH,CAAE;AAEF,SAAO;AACR;",
6
6
  "names": ["import_constants"]
7
7
  }
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  // packages/theme/src/color-ramps/lib/color-utils.ts
20
20
  var color_utils_exports = {};
21
21
  __export(color_utils_exports, {
22
+ clampToGamut: () => clampToGamut,
22
23
  getColorString: () => getColorString,
23
24
  getContrast: () => getContrast
24
25
  });
@@ -31,8 +32,12 @@ function getColorString(color) {
31
32
  function getContrast(colorA, colorB) {
32
33
  return (0, import_fn.contrastWCAG21)(colorA, colorB);
33
34
  }
35
+ function clampToGamut(c) {
36
+ return (0, import_fn.to)((0, import_fn.toGamut)(c, { space: import_fn.sRGB, method: "css" }), import_fn.OKLCH);
37
+ }
34
38
  // Annotate the CommonJS export names for ESM import in node:
35
39
  0 && (module.exports = {
40
+ clampToGamut,
36
41
  getColorString,
37
42
  getContrast
38
43
  });
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/color-ramps/lib/color-utils.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport {\n\tto,\n\tserialize,\n\tcontrastWCAG21,\n\tsRGB,\n\ttype ColorTypes,\n} from 'colorjs.io/fn';\n\n/**\n * Internal dependencies\n */\nimport './register-color-spaces';\n\n/**\n * Get string representation of a color\n * @param color Color object to stringify\n * @return String representation\n */\nexport function getColorString( color: ColorTypes ): string {\n\treturn serialize( to( color, sRGB ), { format: 'hex', inGamut: true } );\n}\n\n/**\n * Get contrast value between two colors\n * @param colorA First color\n * @param colorB Second color\n * @return WCAG 2.1 contrast ratio\n */\nexport function getContrast( colorA: ColorTypes, colorB: ColorTypes ): number {\n\treturn contrastWCAG21( colorA, colorB );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAMO;AAKP,mCAAO;AAOA,SAAS,eAAgB,OAA4B;AAC3D,aAAO,yBAAW,cAAI,OAAO,cAAK,GAAG,EAAE,QAAQ,OAAO,SAAS,KAAK,CAAE;AACvE;AAQO,SAAS,YAAa,QAAoB,QAA6B;AAC7E,aAAO,0BAAgB,QAAQ,MAAO;AACvC;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport {\n\tto,\n\ttoGamut,\n\tserialize,\n\tcontrastWCAG21,\n\tsRGB,\n\tOKLCH,\n\ttype ColorTypes,\n} from 'colorjs.io/fn';\n\n/**\n * Internal dependencies\n */\nimport './register-color-spaces';\n\n/**\n * Get string representation of a color\n * @param color Color object to stringify\n * @return String representation\n */\nexport function getColorString( color: ColorTypes ): string {\n\treturn serialize( to( color, sRGB ), { format: 'hex', inGamut: true } );\n}\n\n/**\n * Get contrast value between two colors\n * @param colorA First color\n * @param colorB Second color\n * @return WCAG 2.1 contrast ratio\n */\nexport function getContrast( colorA: ColorTypes, colorB: ColorTypes ): number {\n\treturn contrastWCAG21( colorA, colorB );\n}\n\n/**\n * Make sure that a color is valid in the sRGB gamut and convert it to OKLCH.\n * @param c\n */\nexport function clampToGamut( c: ColorTypes ) {\n\t// map into sRGB using CSS OKLCH method\n\treturn to( toGamut( c, { space: sRGB, method: 'css' } ), OKLCH );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAQO;AAKP,mCAAO;AAOA,SAAS,eAAgB,OAA4B;AAC3D,aAAO,yBAAW,cAAI,OAAO,cAAK,GAAG,EAAE,QAAQ,OAAO,SAAS,KAAK,CAAE;AACvE;AAQO,SAAS,YAAa,QAAoB,QAA6B;AAC7E,aAAO,0BAAgB,QAAQ,MAAO;AACvC;AAMO,SAAS,aAAc,GAAgB;AAE7C,aAAO,kBAAI,mBAAS,GAAG,EAAE,OAAO,gBAAM,QAAQ,MAAM,CAAE,GAAG,eAAM;AAChE;",
6
6
  "names": []
7
7
  }
@@ -34,7 +34,7 @@ var import_fn = require("colorjs.io/fn");
34
34
  var import_register_color_spaces = require("./register-color-spaces");
35
35
  var WHITE = (0, import_fn.to)("white", import_fn.OKLCH);
36
36
  var BLACK = (0, import_fn.to)("black", import_fn.OKLCH);
37
- var UNIVERSAL_CONTRAST_TOPUP = 0.012;
37
+ var UNIVERSAL_CONTRAST_TOPUP = 0.02;
38
38
  var WHITE_TEXT_CONTRAST_MARGIN = 3.1;
39
39
  var ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS = {
40
40
  lighter: { min: 0.2, max: 0.4 },
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/color-ramps/lib/constants.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { to, OKLCH } from 'colorjs.io/fn';\n\n/**\n * Internal dependencies\n */\nimport './register-color-spaces';\nimport type { Ramp } from './types';\n\nexport const WHITE = to( 'white', OKLCH );\nexport const BLACK = to( 'black', OKLCH );\n\n// Margin added to target contrasts to counter for algorithm approximations and rounding errors.\n// - the `CONTRAST_EPSILON` value is 0.004, so the real contrast can be lower by this amount.\n// - the max contrast between adjacent RGB values is 1.016, so half of the difference (0.008) can be rounding error.\n// - the sum is 0.012: the margin we add to ensure that the target contrast is met after all the rounding.\nexport const UNIVERSAL_CONTRAST_TOPUP = 0.012;\n\n// When enabling \"lighter direction\" bias, this is the amount by which\n// black text contrast needs to be greater than white text contrast.\n// The higher the value, the stronger the preference for white text.\n// The current value has been determined empirically as the highest value\n// that won't cause the algo not to be able to correctly solve all contrasts.\nexport const WHITE_TEXT_CONTRAST_MARGIN = 3.1;\n\n// These values are used as thresholds when trying to match the background\n// ramp's lightness while calculating an accent ramp. They prevent the accent\n// scale from being pinned to lightness values in the middle of the range,\n// which would cause the algorithm to struggle to satisfy the accent scale\n// constraints and therefore produce unexpected results.\nexport const ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS = {\n\tlighter: { min: 0.2, max: 0.4 },\n\tdarker: { min: 0.75, max: 0.98 },\n} as const;\n\n// Contrast precision we aim for. Approximately 1/256, resolution of an 8-bit number.\nexport const CONTRAST_EPSILON = 4e-3;\n\nexport const MAX_BISECTION_ITERATIONS = 10;\n\nexport const CONTRAST_COMBINATIONS: {\n\tbgs: ( keyof Ramp )[];\n\tfgs: ( keyof Ramp )[];\n\ttarget: number;\n}[] = [\n\t{\n\t\tbgs: [ 'surface1', 'surface2', 'surface3' ],\n\t\tfgs: [ 'fgSurface3', 'fgSurface4' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'surface4', 'surface5' ],\n\t\tfgs: [ 'fgSurface4' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFill1' ],\n\t\tfgs: [ 'fgFill' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFillInverted1' ],\n\t\tfgs: [ 'fgFillInverted' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFillInverted1' ],\n\t\tfgs: [ 'fgFillInverted' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'surface1', 'surface2', 'surface3' ],\n\t\tfgs: [ 'stroke3' ],\n\t\ttarget: 3,\n\t},\n];\n\n// Used when generating the DTCG tokens and the static color ramps.\nexport const DEFAULT_SEED_COLORS = {\n\tbg: '#f8f8f8',\n\tprimary: '#3858e9',\n\tinfo: '#0090ff',\n\tsuccess: '#4ab866',\n\tcaution: '#f0d149',\n\twarning: '#f0b849',\n\terror: '#cc1818',\n};\n"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport { to, OKLCH } from 'colorjs.io/fn';\n\n/**\n * Internal dependencies\n */\nimport './register-color-spaces';\nimport type { Ramp } from './types';\n\nexport const WHITE = to( 'white', OKLCH );\nexport const BLACK = to( 'black', OKLCH );\n\n// Margin added to target contrasts to counter for algorithm approximations and rounding errors.\n// - the `CONTRAST_EPSILON` value is 0.004, so the real contrast can be lower by this amount.\n// - the max contrast between adjacent RGB values is 1.016, so 0.016 is the maximum total rounding error between two values.\n// - the sum is 0.02: the margin we add to ensure that the target contrast is met after all the rounding.\nexport const UNIVERSAL_CONTRAST_TOPUP = 0.02;\n\n// When enabling \"lighter direction\" bias, this is the amount by which\n// black text contrast needs to be greater than white text contrast.\n// The higher the value, the stronger the preference for white text.\n// The current value has been determined empirically as the highest value\n// that won't cause the algo not to be able to correctly solve all contrasts.\nexport const WHITE_TEXT_CONTRAST_MARGIN = 3.1;\n\n// These values are used as thresholds when trying to match the background\n// ramp's lightness while calculating an accent ramp. They prevent the accent\n// scale from being pinned to lightness values in the middle of the range,\n// which would cause the algorithm to struggle to satisfy the accent scale\n// constraints and therefore produce unexpected results.\nexport const ACCENT_SCALE_BASE_LIGHTNESS_THRESHOLDS = {\n\tlighter: { min: 0.2, max: 0.4 },\n\tdarker: { min: 0.75, max: 0.98 },\n} as const;\n\n// Contrast precision we aim for. Approximately 1/256, resolution of an 8-bit number.\nexport const CONTRAST_EPSILON = 4e-3;\n\nexport const MAX_BISECTION_ITERATIONS = 10;\n\nexport const CONTRAST_COMBINATIONS: {\n\tbgs: ( keyof Ramp )[];\n\tfgs: ( keyof Ramp )[];\n\ttarget: number;\n}[] = [\n\t{\n\t\tbgs: [ 'surface1', 'surface2', 'surface3' ],\n\t\tfgs: [ 'fgSurface3', 'fgSurface4' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'surface4', 'surface5' ],\n\t\tfgs: [ 'fgSurface4' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFill1' ],\n\t\tfgs: [ 'fgFill' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFillInverted1' ],\n\t\tfgs: [ 'fgFillInverted' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'bgFillInverted1' ],\n\t\tfgs: [ 'fgFillInverted' ],\n\t\ttarget: 4.5,\n\t},\n\t{\n\t\tbgs: [ 'surface1', 'surface2', 'surface3' ],\n\t\tfgs: [ 'stroke3' ],\n\t\ttarget: 3,\n\t},\n];\n\n// Used when generating the DTCG tokens and the static color ramps.\nexport const DEFAULT_SEED_COLORS = {\n\tbg: '#f8f8f8',\n\tprimary: '#3858e9',\n\tinfo: '#0090ff',\n\tsuccess: '#4ab866',\n\tcaution: '#f0d149',\n\twarning: '#f0b849',\n\terror: '#cc1818',\n};\n"],
5
5
  "mappings": ";;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,gBAA0B;AAK1B,mCAAO;AAGA,IAAM,YAAQ,cAAI,SAAS,eAAM;AACjC,IAAM,YAAQ,cAAI,SAAS,eAAM;AAMjC,IAAM,2BAA2B;AAOjC,IAAM,6BAA6B;AAOnC,IAAM,yCAAyC;AAAA,EACrD,SAAS,EAAE,KAAK,KAAK,KAAK,IAAI;AAAA,EAC9B,QAAQ,EAAE,KAAK,MAAM,KAAK,KAAK;AAChC;AAGO,IAAM,mBAAmB;AAEzB,IAAM,2BAA2B;AAEjC,IAAM,wBAIP;AAAA,EACL;AAAA,IACC,KAAK,CAAE,YAAY,YAAY,UAAW;AAAA,IAC1C,KAAK,CAAE,cAAc,YAAa;AAAA,IAClC,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,YAAY,UAAW;AAAA,IAC9B,KAAK,CAAE,YAAa;AAAA,IACpB,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,SAAU;AAAA,IACjB,KAAK,CAAE,QAAS;AAAA,IAChB,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,iBAAkB;AAAA,IACzB,KAAK,CAAE,gBAAiB;AAAA,IACxB,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,iBAAkB;AAAA,IACzB,KAAK,CAAE,gBAAiB;AAAA,IACxB,QAAQ;AAAA,EACT;AAAA,EACA;AAAA,IACC,KAAK,CAAE,YAAY,YAAY,UAAW;AAAA,IAC1C,KAAK,CAAE,SAAU;AAAA,IACjB,QAAQ;AAAA,EACT;AACD;AAGO,IAAM,sBAAsB;AAAA,EAClC,IAAI;AAAA,EACJ,SAAS;AAAA,EACT,MAAM;AAAA,EACN,SAAS;AAAA,EACT,SAAS;AAAA,EACT,SAAS;AAAA,EACT,OAAO;AACR;",
6
6
  "names": []
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: { color: "#f8f8f8", warning: false },
29
- bgFill1: { color: "#555", warning: false },
30
- fgFill: { color: "#f0f0f0", warning: false },
31
- bgFill2: { color: "#494949", warning: false },
32
- surface6: { color: "#d3d3d3", warning: false },
33
- surface5: { color: "#e3e3e3", warning: false },
34
- surface4: { color: "#eaeaea", warning: false },
35
- surface3: { color: "#fff", warning: false },
36
- fgSurface4: { color: "#1e1e1e", warning: false },
37
- fgSurface3: { color: "#6e6e6e", warning: false },
38
- fgSurface2: { color: "#8b8b8b", warning: false },
39
- fgSurface1: { color: "#ababab", warning: false },
40
- stroke3: { color: "#8b8b8b", warning: false },
41
- stroke4: { color: "#6d6d6d", warning: false },
42
- stroke2: { color: "#adadad", warning: false },
43
- stroke1: { color: "#cfcfcf", warning: false },
44
- bgFillDark: { color: "#1e1e1e", warning: false },
45
- fgFillDark: { color: "#f0f0f0", warning: false },
46
- bgFillInverted2: { color: "#1e1e1e", warning: false },
47
- bgFillInverted1: { color: "#2d2d2d", warning: false },
48
- fgFillInverted: { color: "#f0f0f0", warning: false },
49
- surface1: { color: "#f0f0f0", warning: false }
28
+ surface2: "#f8f8f8",
29
+ bgFill1: "#555",
30
+ fgFill: "#f0f0f0",
31
+ bgFill2: "#484848",
32
+ surface6: "#d2d2d2",
33
+ surface5: "#e2e2e2",
34
+ surface4: "#eaeaea",
35
+ surface3: "#fff",
36
+ fgSurface4: "#1e1e1e",
37
+ fgSurface3: "#6d6d6d",
38
+ fgSurface2: "#8a8a8a",
39
+ fgSurface1: "#aaa",
40
+ stroke3: "#8a8a8a",
41
+ stroke4: "#6c6c6c",
42
+ stroke2: "#d8d8d8",
43
+ stroke1: "#e0e0e0",
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: { color: "#3858e9", warning: false },
56
- fgFill: { color: "#eff0f2", warning: false },
57
- bgFill2: { color: "#2e49da", warning: false },
58
- surface2: { color: "#f6f8fc", warning: false },
59
- surface6: { color: "#c7d3ef", warning: false },
60
- surface5: { color: "#dce3f5", warning: false },
61
- surface4: { color: "#e5ebf7", warning: false },
62
- surface3: { color: "#fff", warning: false },
63
- fgSurface4: { color: "#080071", warning: false },
64
- fgSurface3: { color: "#3858e9", warning: false },
65
- fgSurface2: { color: "#5881ff", warning: false },
66
- fgSurface1: { color: "#84a9ff", warning: false },
67
- stroke3: { color: "#3858e9", warning: false },
68
- stroke4: { color: "#2337c8", warning: false },
69
- stroke2: { color: "#6d83bf", warning: false },
70
- stroke1: { color: "#91a2cf", warning: false },
71
- bgFillDark: { color: "#1b1e26", warning: false },
72
- fgFillDark: { color: "#eff0f2", warning: false },
73
- bgFillInverted2: { color: "#1b1e26", warning: false },
74
- bgFillInverted1: { color: "#12009f", warning: false },
75
- fgFillInverted: { color: "#eff0f2", warning: false },
76
- surface1: { color: "#edf0fa", warning: false }
55
+ bgFill1: "#3858e9",
56
+ fgFill: "#eff0f2",
57
+ bgFill2: "#2e49d9",
58
+ surface2: "#f6f8fc",
59
+ surface6: "#c7d2ee",
60
+ surface5: "#dbe2f4",
61
+ surface4: "#e4eaf7",
62
+ surface3: "#fff",
63
+ fgSurface4: "#0b0070",
64
+ fgSurface3: "#3858e9",
65
+ fgSurface2: "#5b82ff",
66
+ fgSurface1: "#85a9ff",
67
+ stroke3: "#3858e9",
68
+ stroke4: "#2337c8",
69
+ stroke2: "#9aaad3",
70
+ stroke1: "#a2b1d6",
71
+ bgFillDark: "#1b1e26",
72
+ fgFillDark: "#eff0f2",
73
+ bgFillInverted2: "#1b1e26",
74
+ bgFillInverted1: "#13009f",
75
+ fgFillInverted: "#eff0f2",
76
+ surface1: "#ecf0f9"
77
77
  },
78
78
  direction: "darker"
79
79
  },
80
80
  info: {
81
81
  ramp: {
82
- bgFill1: { color: "#0090ff", warning: false },
83
- fgFill: { color: "#1b1e23", warning: false },
84
- bgFill2: { color: "#0081ef", warning: false },
85
- surface2: { color: "#f5f9fd", warning: false },
86
- surface6: { color: "#bed6f1", warning: false },
87
- surface5: { color: "#d5e5f6", warning: false },
88
- surface4: { color: "#e0ebf8", warning: false },
89
- surface3: { color: "#fff", warning: false },
90
- fgSurface4: { color: "#001758", warning: false },
91
- fgSurface3: { color: "#006dd9", warning: false },
92
- fgSurface2: { color: "#008cfb", warning: false },
93
- fgSurface1: { color: "#53b1ff", warning: false },
94
- stroke3: { color: "#006dd9", warning: false },
95
- stroke4: { color: "#004eb8", warning: false },
96
- stroke2: { color: "#5d8fc6", warning: false },
97
- stroke1: { color: "#8aaed6", warning: false },
98
- bgFillDark: { color: "#1b1e23", warning: false },
99
- fgFillDark: { color: "#eff0f2", warning: false },
100
- bgFillInverted2: { color: "#1b1e23", warning: false },
101
- bgFillInverted1: { color: "#002675", warning: false },
102
- fgFillInverted: { color: "#eff0f2", warning: false },
103
- surface1: { color: "#eaf1fa", warning: false }
82
+ bgFill1: "#0090ff",
83
+ fgFill: "#1b1e23",
84
+ bgFill2: "#007fed",
85
+ surface2: "#f5f9fd",
86
+ surface6: "#bdd5f1",
87
+ surface5: "#d4e4f6",
88
+ surface4: "#dfebf8",
89
+ surface3: "#fff",
90
+ fgSurface4: "#001b4f",
91
+ fgSurface3: "#006bd7",
92
+ fgSurface2: "#008bfa",
93
+ fgSurface1: "#59b0ff",
94
+ stroke3: "#006bd7",
95
+ stroke4: "#004fa9",
96
+ stroke2: "#94b5d9",
97
+ stroke1: "#9fbcdd",
98
+ bgFillDark: "#1b1e23",
99
+ fgFillDark: "#eff0f2",
100
+ bgFillInverted2: "#1b1e23",
101
+ bgFillInverted1: "#002a69",
102
+ fgFillInverted: "#eff0f2",
103
+ surface1: "#e9f1fa"
104
104
  },
105
105
  direction: "darker"
106
106
  },
107
107
  success: {
108
108
  ramp: {
109
- bgFill1: { color: "#4ab866", warning: false },
110
- fgFill: { color: "#1b1f1c", warning: false },
111
- bgFill2: { color: "#37a857", warning: false },
112
- surface2: { color: "#f0fcf2", warning: false },
113
- surface6: { color: "#7eea95", warning: false },
114
- surface5: { color: "#b7f2c1", warning: false },
115
- surface4: { color: "#cdf5d3", warning: false },
116
- surface3: { color: "#fff", warning: false },
117
- fgSurface4: { color: "#002b00", warning: false },
118
- fgSurface3: { color: "#008031", warning: false },
119
- fgSurface2: { color: "#2c9f4e", warning: false },
120
- fgSurface1: { color: "#54c16f", warning: false },
121
- stroke3: { color: "#008031", warning: false },
122
- stroke4: { color: "#006314", warning: false },
123
- stroke2: { color: "#61986b", warning: false },
124
- stroke1: { color: "#77ba84", warning: false },
125
- bgFillDark: { color: "#1b1f1c", warning: false },
126
- fgFillDark: { color: "#edf2ed", warning: false },
127
- bgFillInverted2: { color: "#1b1f1c", warning: false },
128
- bgFillInverted1: { color: "#003800", warning: false },
129
- fgFillInverted: { color: "#edf2ed", warning: false },
130
- surface1: { color: "#ddf8e1", warning: false }
109
+ bgFill1: "#4ab866",
110
+ fgFill: "#1b1f1c",
111
+ bgFill2: "#37a756",
112
+ surface2: "#f0fcf2",
113
+ surface6: "#7eea95",
114
+ surface5: "#b5f1bf",
115
+ surface4: "#cbf5d1",
116
+ surface3: "#fff",
117
+ fgSurface4: "#002900",
118
+ fgSurface3: "#007f30",
119
+ fgSurface2: "#2b9e4e",
120
+ fgSurface1: "#53c06e",
121
+ stroke3: "#007f30",
122
+ stroke4: "#006013",
123
+ stroke2: "#7dc189",
124
+ stroke1: "#82c98f",
125
+ bgFillDark: "#1b1f1c",
126
+ fgFillDark: "#edf2ed",
127
+ bgFillInverted2: "#1b1f1c",
128
+ bgFillInverted1: "#003701",
129
+ fgFillInverted: "#edf2ed",
130
+ surface1: "#dbf8df"
131
131
  },
132
132
  direction: "darker"
133
133
  },
134
134
  caution: {
135
135
  ramp: {
136
- bgFill1: { color: "#f0d149", warning: false },
137
- fgFill: { color: "#1f1e1b", warning: false },
138
- bgFill2: { color: "#ddbe30", warning: false },
139
- surface2: { color: "#fdf9e7", warning: false },
140
- surface6: { color: "#ecd367", warning: false },
141
- surface5: { color: "#f5e399", warning: false },
142
- surface4: { color: "#f8ebb5", warning: false },
143
- surface3: { color: "#fff", warning: false },
144
- fgSurface4: { color: "#291d00", warning: false },
145
- fgSurface3: { color: "#876b00", warning: false },
146
- fgSurface2: { color: "#a78900", warning: false },
147
- fgSurface1: { color: "#c9aa00", warning: false },
148
- stroke3: { color: "#876b00", warning: false },
149
- stroke4: { color: "#675000", warning: false },
150
- stroke2: { color: "#978c60", warning: false },
151
- stroke1: { color: "#b8ab75", warning: false },
152
- bgFillDark: { color: "#1f1e1b", warning: false },
153
- fgFillDark: { color: "#f6f1da", warning: false },
154
- bgFillInverted2: { color: "#1f1e1b", warning: false },
155
- bgFillInverted1: { color: "#3a2b00", warning: false },
156
- fgFillInverted: { color: "#f6f1da", warning: false },
157
- surface1: { color: "#faf1cd", warning: false }
136
+ bgFill1: "#f0d149",
137
+ fgFill: "#1f1e1b",
138
+ bgFill2: "#dcbe2f",
139
+ surface2: "#fdf9e7",
140
+ surface6: "#ecd264",
141
+ surface5: "#f5e297",
142
+ surface4: "#f7eab3",
143
+ surface3: "#fff",
144
+ fgSurface4: "#281d00",
145
+ fgSurface3: "#836b00",
146
+ fgSurface2: "#a58700",
147
+ fgSurface1: "#c7a900",
148
+ stroke3: "#836b00",
149
+ stroke4: "#635000",
150
+ stroke2: "#bfb17a",
151
+ stroke1: "#c7b97f",
152
+ bgFillDark: "#1f1e1b",
153
+ fgFillDark: "#f6f1da",
154
+ bgFillInverted2: "#1f1e1b",
155
+ bgFillInverted1: "#392c00",
156
+ fgFillInverted: "#f6f1da",
157
+ surface1: "#f9f0c8"
158
158
  },
159
159
  direction: "darker"
160
160
  },
161
161
  warning: {
162
162
  ramp: {
163
- bgFill1: { color: "#f0b849", warning: false },
164
- fgFill: { color: "#1f1e1b", warning: false },
165
- bgFill2: { color: "#dea633", warning: false },
166
- surface2: { color: "#fdf7ee", warning: false },
167
- surface6: { color: "#f1ce90", warning: false },
168
- surface5: { color: "#f6e0bb", warning: false },
169
- surface4: { color: "#f8e9cd", warning: false },
170
- surface3: { color: "#fff", warning: false },
171
- fgSurface4: { color: "#2f1800", warning: false },
172
- fgSurface3: { color: "#976300", warning: false },
173
- fgSurface2: { color: "#b78100", warning: false },
174
- fgSurface1: { color: "#d9a22e", warning: false },
175
- stroke3: { color: "#976300", warning: false },
176
- stroke4: { color: "#754900", warning: false },
177
- stroke2: { color: "#9f8860", warning: false },
178
- stroke1: { color: "#c2a776", warning: false },
179
- bgFillDark: { color: "#1f1e1b", warning: false },
180
- fgFillDark: { color: "#f3f0e9", warning: false },
181
- bgFillInverted2: { color: "#1f1e1b", warning: false },
182
- bgFillInverted1: { color: "#432600", warning: false },
183
- fgFillInverted: { color: "#f3f0e9", warning: false },
184
- surface1: { color: "#faefdc", warning: false }
163
+ bgFill1: "#f0b849",
164
+ fgFill: "#1f1e1b",
165
+ bgFill2: "#dda633",
166
+ surface2: "#fdf7ee",
167
+ surface6: "#f1ce8f",
168
+ surface5: "#f6e0b9",
169
+ surface4: "#f8e8cc",
170
+ surface3: "#fff",
171
+ fgSurface4: "#2e1900",
172
+ fgSurface3: "#936400",
173
+ fgSurface2: "#b68000",
174
+ fgSurface1: "#d8a12c",
175
+ stroke3: "#936400",
176
+ stroke4: "#704a00",
177
+ stroke2: "#caae7c",
178
+ stroke1: "#d2b581",
179
+ bgFillDark: "#1f1e1b",
180
+ fgFillDark: "#f3f0e9",
181
+ bgFillInverted2: "#1f1e1b",
182
+ bgFillInverted1: "#422800",
183
+ fgFillInverted: "#f3f0e9",
184
+ surface1: "#faeeda"
185
185
  },
186
186
  direction: "darker"
187
187
  },
188
188
  error: {
189
189
  ramp: {
190
- bgFill1: { color: "#cc1818", warning: false },
191
- fgFill: { color: "#f2efef", warning: false },
192
- bgFill2: { color: "#bc0001", warning: false },
193
- surface2: { color: "#fdf6f5", warning: false },
194
- surface6: { color: "#f5c9c2", warning: false },
195
- surface5: { color: "#f9dcd8", warning: false },
196
- surface4: { color: "#fae5e2", warning: false },
197
- surface3: { color: "#fff", warning: false },
198
- fgSurface4: { color: "#4a0000", warning: false },
199
- fgSurface3: { color: "#cc1818", warning: false },
200
- fgSurface2: { color: "#f84d41", warning: false },
201
- fgSurface1: { color: "#ff8373", warning: false },
202
- stroke3: { color: "#cc1818", warning: false },
203
- stroke4: { color: "#a70000", warning: false },
204
- stroke2: { color: "#ca675c", warning: false },
205
- stroke1: { color: "#dc8e83", warning: false },
206
- bgFillDark: { color: "#231c1b", warning: false },
207
- fgFillDark: { color: "#f2efef", warning: false },
208
- bgFillInverted2: { color: "#231c1b", warning: false },
209
- bgFillInverted1: { color: "#680000", warning: false },
210
- fgFillInverted: { color: "#f2efef", warning: false },
211
- surface1: { color: "#fcedea", warning: false }
190
+ bgFill1: "#cc1818",
191
+ fgFill: "#f2efef",
192
+ bgFill2: "#b90000",
193
+ surface2: "#fdf6f5",
194
+ surface6: "#f5c8c1",
195
+ surface5: "#f9dbd7",
196
+ surface4: "#fae4e1",
197
+ surface3: "#fff",
198
+ fgSurface4: "#470000",
199
+ fgSurface3: "#cc1818",
200
+ fgSurface2: "#f74c40",
201
+ fgSurface1: "#ff8879",
202
+ stroke3: "#cc1818",
203
+ stroke4: "#9d0000",
204
+ stroke2: "#de988e",
205
+ stroke1: "#e1a198",
206
+ bgFillDark: "#231c1b",
207
+ fgFillDark: "#f2efef",
208
+ bgFillInverted2: "#231c1b",
209
+ bgFillInverted1: "#640000",
210
+ fgFillInverted: "#f2efef",
211
+ surface1: "#fbece9"
212
212
  },
213
213
  direction: "darker"
214
214
  }