@udixio/theme 1.2.0 → 1.3.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 (35) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/bin.cjs +1 -1
  3. package/dist/bin.js +1 -1
  4. package/dist/browser.cjs +3 -4
  5. package/dist/browser.js +11 -12
  6. package/dist/color/color.manager.d.ts.map +1 -1
  7. package/dist/color/default-color.d.ts.map +1 -1
  8. package/dist/{define-config-CGG8l3fb.js → define-config-B1QPKKY_.js} +32 -2
  9. package/dist/{define-config-BFo7Sy7c.cjs → define-config-BGgVazsr.cjs} +32 -2
  10. package/dist/{load-from-path-CFpw2P_Y.js → load-from-path-BSrT4DOj.js} +1 -1
  11. package/dist/{load-from-path-BvdfXUD0.cjs → load-from-path-BuN8RpOs.cjs} +2 -2
  12. package/dist/loader/loader.d.ts.map +1 -1
  13. package/dist/{loader-C_BIrsO2.js → loader-Bc0bstAD.js} +129 -119
  14. package/dist/{loader-TksB6_mM.cjs → loader-YNN5hAF3.cjs} +121 -111
  15. package/dist/material-color-utilities/dynamic_color.d.ts +9 -15
  16. package/dist/material-color-utilities/dynamic_color.d.ts.map +1 -1
  17. package/dist/material-color-utilities/toneDeltaPair.d.ts +9 -2
  18. package/dist/material-color-utilities/toneDeltaPair.d.ts.map +1 -1
  19. package/dist/node.cjs +4 -5
  20. package/dist/node.js +13 -14
  21. package/dist/theme/scheme.d.ts +1 -1
  22. package/dist/theme/scheme.d.ts.map +1 -1
  23. package/dist/theme/variants/fidelity.variant.d.ts +3 -0
  24. package/dist/theme/variants/fidelity.variant.d.ts.map +1 -0
  25. package/dist/theme/variants/index.d.ts +1 -0
  26. package/dist/theme/variants/index.d.ts.map +1 -1
  27. package/package.json +1 -1
  28. package/src/color/color.manager.ts +10 -8
  29. package/src/color/default-color.ts +82 -34
  30. package/src/loader/loader.ts +1 -5
  31. package/src/material-color-utilities/dynamic_color.ts +18 -120
  32. package/src/material-color-utilities/toneDeltaPair.ts +91 -2
  33. package/src/theme/scheme.ts +7 -1
  34. package/src/theme/variants/fidelity.variant.ts +38 -0
  35. package/src/theme/variants/index.ts +2 -0
@@ -898,34 +898,6 @@ class Hct {
898
898
  * See the License for the specific language governing permissions and
899
899
  * limitations under the License.
900
900
  */
901
- function extendSpecVersion(originlColor, extendedColor) {
902
- return DynamicColor.fromPalette({
903
- name: originlColor.name,
904
- palette: (s) => extendedColor.palette(s),
905
- tone: (s) => extendedColor.tone(s),
906
- isBackground: originlColor.isBackground,
907
- chromaMultiplier: (s) => {
908
- const chromaMultiplier = extendedColor.chromaMultiplier;
909
- return chromaMultiplier !== void 0 ? chromaMultiplier(s) : 1;
910
- },
911
- background: (s) => {
912
- const background = extendedColor.background;
913
- return background !== void 0 ? background(s) : void 0;
914
- },
915
- secondBackground: (s) => {
916
- const secondBackground = extendedColor.secondBackground;
917
- return secondBackground !== void 0 ? secondBackground(s) : void 0;
918
- },
919
- contrastCurve: (s) => {
920
- const contrastCurve = extendedColor.contrastCurve;
921
- return contrastCurve !== void 0 ? contrastCurve(s) : void 0;
922
- },
923
- toneDeltaPair: (s) => {
924
- const toneDeltaPair = extendedColor.toneDeltaPair;
925
- return toneDeltaPair !== void 0 ? toneDeltaPair(s) : void 0;
926
- }
927
- });
928
- }
929
901
  class DynamicColor {
930
902
  /**
931
903
  * The base constructor for DynamicColor.
@@ -956,11 +928,11 @@ class DynamicColor {
956
928
  * @param contrastCurve A `ContrastCurve` object specifying how its contrast
957
929
  * against its background should behave in various contrast levels
958
930
  * options.
959
- * @param toneDeltaPair A `ToneDeltaPair` object specifying a tone delta
931
+ * @param adjustTone A `AdjustTone` object specifying a tone delta
960
932
  * constraint between two colors. One of them must be the color being
961
933
  * constructed.
962
934
  */
963
- constructor(name, palette, tone, isBackground, chromaMultiplier, background, secondBackground, contrastCurve, toneDeltaPair) {
935
+ constructor(name, palette, tone, isBackground, chromaMultiplier, background, secondBackground, contrastCurve, adjustTone) {
964
936
  __publicField(this, "hctCache", /* @__PURE__ */ new Map());
965
937
  this.name = name;
966
938
  this.palette = palette;
@@ -970,7 +942,7 @@ class DynamicColor {
970
942
  this.background = background;
971
943
  this.secondBackground = secondBackground;
972
944
  this.contrastCurve = contrastCurve;
973
- this.toneDeltaPair = toneDeltaPair;
945
+ this.adjustTone = adjustTone;
974
946
  if (!background && secondBackground) {
975
947
  throw new Error(
976
948
  `Color ${name} has secondBackgrounddefined, but background is not defined.`
@@ -1003,7 +975,7 @@ class DynamicColor {
1003
975
  args.background,
1004
976
  args.secondBackground,
1005
977
  args.contrastCurve,
1006
- args.toneDeltaPair
978
+ args.adjustTone
1007
979
  );
1008
980
  }
1009
981
  static getInitialToneFromBackground(background) {
@@ -1078,7 +1050,7 @@ class DynamicColor {
1078
1050
  background: this.background,
1079
1051
  secondBackground: this.secondBackground,
1080
1052
  contrastCurve: this.contrastCurve,
1081
- toneDeltaPair: this.toneDeltaPair
1053
+ adjustTone: this.adjustTone
1082
1054
  });
1083
1055
  }
1084
1056
  /**
@@ -1122,59 +1094,9 @@ class DynamicColor {
1122
1094
  * contrast level is.
1123
1095
  */
1124
1096
  getTone(scheme) {
1125
- const toneDeltaPair = this.toneDeltaPair ? this.toneDeltaPair(scheme) : void 0;
1126
- if (toneDeltaPair) {
1127
- const roleA = toneDeltaPair.roleA;
1128
- const roleB = toneDeltaPair.roleB;
1129
- const polarity = toneDeltaPair.polarity;
1130
- const constraint = toneDeltaPair.constraint;
1131
- const absoluteDelta = polarity === "darker" || polarity === "relative_lighter" && scheme.isDark || polarity === "relative_darker" && !scheme.isDark ? -toneDeltaPair.delta : toneDeltaPair.delta;
1132
- const amRoleA = this.name === roleA.name;
1133
- const selfRole = amRoleA ? roleA : roleB;
1134
- const refRole = amRoleA ? roleB : roleA;
1135
- let selfTone = selfRole.tone(scheme);
1136
- const refTone = refRole.getTone(scheme);
1137
- const relativeDelta = absoluteDelta * (amRoleA ? 1 : -1);
1138
- if (constraint === "exact") {
1139
- selfTone = clampDouble(0, 100, refTone + relativeDelta);
1140
- } else if (constraint === "nearer") {
1141
- if (relativeDelta > 0) {
1142
- selfTone = clampDouble(
1143
- 0,
1144
- 100,
1145
- clampDouble(refTone, refTone + relativeDelta, selfTone)
1146
- );
1147
- } else {
1148
- selfTone = clampDouble(
1149
- 0,
1150
- 100,
1151
- clampDouble(refTone + relativeDelta, refTone, selfTone)
1152
- );
1153
- }
1154
- } else if (constraint === "farther") {
1155
- if (relativeDelta > 0) {
1156
- selfTone = clampDouble(refTone + relativeDelta, 100, selfTone);
1157
- } else {
1158
- selfTone = clampDouble(0, refTone + relativeDelta, selfTone);
1159
- }
1160
- }
1161
- if (this.background && this.contrastCurve) {
1162
- const background = this.background(scheme);
1163
- const contrastCurve = this.contrastCurve(scheme);
1164
- if (background && contrastCurve) {
1165
- const bgTone = background.getTone(scheme);
1166
- const selfContrast = contrastCurve.get(scheme.contrastLevel);
1167
- selfTone = Contrast.ratioOfTones(bgTone, selfTone) >= selfContrast && scheme.contrastLevel >= 0 ? selfTone : DynamicColor.foregroundTone(bgTone, selfContrast);
1168
- }
1169
- }
1170
- if (this.isBackground && !this.name.endsWith("_fixed_dim")) {
1171
- if (selfTone >= 57) {
1172
- selfTone = clampDouble(65, 100, selfTone);
1173
- } else {
1174
- selfTone = clampDouble(0, 49, selfTone);
1175
- }
1176
- }
1177
- return selfTone;
1097
+ const adjustTone = this.adjustTone ? this.adjustTone(scheme) : void 0;
1098
+ if (adjustTone) {
1099
+ return adjustTone({ scheme, dynamicColor: this });
1178
1100
  } else {
1179
1101
  let answer = this.tone(scheme);
1180
1102
  if (this.background == void 0 || this.background(scheme) === void 0 || this.contrastCurve == void 0 || this.contrastCurve(scheme) === void 0) {
@@ -1274,7 +1196,66 @@ class ToneDeltaPair {
1274
1196
  this.constraint = constraint;
1275
1197
  this.constraint = constraint ?? "exact";
1276
1198
  }
1199
+ adjustedTone({
1200
+ scheme,
1201
+ dynamicColor
1202
+ }) {
1203
+ const roleA = this.roleA;
1204
+ const roleB = this.roleB;
1205
+ const polarity = this.polarity;
1206
+ const constraint = this.constraint;
1207
+ const absoluteDelta = polarity === "darker" || polarity === "relative_lighter" && scheme.isDark || polarity === "relative_darker" && !scheme.isDark ? -this.delta : this.delta;
1208
+ const amRoleA = dynamicColor.name === roleA.name;
1209
+ const selfRole = amRoleA ? roleA : roleB;
1210
+ const refRole = amRoleA ? roleB : roleA;
1211
+ let selfTone = selfRole.tone(scheme);
1212
+ const refTone = refRole.getTone(scheme);
1213
+ const relativeDelta = absoluteDelta * (amRoleA ? 1 : -1);
1214
+ if (constraint === "exact") {
1215
+ selfTone = clampDouble(0, 100, refTone + relativeDelta);
1216
+ } else if (constraint === "nearer") {
1217
+ if (relativeDelta > 0) {
1218
+ selfTone = clampDouble(
1219
+ 0,
1220
+ 100,
1221
+ clampDouble(refTone, refTone + relativeDelta, selfTone)
1222
+ );
1223
+ } else {
1224
+ selfTone = clampDouble(
1225
+ 0,
1226
+ 100,
1227
+ clampDouble(refTone + relativeDelta, refTone, selfTone)
1228
+ );
1229
+ }
1230
+ } else if (constraint === "farther") {
1231
+ if (relativeDelta > 0) {
1232
+ selfTone = clampDouble(refTone + relativeDelta, 100, selfTone);
1233
+ } else {
1234
+ selfTone = clampDouble(0, refTone + relativeDelta, selfTone);
1235
+ }
1236
+ }
1237
+ if (dynamicColor.background && dynamicColor.contrastCurve) {
1238
+ const background = dynamicColor.background(scheme);
1239
+ const contrastCurve = dynamicColor.contrastCurve(scheme);
1240
+ if (background && contrastCurve) {
1241
+ const bgTone = background.getTone(scheme);
1242
+ const selfContrast = contrastCurve.get(scheme.contrastLevel);
1243
+ selfTone = Contrast.ratioOfTones(bgTone, selfTone) >= selfContrast && scheme.contrastLevel >= 0 ? selfTone : DynamicColor.foregroundTone(bgTone, selfContrast);
1244
+ }
1245
+ }
1246
+ if (dynamicColor.isBackground && !dynamicColor.name.endsWith("_fixed_dim")) {
1247
+ if (selfTone >= 57) {
1248
+ selfTone = clampDouble(65, 100, selfTone);
1249
+ } else {
1250
+ selfTone = clampDouble(0, 49, selfTone);
1251
+ }
1252
+ }
1253
+ return selfTone;
1254
+ }
1277
1255
  }
1256
+ const toneDeltaPair = (...params) => {
1257
+ return (args) => new ToneDeltaPair(...params).adjustedTone(args);
1258
+ };
1278
1259
  function argbToRgb(argb) {
1279
1260
  return {
1280
1261
  r: argb >> 16 & 255,
@@ -1453,7 +1434,7 @@ class ColorManager {
1453
1434
  isBackground: true,
1454
1435
  background: (s) => highestSurface(s, this),
1455
1436
  contrastCurve: (s) => getCurve(4.5),
1456
- toneDeltaPair: (s) => new ToneDeltaPair(
1437
+ adjustTone: (s) => toneDeltaPair(
1457
1438
  this.get(colorContainerKey).getMaterialColor(),
1458
1439
  this.get(colorKey).getMaterialColor(),
1459
1440
  5,
@@ -1474,7 +1455,7 @@ class ColorManager {
1474
1455
  isBackground: true,
1475
1456
  background: (s) => this.get("surfaceContainerHigh").getMaterialColor(),
1476
1457
  contrastCurve: (s) => getCurve(4.5),
1477
- toneDeltaPair: (s) => new ToneDeltaPair(
1458
+ adjustTone: (s) => toneDeltaPair(
1478
1459
  this.get(colorDimKey).getMaterialColor(),
1479
1460
  this.get(colorKey).getMaterialColor(),
1480
1461
  5,
@@ -1501,7 +1482,7 @@ class ColorManager {
1501
1482
  },
1502
1483
  isBackground: true,
1503
1484
  background: (s) => highestSurface(s, this),
1504
- toneDeltaPair: (s) => void 0,
1485
+ adjustTone: (s) => void 0,
1505
1486
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
1506
1487
  });
1507
1488
  this.createOrUpdate(onColorContainerKey, {
@@ -1523,7 +1504,7 @@ class ColorManager {
1523
1504
  palette: (s) => s.getPalette(colorKey),
1524
1505
  tone: (s) => this.get(colorFixedKey).getMaterialColor().getTone(s),
1525
1506
  isBackground: true,
1526
- toneDeltaPair: (s) => new ToneDeltaPair(
1507
+ adjustTone: (s) => toneDeltaPair(
1527
1508
  this.get(colorFixedDimKey).getMaterialColor(),
1528
1509
  this.get(colorFixedKey).getMaterialColor(),
1529
1510
  5,
@@ -1790,6 +1771,9 @@ const tonalSpotVariant = {
1790
1771
  },
1791
1772
  customPalettes: ({ colorHct }) => TonalPalette.fromHueAndChroma(colorHct.hue, 16)
1792
1773
  };
1774
+ const inverseTone = (tone) => {
1775
+ return 100 - tone;
1776
+ };
1793
1777
  const defaultColors = (colorService) => {
1794
1778
  const getColor = (key) => {
1795
1779
  return colorService.getColor(key).getMaterialColor();
@@ -1804,6 +1788,9 @@ const defaultColors = (colorService) => {
1804
1788
  if (s.isDark) {
1805
1789
  return 4;
1806
1790
  } else {
1791
+ if (s.variant == "fidelity") {
1792
+ return 100;
1793
+ }
1807
1794
  if (Hct.isYellow(s.getPalette("neutral").hue)) {
1808
1795
  return 99;
1809
1796
  } else if (s.variant === "vibrant") {
@@ -2099,6 +2086,8 @@ const defaultColors = (colorService) => {
2099
2086
  0,
2100
2087
  Hct.isYellow(s.getPalette("primary").hue) ? 25 : Hct.isCyan(s.getPalette("primary").hue) ? 88 : 98
2101
2088
  );
2089
+ } else if (s.variant == "fidelity") {
2090
+ return s.sourceColorHct.tone;
2102
2091
  } else {
2103
2092
  return tMaxC(
2104
2093
  s.getPalette("primary"),
@@ -2110,7 +2099,18 @@ const defaultColors = (colorService) => {
2110
2099
  isBackground: true,
2111
2100
  background: (s) => highestSurface(s, colorService),
2112
2101
  contrastCurve: (s) => getCurve(4.5),
2113
- toneDeltaPair: (s) => new ToneDeltaPair(
2102
+ adjustTone: (s) => s.variant == "fidelity" ? () => {
2103
+ const surfaceTone = colorService.getColor("surface").getMaterialColor().tone(s);
2104
+ const primaryTone = colorService.getColor("primary").getMaterialColor().tone(s);
2105
+ let selfTone = primaryTone;
2106
+ if (Contrast.ratioOfTones(surfaceTone, selfTone) < 3) {
2107
+ const result = inverseTone(primaryTone);
2108
+ if (Contrast.ratioOfTones(surfaceTone, result) >= 3) {
2109
+ selfTone = result;
2110
+ }
2111
+ }
2112
+ return selfTone;
2113
+ } : toneDeltaPair(
2114
2114
  colorService.getColor("primaryContainer").getMaterialColor(),
2115
2115
  colorService.getColor("primary").getMaterialColor(),
2116
2116
  5,
@@ -2133,7 +2133,7 @@ const defaultColors = (colorService) => {
2133
2133
  isBackground: true,
2134
2134
  background: (s) => getColor("surfaceContainerHigh"),
2135
2135
  contrastCurve: (s) => getCurve(4.5),
2136
- toneDeltaPair: (s) => new ToneDeltaPair(
2136
+ adjustTone: (s) => toneDeltaPair(
2137
2137
  colorService.getColor("primaryDim").getMaterialColor(),
2138
2138
  colorService.getColor("primary").getMaterialColor(),
2139
2139
  5,
@@ -2160,6 +2160,13 @@ const defaultColors = (colorService) => {
2160
2160
  78,
2161
2161
  Hct.isCyan(s.getPalette("primary").hue) ? 88 : 90
2162
2162
  );
2163
+ }
2164
+ if (s.variant == "fidelity") {
2165
+ return s.isDark ? tMaxC(s.getPalette("primary"), 30, 93) : tMaxC(
2166
+ s.getPalette("primary"),
2167
+ 78,
2168
+ Hct.isCyan(s.getPalette("primary").hue) ? 88 : 90
2169
+ );
2163
2170
  } else {
2164
2171
  return s.isDark ? tMinC(s.getPalette("primary"), 66, 93) : tMaxC(
2165
2172
  s.getPalette("primary"),
@@ -2170,7 +2177,14 @@ const defaultColors = (colorService) => {
2170
2177
  },
2171
2178
  isBackground: true,
2172
2179
  background: (s) => highestSurface(s, colorService),
2173
- toneDeltaPair: (s) => void 0,
2180
+ adjustTone: (s) => s.variant == "fidelity" ? toneDeltaPair(
2181
+ colorService.getColor("primary").getMaterialColor(),
2182
+ colorService.getColor("primaryContainer").getMaterialColor(),
2183
+ 15,
2184
+ "relative_darker",
2185
+ true,
2186
+ "farther"
2187
+ ) : void 0,
2174
2188
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
2175
2189
  },
2176
2190
  onPrimaryContainer: {
@@ -2196,7 +2210,7 @@ const defaultColors = (colorService) => {
2196
2210
  palette: (s) => s.getPalette("primary"),
2197
2211
  tone: (s) => colorService.getColor("primaryFixed").getMaterialColor().getTone(s),
2198
2212
  isBackground: true,
2199
- toneDeltaPair: (s) => new ToneDeltaPair(
2213
+ adjustTone: (s) => toneDeltaPair(
2200
2214
  getColor("primaryFixedDim"),
2201
2215
  getColor("primaryFixed"),
2202
2216
  5,
@@ -2238,7 +2252,7 @@ const defaultColors = (colorService) => {
2238
2252
  isBackground: true,
2239
2253
  background: (s) => highestSurface(s, colorService),
2240
2254
  contrastCurve: (s) => getCurve(4.5),
2241
- toneDeltaPair: (s) => new ToneDeltaPair(
2255
+ adjustTone: (s) => toneDeltaPair(
2242
2256
  getColor("secondaryContainer"),
2243
2257
  getColor("secondary"),
2244
2258
  5,
@@ -2259,7 +2273,7 @@ const defaultColors = (colorService) => {
2259
2273
  isBackground: true,
2260
2274
  background: (s) => getColor("surfaceContainerHigh"),
2261
2275
  contrastCurve: (s) => getCurve(4.5),
2262
- toneDeltaPair: (s) => new ToneDeltaPair(
2276
+ adjustTone: (s) => toneDeltaPair(
2263
2277
  getColor("secondaryDim"),
2264
2278
  getColor("secondary"),
2265
2279
  5,
@@ -2286,7 +2300,7 @@ const defaultColors = (colorService) => {
2286
2300
  },
2287
2301
  isBackground: true,
2288
2302
  background: (s) => highestSurface(s, colorService),
2289
- toneDeltaPair: (s) => void 0,
2303
+ adjustTone: (s) => void 0,
2290
2304
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
2291
2305
  },
2292
2306
  onSecondaryContainer: {
@@ -2312,7 +2326,7 @@ const defaultColors = (colorService) => {
2312
2326
  palette: (s) => s.getPalette("secondary"),
2313
2327
  tone: (s) => getColor("secondaryFixed").getTone(s),
2314
2328
  isBackground: true,
2315
- toneDeltaPair: (s) => new ToneDeltaPair(
2329
+ adjustTone: (s) => toneDeltaPair(
2316
2330
  getColor("secondaryFixedDim"),
2317
2331
  getColor("secondaryFixed"),
2318
2332
  5,
@@ -2350,7 +2364,7 @@ const defaultColors = (colorService) => {
2350
2364
  isBackground: true,
2351
2365
  background: (s) => highestSurface(s, colorService),
2352
2366
  contrastCurve: (s) => getCurve(4.5),
2353
- toneDeltaPair: (s) => new ToneDeltaPair(
2367
+ adjustTone: (s) => toneDeltaPair(
2354
2368
  getColor("tertiaryContainer"),
2355
2369
  getColor("tertiary"),
2356
2370
  5,
@@ -2371,7 +2385,7 @@ const defaultColors = (colorService) => {
2371
2385
  isBackground: true,
2372
2386
  background: (s) => getColor("surfaceContainerHigh"),
2373
2387
  contrastCurve: (s) => getCurve(4.5),
2374
- toneDeltaPair: (s) => new ToneDeltaPair(
2388
+ adjustTone: (s) => toneDeltaPair(
2375
2389
  getColor("tertiaryDim"),
2376
2390
  getColor("tertiary"),
2377
2391
  5,
@@ -2404,7 +2418,7 @@ const defaultColors = (colorService) => {
2404
2418
  },
2405
2419
  isBackground: true,
2406
2420
  background: (s) => highestSurface(s, colorService),
2407
- toneDeltaPair: (s) => void 0,
2421
+ adjustTone: (s) => void 0,
2408
2422
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
2409
2423
  },
2410
2424
  onTertiaryContainer: {
@@ -2430,7 +2444,7 @@ const defaultColors = (colorService) => {
2430
2444
  palette: (s) => s.getPalette("tertiary"),
2431
2445
  tone: (s) => getColor("tertiaryFixed").getTone(s),
2432
2446
  isBackground: true,
2433
- toneDeltaPair: (s) => new ToneDeltaPair(
2447
+ adjustTone: (s) => toneDeltaPair(
2434
2448
  getColor("tertiaryFixedDim"),
2435
2449
  getColor("tertiaryFixed"),
2436
2450
  5,
@@ -2460,7 +2474,7 @@ const defaultColors = (colorService) => {
2460
2474
  isBackground: true,
2461
2475
  background: (s) => highestSurface(s, colorService),
2462
2476
  contrastCurve: (s) => getCurve(4.5),
2463
- toneDeltaPair: (s) => new ToneDeltaPair(
2477
+ adjustTone: (s) => toneDeltaPair(
2464
2478
  colorService.getColor("errorContainer").getMaterialColor(),
2465
2479
  colorService.getColor("error").getMaterialColor(),
2466
2480
  5,
@@ -2475,7 +2489,7 @@ const defaultColors = (colorService) => {
2475
2489
  isBackground: true,
2476
2490
  background: (s) => getColor("surfaceContainerHigh"),
2477
2491
  contrastCurve: (s) => getCurve(4.5),
2478
- toneDeltaPair: (s) => new ToneDeltaPair(
2492
+ adjustTone: (s) => toneDeltaPair(
2479
2493
  getColor("errorDim"),
2480
2494
  getColor("error"),
2481
2495
  5,
@@ -2496,7 +2510,7 @@ const defaultColors = (colorService) => {
2496
2510
  },
2497
2511
  isBackground: true,
2498
2512
  background: (s) => highestSurface(s, colorService),
2499
- toneDeltaPair: (s) => void 0,
2513
+ adjustTone: (s) => void 0,
2500
2514
  contrastCurve: (s) => s.contrastLevel > 0 ? getCurve(1.5) : void 0
2501
2515
  },
2502
2516
  onErrorContainer: {
@@ -2646,11 +2660,8 @@ const loader = async (config) => {
2646
2660
  api.plugins.initPlugins(api);
2647
2661
  }
2648
2662
  };
2649
- const load = async () => {
2650
- await api.plugins.loadPlugins();
2651
- };
2652
2663
  init();
2653
- await load();
2664
+ await api.load();
2654
2665
  return api;
2655
2666
  };
2656
2667
  export {
@@ -2660,7 +2671,7 @@ export {
2660
2671
  Hct as H,
2661
2672
  PluginModule as P,
2662
2673
  SchemeManager as S,
2663
- ToneDeltaPair as T,
2674
+ ThemeModule as T,
2664
2675
  Variant as V,
2665
2676
  AppModule as a,
2666
2677
  API as b,
@@ -2671,15 +2682,14 @@ export {
2671
2682
  bootstrap as g,
2672
2683
  highestSurface as h,
2673
2684
  ContrastCurve as i,
2674
- extendSpecVersion as j,
2675
- PluginApi as k,
2685
+ PluginApi as j,
2686
+ tonalSpotVariant as k,
2676
2687
  loader as l,
2677
- ThemeModule as m,
2678
- Scheme as n,
2679
- ThemeApi as o,
2680
- getPiecewiseHue as p,
2681
- getRotatedHue as q,
2688
+ Scheme as m,
2689
+ ThemeApi as n,
2690
+ getPiecewiseHue as o,
2691
+ getRotatedHue as p,
2692
+ VariantManager as q,
2682
2693
  registerModule as r,
2683
- VariantManager as s,
2684
- tonalSpotVariant as t
2694
+ toneDeltaPair as t
2685
2695
  };