@terrazzo/plugin-css 0.9.1 → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rgb/parseNumber.js
1
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseNumber.js
2
2
  const parseNumber = (color, len) => {
3
3
  if (typeof color !== "number") return;
4
4
  if (len === 3) return {
@@ -31,7 +31,7 @@ const parseNumber = (color, len) => {
31
31
  var parseNumber_default = parseNumber;
32
32
 
33
33
  //#endregion
34
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/colors/named.js
34
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/colors/named.js
35
35
  const named = {
36
36
  aliceblue: 15792383,
37
37
  antiquewhite: 16444375,
@@ -185,14 +185,14 @@ const named = {
185
185
  var named_default = named;
186
186
 
187
187
  //#endregion
188
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rgb/parseNamed.js
188
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseNamed.js
189
189
  const parseNamed = (color) => {
190
190
  return parseNumber_default(named_default[color.toLowerCase()], 6);
191
191
  };
192
192
  var parseNamed_default = parseNamed;
193
193
 
194
194
  //#endregion
195
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rgb/parseHex.js
195
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseHex.js
196
196
  const hex = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i;
197
197
  const parseHex = (color) => {
198
198
  let match;
@@ -201,7 +201,7 @@ const parseHex = (color) => {
201
201
  var parseHex_default = parseHex;
202
202
 
203
203
  //#endregion
204
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/util/regex.js
204
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/regex.js
205
205
  const num$1 = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";
206
206
  const num_none = `(?:${num$1}|none)`;
207
207
  const per = `${num$1}%`;
@@ -214,7 +214,7 @@ const c = `\\s*,\\s*`;
214
214
  const rx_num_per_none = new RegExp("^" + num_per_none + "$");
215
215
 
216
216
  //#endregion
217
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rgb/parseRgbLegacy.js
217
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseRgbLegacy.js
218
218
  const rgb_num_old = new RegExp(`^rgba?\\(\\s*${num$1}${c}${num$1}${c}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
219
219
  const rgb_per_old = new RegExp(`^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
220
220
  const parseRgbLegacy = (color) => {
@@ -236,7 +236,7 @@ const parseRgbLegacy = (color) => {
236
236
  var parseRgbLegacy_default = parseRgbLegacy;
237
237
 
238
238
  //#endregion
239
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/_prepare.js
239
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/_prepare.js
240
240
  const prepare = (color, mode) => color === void 0 ? void 0 : typeof color !== "object" ? parse_default(color) : color.mode !== void 0 ? color : mode ? {
241
241
  ...color,
242
242
  mode
@@ -244,12 +244,12 @@ const prepare = (color, mode) => color === void 0 ? void 0 : typeof color !== "o
244
244
  var _prepare_default = prepare;
245
245
 
246
246
  //#endregion
247
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/converter.js
247
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/converter.js
248
248
  const converter = (target_mode = "rgb") => (color) => (color = _prepare_default(color, target_mode)) !== void 0 ? color.mode === target_mode ? color : converters$1[color.mode][target_mode] ? converters$1[color.mode][target_mode](color) : target_mode === "rgb" ? converters$1[color.mode].rgb(color) : converters$1.rgb[target_mode](converters$1[color.mode].rgb(color)) : void 0;
249
249
  var converter_default = converter;
250
250
 
251
251
  //#endregion
252
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/modes.js
252
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/modes.js
253
253
  const converters$1 = {};
254
254
  const modes = {};
255
255
  const parsers = [];
@@ -289,7 +289,7 @@ const useParser = (parser, mode) => {
289
289
  };
290
290
 
291
291
  //#endregion
292
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/parse.js
292
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/parse.js
293
293
  const IdentStartCodePoint = /[^\x00-\x7F]|[a-zA-Z_]/;
294
294
  const IdentCodePoint = /[^\x00-\x7F]|[-\w]/;
295
295
  const Tok = {
@@ -543,7 +543,7 @@ const parse = (color) => {
543
543
  var parse_default = parse;
544
544
 
545
545
  //#endregion
546
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rgb/parseRgb.js
546
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseRgb.js
547
547
  function parseRgb(color, parsed) {
548
548
  if (!parsed || parsed[0] !== "rgb" && parsed[0] !== "rgba") return void 0;
549
549
  const res = { mode: "rgb" };
@@ -558,7 +558,7 @@ function parseRgb(color, parsed) {
558
558
  var parseRgb_default = parseRgb;
559
559
 
560
560
  //#endregion
561
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rgb/parseTransparent.js
561
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseTransparent.js
562
562
  const parseTransparent = (c$1) => c$1 === "transparent" ? {
563
563
  mode: "rgb",
564
564
  r: 0,
@@ -569,11 +569,11 @@ const parseTransparent = (c$1) => c$1 === "transparent" ? {
569
569
  var parseTransparent_default = parseTransparent;
570
570
 
571
571
  //#endregion
572
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/interpolate/lerp.js
572
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/lerp.js
573
573
  const lerp = (a, b, t) => a + t * (b - a);
574
574
 
575
575
  //#endregion
576
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/interpolate/piecewise.js
576
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/piecewise.js
577
577
  const get_classes = (arr) => {
578
578
  let classes = [];
579
579
  for (let i = 0; i < arr.length - 1; i++) {
@@ -596,11 +596,11 @@ const interpolatorPiecewise = (interpolator) => (arr) => {
596
596
  };
597
597
 
598
598
  //#endregion
599
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/interpolate/linear.js
599
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/linear.js
600
600
  const interpolatorLinear = interpolatorPiecewise(lerp);
601
601
 
602
602
  //#endregion
603
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/fixup/alpha.js
603
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/fixup/alpha.js
604
604
  const fixupAlpha = (arr) => {
605
605
  let some_defined = false;
606
606
  let res = arr.map((v) => {
@@ -614,7 +614,7 @@ const fixupAlpha = (arr) => {
614
614
  };
615
615
 
616
616
  //#endregion
617
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rgb/definition.js
617
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/definition.js
618
618
  const definition$15 = {
619
619
  mode: "rgb",
620
620
  channels: [
@@ -653,10 +653,10 @@ const definition$15 = {
653
653
  b: 0
654
654
  }
655
655
  };
656
- var definition_default$13 = definition$15;
656
+ var definition_default$12 = definition$15;
657
657
 
658
658
  //#endregion
659
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/a98/convertA98ToXyz65.js
659
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/convertA98ToXyz65.js
660
660
  const linearize$2 = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
661
661
  const convertA98ToXyz65 = (a98) => {
662
662
  let r$1 = linearize$2(a98.r);
@@ -674,7 +674,7 @@ const convertA98ToXyz65 = (a98) => {
674
674
  var convertA98ToXyz65_default = convertA98ToXyz65;
675
675
 
676
676
  //#endregion
677
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/a98/convertXyz65ToA98.js
677
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/convertXyz65ToA98.js
678
678
  const gamma$2 = (v) => Math.pow(Math.abs(v), 256 / 563) * Math.sign(v);
679
679
  const convertXyz65ToA98 = ({ x, y, z, alpha }) => {
680
680
  if (x === void 0) x = 0;
@@ -692,7 +692,7 @@ const convertXyz65ToA98 = ({ x, y, z, alpha }) => {
692
692
  var convertXyz65ToA98_default = convertXyz65ToA98;
693
693
 
694
694
  //#endregion
695
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lrgb/convertRgbToLrgb.js
695
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/convertRgbToLrgb.js
696
696
  const fn$3 = (c$1 = 0) => {
697
697
  const abs = Math.abs(c$1);
698
698
  if (abs <= .04045) return c$1 / 12.92;
@@ -711,7 +711,7 @@ const convertRgbToLrgb = ({ r: r$1, g, b, alpha }) => {
711
711
  var convertRgbToLrgb_default = convertRgbToLrgb;
712
712
 
713
713
  //#endregion
714
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/convertRgbToXyz65.js
714
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertRgbToXyz65.js
715
715
  const convertRgbToXyz65 = (rgb$2) => {
716
716
  let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
717
717
  let res = {
@@ -726,7 +726,7 @@ const convertRgbToXyz65 = (rgb$2) => {
726
726
  var convertRgbToXyz65_default = convertRgbToXyz65;
727
727
 
728
728
  //#endregion
729
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lrgb/convertLrgbToRgb.js
729
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/convertLrgbToRgb.js
730
730
  const fn$2 = (c$1 = 0) => {
731
731
  const abs = Math.abs(c$1);
732
732
  if (abs > .0031308) return (Math.sign(c$1) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
@@ -745,7 +745,7 @@ const convertLrgbToRgb = ({ r: r$1, g, b, alpha }, mode = "rgb") => {
745
745
  var convertLrgbToRgb_default = convertLrgbToRgb;
746
746
 
747
747
  //#endregion
748
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/convertXyz65ToRgb.js
748
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz65ToRgb.js
749
749
  const convertXyz65ToRgb = ({ x, y, z, alpha }) => {
750
750
  if (x === void 0) x = 0;
751
751
  if (y === void 0) y = 0;
@@ -761,9 +761,9 @@ const convertXyz65ToRgb = ({ x, y, z, alpha }) => {
761
761
  var convertXyz65ToRgb_default = convertXyz65ToRgb;
762
762
 
763
763
  //#endregion
764
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/a98/definition.js
764
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/definition.js
765
765
  const definition$14 = {
766
- ...definition_default$13,
766
+ ...definition_default$12,
767
767
  mode: "a98",
768
768
  parse: ["a98-rgb"],
769
769
  serialize: "a98-rgb",
@@ -779,12 +779,12 @@ const definition$14 = {
779
779
  var definition_default = definition$14;
780
780
 
781
781
  //#endregion
782
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/util/normalizeHue.js
782
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/normalizeHue.js
783
783
  const normalizeHue = (hue$2) => (hue$2 = hue$2 % 360) < 0 ? hue$2 + 360 : hue$2;
784
784
  var normalizeHue_default = normalizeHue;
785
785
 
786
786
  //#endregion
787
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsl/convertHslToRgb.js
787
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/convertHslToRgb.js
788
788
  function convertHslToRgb({ h, s, l, alpha }) {
789
789
  h = normalizeHue_default(h !== void 0 ? h : 0);
790
790
  if (s === void 0) s = 0;
@@ -847,7 +847,7 @@ function convertHslToRgb({ h, s, l, alpha }) {
847
847
  }
848
848
 
849
849
  //#endregion
850
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsl/convertRgbToHsl.js
850
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/convertRgbToHsl.js
851
851
  function convertRgbToHsl({ r: r$1, g, b, alpha }) {
852
852
  if (r$1 === void 0) r$1 = 0;
853
853
  if (g === void 0) g = 0;
@@ -864,7 +864,7 @@ function convertRgbToHsl({ r: r$1, g, b, alpha }) {
864
864
  }
865
865
 
866
866
  //#endregion
867
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/util/hue.js
867
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/hue.js
868
868
  const hueToDeg = (val, unit) => {
869
869
  switch (unit) {
870
870
  case "deg": return +val;
@@ -876,7 +876,7 @@ const hueToDeg = (val, unit) => {
876
876
  var hue_default = hueToDeg;
877
877
 
878
878
  //#endregion
879
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsl/parseHslLegacy.js
879
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/parseHslLegacy.js
880
880
  const hsl_old = new RegExp(`^hsla?\\(\\s*${hue$1}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
881
881
  const parseHslLegacy = (color) => {
882
882
  let match = color.match(hsl_old);
@@ -893,7 +893,7 @@ const parseHslLegacy = (color) => {
893
893
  var parseHslLegacy_default = parseHslLegacy;
894
894
 
895
895
  //#endregion
896
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsl/parseHsl.js
896
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/parseHsl.js
897
897
  function parseHsl(color, parsed) {
898
898
  if (!parsed || parsed[0] !== "hsl" && parsed[0] !== "hsla") return void 0;
899
899
  const res = { mode: "hsl" };
@@ -916,7 +916,7 @@ function parseHsl(color, parsed) {
916
916
  var parseHsl_default = parseHsl;
917
917
 
918
918
  //#endregion
919
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/fixup/hue.js
919
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/fixup/hue.js
920
920
  const hue = (hues, fn$4) => {
921
921
  return hues.map((hue$2, idx, arr) => {
922
922
  if (hue$2 === void 0) return hue$2;
@@ -935,7 +935,7 @@ const hue = (hues, fn$4) => {
935
935
  const fixupHueShorter = (arr) => hue(arr, (d) => Math.abs(d) <= 180 ? d : d - 360 * Math.sign(d));
936
936
 
937
937
  //#endregion
938
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/difference.js
938
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/difference.js
939
939
  const differenceHueSaturation = (std, smp) => {
940
940
  if (std.h === void 0 || smp.h === void 0 || !std.s || !smp.s) return 0;
941
941
  let std_h = normalizeHue_default(std.h);
@@ -978,7 +978,7 @@ const differenceEuclidean = (mode = "rgb", weights = [
978
978
  };
979
979
 
980
980
  //#endregion
981
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/average.js
981
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/average.js
982
982
  const averageAngle = (val) => {
983
983
  let sum = val.reduce((sum$1, val$1) => {
984
984
  if (val$1 !== void 0) {
@@ -996,7 +996,7 @@ const averageAngle = (val) => {
996
996
  };
997
997
 
998
998
  //#endregion
999
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsl/definition.js
999
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/definition.js
1000
1000
  const definition$13 = {
1001
1001
  mode: "hsl",
1002
1002
  toMode: { rgb: convertHslToRgb },
@@ -1029,7 +1029,7 @@ const definition$13 = {
1029
1029
  var definition_default$1 = definition$13;
1030
1030
 
1031
1031
  //#endregion
1032
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsv/convertHsvToRgb.js
1032
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/convertHsvToRgb.js
1033
1033
  function convertHsvToRgb({ h, s, v, alpha }) {
1034
1034
  h = normalizeHue_default(h !== void 0 ? h : 0);
1035
1035
  if (s === void 0) s = 0;
@@ -1091,7 +1091,7 @@ function convertHsvToRgb({ h, s, v, alpha }) {
1091
1091
  }
1092
1092
 
1093
1093
  //#endregion
1094
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsv/convertRgbToHsv.js
1094
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/convertRgbToHsv.js
1095
1095
  function convertRgbToHsv({ r: r$1, g, b, alpha }) {
1096
1096
  if (r$1 === void 0) r$1 = 0;
1097
1097
  if (g === void 0) g = 0;
@@ -1108,7 +1108,7 @@ function convertRgbToHsv({ r: r$1, g, b, alpha }) {
1108
1108
  }
1109
1109
 
1110
1110
  //#endregion
1111
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsv/definition.js
1111
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/definition.js
1112
1112
  const definition$12 = {
1113
1113
  mode: "hsv",
1114
1114
  toMode: { rgb: convertHsvToRgb },
@@ -1138,10 +1138,10 @@ const definition$12 = {
1138
1138
  difference: { h: differenceHueSaturation },
1139
1139
  average: { h: averageAngle }
1140
1140
  };
1141
- var definition_default$2 = definition$12;
1141
+ var definition_default$15 = definition$12;
1142
1142
 
1143
1143
  //#endregion
1144
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hwb/convertHwbToRgb.js
1144
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/convertHwbToRgb.js
1145
1145
  function convertHwbToRgb({ h, w, b, alpha }) {
1146
1146
  if (w === void 0) w = 0;
1147
1147
  if (b === void 0) b = 0;
@@ -1159,7 +1159,7 @@ function convertHwbToRgb({ h, w, b, alpha }) {
1159
1159
  }
1160
1160
 
1161
1161
  //#endregion
1162
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hwb/convertRgbToHwb.js
1162
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/convertRgbToHwb.js
1163
1163
  function convertRgbToHwb(rgba) {
1164
1164
  let hsv = convertRgbToHsv(rgba);
1165
1165
  if (hsv === void 0) return void 0;
@@ -1176,7 +1176,7 @@ function convertRgbToHwb(rgba) {
1176
1176
  }
1177
1177
 
1178
1178
  //#endregion
1179
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hwb/parseHwb.js
1179
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/parseHwb.js
1180
1180
  function ParseHwb(color, parsed) {
1181
1181
  if (!parsed || parsed[0] !== "hwb") return void 0;
1182
1182
  const res = { mode: "hwb" };
@@ -1199,7 +1199,7 @@ function ParseHwb(color, parsed) {
1199
1199
  var parseHwb_default = ParseHwb;
1200
1200
 
1201
1201
  //#endregion
1202
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hwb/definition.js
1202
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/definition.js
1203
1203
  const definition$11 = {
1204
1204
  mode: "hwb",
1205
1205
  toMode: { rgb: convertHwbToRgb },
@@ -1229,15 +1229,15 @@ const definition$11 = {
1229
1229
  difference: { h: differenceHueNaive },
1230
1230
  average: { h: averageAngle }
1231
1231
  };
1232
- var definition_default$3 = definition$11;
1232
+ var definition_default$2 = definition$11;
1233
1233
 
1234
1234
  //#endregion
1235
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/constants.js
1235
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/constants.js
1236
1236
  const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
1237
1237
  const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
1238
1238
 
1239
1239
  //#endregion
1240
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/constants.js
1240
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/constants.js
1241
1241
  const D50 = {
1242
1242
  X: .3457 / .3585,
1243
1243
  Y: 1,
@@ -1252,7 +1252,7 @@ const k$2 = Math.pow(29, 3) / Math.pow(3, 3);
1252
1252
  const e$2 = Math.pow(6, 3) / Math.pow(29, 3);
1253
1253
 
1254
1254
  //#endregion
1255
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/convertLabToXyz50.js
1255
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertLabToXyz50.js
1256
1256
  let fn$1 = (v) => Math.pow(v, 3) > e$1 ? Math.pow(v, 3) : (116 * v - 16) / k$1;
1257
1257
  const convertLabToXyz50 = ({ l, a, b, alpha }) => {
1258
1258
  if (l === void 0) l = 0;
@@ -1273,7 +1273,7 @@ const convertLabToXyz50 = ({ l, a, b, alpha }) => {
1273
1273
  var convertLabToXyz50_default = convertLabToXyz50;
1274
1274
 
1275
1275
  //#endregion
1276
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/convertXyz50ToRgb.js
1276
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/convertXyz50ToRgb.js
1277
1277
  const convertXyz50ToRgb = ({ x, y, z, alpha }) => {
1278
1278
  if (x === void 0) x = 0;
1279
1279
  if (y === void 0) y = 0;
@@ -1289,12 +1289,12 @@ const convertXyz50ToRgb = ({ x, y, z, alpha }) => {
1289
1289
  var convertXyz50ToRgb_default = convertXyz50ToRgb;
1290
1290
 
1291
1291
  //#endregion
1292
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/convertLabToRgb.js
1292
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertLabToRgb.js
1293
1293
  const convertLabToRgb = (lab) => convertXyz50ToRgb_default(convertLabToXyz50_default(lab));
1294
1294
  var convertLabToRgb_default = convertLabToRgb;
1295
1295
 
1296
1296
  //#endregion
1297
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/convertRgbToXyz50.js
1297
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/convertRgbToXyz50.js
1298
1298
  const convertRgbToXyz50 = (rgb$2) => {
1299
1299
  let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
1300
1300
  let res = {
@@ -1309,7 +1309,7 @@ const convertRgbToXyz50 = (rgb$2) => {
1309
1309
  var convertRgbToXyz50_default = convertRgbToXyz50;
1310
1310
 
1311
1311
  //#endregion
1312
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/convertXyz50ToLab.js
1312
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertXyz50ToLab.js
1313
1313
  const f$1 = (value) => value > e$1 ? Math.cbrt(value) : (k$1 * value + 16) / 116;
1314
1314
  const convertXyz50ToLab = ({ x, y, z, alpha }) => {
1315
1315
  if (x === void 0) x = 0;
@@ -1330,7 +1330,7 @@ const convertXyz50ToLab = ({ x, y, z, alpha }) => {
1330
1330
  var convertXyz50ToLab_default = convertXyz50ToLab;
1331
1331
 
1332
1332
  //#endregion
1333
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/convertRgbToLab.js
1333
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertRgbToLab.js
1334
1334
  const convertRgbToLab = (rgb$2) => {
1335
1335
  let res = convertXyz50ToLab_default(convertRgbToXyz50_default(rgb$2));
1336
1336
  if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
@@ -1339,7 +1339,7 @@ const convertRgbToLab = (rgb$2) => {
1339
1339
  var convertRgbToLab_default = convertRgbToLab;
1340
1340
 
1341
1341
  //#endregion
1342
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/parseLab.js
1342
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/parseLab.js
1343
1343
  function parseLab(color, parsed) {
1344
1344
  if (!parsed || parsed[0] !== "lab") return void 0;
1345
1345
  const res = { mode: "lab" };
@@ -1354,7 +1354,7 @@ function parseLab(color, parsed) {
1354
1354
  var parseLab_default = parseLab;
1355
1355
 
1356
1356
  //#endregion
1357
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab/definition.js
1357
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/definition.js
1358
1358
  const definition$10 = {
1359
1359
  mode: "lab",
1360
1360
  toMode: {
@@ -1373,8 +1373,8 @@ const definition$10 = {
1373
1373
  ],
1374
1374
  ranges: {
1375
1375
  l: [0, 100],
1376
- a: [-100, 100],
1377
- b: [-100, 100]
1376
+ a: [-125, 125],
1377
+ b: [-125, 125]
1378
1378
  },
1379
1379
  parse: [parseLab_default],
1380
1380
  serialize: (c$1) => `lab(${c$1.l !== void 0 ? c$1.l : "none"} ${c$1.a !== void 0 ? c$1.a : "none"} ${c$1.b !== void 0 ? c$1.b : "none"}${c$1.alpha < 1 ? ` / ${c$1.alpha}` : ""})`,
@@ -1388,15 +1388,15 @@ const definition$10 = {
1388
1388
  }
1389
1389
  }
1390
1390
  };
1391
- var definition_default$4 = definition$10;
1391
+ var definition_default$3 = definition$10;
1392
1392
 
1393
1393
  //#endregion
1394
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/constants.js
1394
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/constants.js
1395
1395
  const k = Math.pow(29, 3) / Math.pow(3, 3);
1396
1396
  const e = Math.pow(6, 3) / Math.pow(29, 3);
1397
1397
 
1398
1398
  //#endregion
1399
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/convertLab65ToXyz65.js
1399
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToXyz65.js
1400
1400
  let fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
1401
1401
  const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
1402
1402
  if (l === void 0) l = 0;
@@ -1417,12 +1417,12 @@ const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
1417
1417
  var convertLab65ToXyz65_default = convertLab65ToXyz65;
1418
1418
 
1419
1419
  //#endregion
1420
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/convertLab65ToRgb.js
1420
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToRgb.js
1421
1421
  const convertLab65ToRgb = (lab) => convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab));
1422
1422
  var convertLab65ToRgb_default = convertLab65ToRgb;
1423
1423
 
1424
1424
  //#endregion
1425
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/convertXyz65ToLab65.js
1425
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertXyz65ToLab65.js
1426
1426
  const f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
1427
1427
  const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
1428
1428
  if (x === void 0) x = 0;
@@ -1443,7 +1443,7 @@ const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
1443
1443
  var convertXyz65ToLab65_default = convertXyz65ToLab65;
1444
1444
 
1445
1445
  //#endregion
1446
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/convertRgbToLab65.js
1446
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertRgbToLab65.js
1447
1447
  const convertRgbToLab65 = (rgb$2) => {
1448
1448
  let res = convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$2));
1449
1449
  if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
@@ -1452,9 +1452,9 @@ const convertRgbToLab65 = (rgb$2) => {
1452
1452
  var convertRgbToLab65_default = convertRgbToLab65;
1453
1453
 
1454
1454
  //#endregion
1455
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lab65/definition.js
1455
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/definition.js
1456
1456
  const definition$9 = {
1457
- ...definition_default$4,
1457
+ ...definition_default$3,
1458
1458
  mode: "lab65",
1459
1459
  parse: ["--lab-d65"],
1460
1460
  serialize: "--lab-d65",
@@ -1468,14 +1468,14 @@ const definition$9 = {
1468
1468
  },
1469
1469
  ranges: {
1470
1470
  l: [0, 100],
1471
- a: [-86.182, 98.234],
1472
- b: [-107.86, 94.477]
1471
+ a: [-125, 125],
1472
+ b: [-125, 125]
1473
1473
  }
1474
1474
  };
1475
- var definition_default$5 = definition$9;
1475
+ var definition_default$4 = definition$9;
1476
1476
 
1477
1477
  //#endregion
1478
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lch/convertLabToLch.js
1478
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/convertLabToLch.js
1479
1479
  const convertLabToLch = ({ l, a, b, alpha }, mode = "lch") => {
1480
1480
  if (a === void 0) a = 0;
1481
1481
  if (b === void 0) b = 0;
@@ -1492,7 +1492,7 @@ const convertLabToLch = ({ l, a, b, alpha }, mode = "lch") => {
1492
1492
  var convertLabToLch_default = convertLabToLch;
1493
1493
 
1494
1494
  //#endregion
1495
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lch/convertLchToLab.js
1495
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/convertLchToLab.js
1496
1496
  const convertLchToLab = ({ l, c: c$1, h, alpha }, mode = "lab") => {
1497
1497
  if (h === void 0) h = 0;
1498
1498
  let res = {
@@ -1507,7 +1507,7 @@ const convertLchToLab = ({ l, c: c$1, h, alpha }, mode = "lab") => {
1507
1507
  var convertLchToLab_default = convertLchToLab;
1508
1508
 
1509
1509
  //#endregion
1510
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lch/parseLch.js
1510
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/parseLch.js
1511
1511
  function parseLch(color, parsed) {
1512
1512
  if (!parsed || parsed[0] !== "lch") return void 0;
1513
1513
  const res = { mode: "lch" };
@@ -1527,7 +1527,7 @@ function parseLch(color, parsed) {
1527
1527
  var parseLch_default = parseLch;
1528
1528
 
1529
1529
  //#endregion
1530
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lch/definition.js
1530
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/definition.js
1531
1531
  const definition$8 = {
1532
1532
  mode: "lch",
1533
1533
  toMode: {
@@ -1566,34 +1566,34 @@ const definition$8 = {
1566
1566
  difference: { h: differenceHueChroma },
1567
1567
  average: { h: averageAngle }
1568
1568
  };
1569
- var definition_default$6 = definition$8;
1569
+ var definition_default$5 = definition$8;
1570
1570
 
1571
1571
  //#endregion
1572
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lrgb/definition.js
1572
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/definition.js
1573
1573
  const definition$7 = {
1574
- ...definition_default$13,
1574
+ ...definition_default$12,
1575
1575
  mode: "lrgb",
1576
1576
  toMode: { rgb: convertLrgbToRgb_default },
1577
1577
  fromMode: { rgb: convertRgbToLrgb_default },
1578
1578
  parse: ["srgb-linear"],
1579
1579
  serialize: "srgb-linear"
1580
1580
  };
1581
- var definition_default$7 = definition$7;
1581
+ var definition_default$6 = definition$7;
1582
1582
 
1583
1583
  //#endregion
1584
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertOklabToLrgb.js
1584
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToLrgb.js
1585
1585
  const convertOklabToLrgb = ({ l, a, b, alpha }) => {
1586
1586
  if (l === void 0) l = 0;
1587
1587
  if (a === void 0) a = 0;
1588
1588
  if (b === void 0) b = 0;
1589
- let L = Math.pow(l * .9999999984505198 + .39633779217376786 * a + .2158037580607588 * b, 3);
1590
- let M = Math.pow(l * 1.0000000088817609 - .10556134232365635 * a - .06385417477170591 * b, 3);
1591
- let S = Math.pow(l * 1.0000000546724108 - .08948418209496575 * a - 1.2914855378640917 * b, 3);
1589
+ let L = Math.pow(l + .3963377773761749 * a + .2158037573099136 * b, 3);
1590
+ let M = Math.pow(l - .1055613458156586 * a - .0638541728258133 * b, 3);
1591
+ let S = Math.pow(l - .0894841775298119 * a - 1.2914855480194092 * b, 3);
1592
1592
  let res = {
1593
1593
  mode: "lrgb",
1594
- r: 4.076741661347994 * L - 3.307711590408193 * M + .230969928729428 * S,
1595
- g: -1.2684380040921763 * L + 2.6097574006633715 * M - .3413193963102197 * S,
1596
- b: -.004196086541837188 * L - .7034186144594493 * M + 1.7076147009309444 * S
1594
+ r: 4.076741636075957 * L - 3.3077115392580616 * M + .2309699031821044 * S,
1595
+ g: -1.2684379732850317 * L + 2.6097573492876887 * M - .3413193760026573 * S,
1596
+ b: -.0041960761386756 * L - .7034186179359362 * M + 1.7076146940746117 * S
1597
1597
  };
1598
1598
  if (alpha !== void 0) res.alpha = alpha;
1599
1599
  return res;
@@ -1601,19 +1601,19 @@ const convertOklabToLrgb = ({ l, a, b, alpha }) => {
1601
1601
  var convertOklabToLrgb_default = convertOklabToLrgb;
1602
1602
 
1603
1603
  //#endregion
1604
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertLrgbToOklab.js
1604
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertLrgbToOklab.js
1605
1605
  const convertLrgbToOklab = ({ r: r$1, g, b, alpha }) => {
1606
1606
  if (r$1 === void 0) r$1 = 0;
1607
1607
  if (g === void 0) g = 0;
1608
1608
  if (b === void 0) b = 0;
1609
- let L = Math.cbrt(.41222147079999993 * r$1 + .5363325363 * g + .0514459929 * b);
1610
- let M = Math.cbrt(.2119034981999999 * r$1 + .6806995450999999 * g + .1073969566 * b);
1611
- let S = Math.cbrt(.08830246189999998 * r$1 + .2817188376 * g + .6299787005000002 * b);
1609
+ let L = Math.cbrt(.412221469470763 * r$1 + .5363325372617348 * g + .0514459932675022 * b);
1610
+ let M = Math.cbrt(.2119034958178252 * r$1 + .6806995506452344 * g + .1073969535369406 * b);
1611
+ let S = Math.cbrt(.0883024591900564 * r$1 + .2817188391361215 * g + .6299787016738222 * b);
1612
1612
  let res = {
1613
1613
  mode: "oklab",
1614
- l: .2104542553 * L + .793617785 * M - .0040720468 * S,
1615
- a: 1.9779984951 * L - 2.428592205 * M + .4505937099 * S,
1616
- b: .0259040371 * L + .7827717662 * M - .808675766 * S
1614
+ l: .210454268309314 * L + .7936177747023054 * M - .0040720430116193 * S,
1615
+ a: 1.9779985324311684 * L - 2.42859224204858 * M + .450593709617411 * S,
1616
+ b: .0259040424655478 * L + .7827717124575296 * M - .8086757549230774 * S
1617
1617
  };
1618
1618
  if (alpha !== void 0) res.alpha = alpha;
1619
1619
  return res;
@@ -1621,7 +1621,7 @@ const convertLrgbToOklab = ({ r: r$1, g, b, alpha }) => {
1621
1621
  var convertLrgbToOklab_default = convertLrgbToOklab;
1622
1622
 
1623
1623
  //#endregion
1624
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertRgbToOklab.js
1624
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertRgbToOklab.js
1625
1625
  const convertRgbToOklab = (rgb$2) => {
1626
1626
  let res = convertLrgbToOklab_default(convertRgbToLrgb_default(rgb$2));
1627
1627
  if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
@@ -1630,12 +1630,12 @@ const convertRgbToOklab = (rgb$2) => {
1630
1630
  var convertRgbToOklab_default = convertRgbToOklab;
1631
1631
 
1632
1632
  //#endregion
1633
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertOklabToRgb.js
1633
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToRgb.js
1634
1634
  const convertOklabToRgb = (c$1) => convertLrgbToRgb_default(convertOklabToLrgb_default(c$1));
1635
1635
  var convertOklabToRgb_default = convertOklabToRgb;
1636
1636
 
1637
1637
  //#endregion
1638
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/parseOklab.js
1638
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/parseOklab.js
1639
1639
  function parseOklab(color, parsed) {
1640
1640
  if (!parsed || parsed[0] !== "oklab") return void 0;
1641
1641
  const res = { mode: "oklab" };
@@ -1650,9 +1650,9 @@ function parseOklab(color, parsed) {
1650
1650
  var parseOklab_default = parseOklab;
1651
1651
 
1652
1652
  //#endregion
1653
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/definition.js
1653
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/definition.js
1654
1654
  const definition$6 = {
1655
- ...definition_default$4,
1655
+ ...definition_default$3,
1656
1656
  mode: "oklab",
1657
1657
  toMode: {
1658
1658
  lrgb: convertOklabToLrgb_default,
@@ -1670,10 +1670,10 @@ const definition$6 = {
1670
1670
  parse: [parseOklab_default],
1671
1671
  serialize: (c$1) => `oklab(${c$1.l !== void 0 ? c$1.l : "none"} ${c$1.a !== void 0 ? c$1.a : "none"} ${c$1.b !== void 0 ? c$1.b : "none"}${c$1.alpha < 1 ? ` / ${c$1.alpha}` : ""})`
1672
1672
  };
1673
- var definition_default$8 = definition$6;
1673
+ var definition_default$7 = definition$6;
1674
1674
 
1675
1675
  //#endregion
1676
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklch/parseOklch.js
1676
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklch/parseOklch.js
1677
1677
  function parseOklch(color, parsed) {
1678
1678
  if (!parsed || parsed[0] !== "oklch") return void 0;
1679
1679
  const res = { mode: "oklch" };
@@ -1693,9 +1693,9 @@ function parseOklch(color, parsed) {
1693
1693
  var parseOklch_default = parseOklch;
1694
1694
 
1695
1695
  //#endregion
1696
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklch/definition.js
1696
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklch/definition.js
1697
1697
  const definition$5 = {
1698
- ...definition_default$6,
1698
+ ...definition_default$5,
1699
1699
  mode: "oklch",
1700
1700
  toMode: {
1701
1701
  oklab: (c$1) => convertLchToLab_default(c$1, "oklab"),
@@ -1713,10 +1713,10 @@ const definition$5 = {
1713
1713
  h: [0, 360]
1714
1714
  }
1715
1715
  };
1716
- var definition_default$9 = definition$5;
1716
+ var definition_default$8 = definition$5;
1717
1717
 
1718
1718
  //#endregion
1719
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/convertP3ToXyz65.js
1719
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/convertP3ToXyz65.js
1720
1720
  const convertP3ToXyz65 = (rgb$2) => {
1721
1721
  let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
1722
1722
  let res = {
@@ -1731,7 +1731,7 @@ const convertP3ToXyz65 = (rgb$2) => {
1731
1731
  var convertP3ToXyz65_default = convertP3ToXyz65;
1732
1732
 
1733
1733
  //#endregion
1734
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/convertXyz65ToP3.js
1734
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/convertXyz65ToP3.js
1735
1735
  const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
1736
1736
  if (x === void 0) x = 0;
1737
1737
  if (y === void 0) y = 0;
@@ -1747,9 +1747,9 @@ const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
1747
1747
  var convertXyz65ToP3_default = convertXyz65ToP3;
1748
1748
 
1749
1749
  //#endregion
1750
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/definition.js
1750
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/definition.js
1751
1751
  const definition$4 = {
1752
- ...definition_default$13,
1752
+ ...definition_default$12,
1753
1753
  mode: "p3",
1754
1754
  parse: ["display-p3"],
1755
1755
  serialize: "display-p3",
@@ -1762,10 +1762,10 @@ const definition$4 = {
1762
1762
  xyz65: convertP3ToXyz65_default
1763
1763
  }
1764
1764
  };
1765
- var definition_default$10 = definition$4;
1765
+ var definition_default$9 = definition$4;
1766
1766
 
1767
1767
  //#endregion
1768
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
1768
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
1769
1769
  const gamma$1 = (v) => {
1770
1770
  let abs = Math.abs(v);
1771
1771
  if (abs >= 1 / 512) return Math.sign(v) * Math.pow(abs, 1 / 1.8);
@@ -1787,7 +1787,7 @@ const convertXyz50ToProphoto = ({ x, y, z, alpha }) => {
1787
1787
  var convertXyz50ToProphoto_default = convertXyz50ToProphoto;
1788
1788
 
1789
1789
  //#endregion
1790
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/convertProphotoToXyz50.js
1790
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/convertProphotoToXyz50.js
1791
1791
  const linearize$1 = (v = 0) => {
1792
1792
  let abs = Math.abs(v);
1793
1793
  if (abs >= 16 / 512) return Math.sign(v) * Math.pow(abs, 1.8);
@@ -1809,9 +1809,9 @@ const convertProphotoToXyz50 = (prophoto) => {
1809
1809
  var convertProphotoToXyz50_default = convertProphotoToXyz50;
1810
1810
 
1811
1811
  //#endregion
1812
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/definition.js
1812
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/definition.js
1813
1813
  const definition$3 = {
1814
- ...definition_default$13,
1814
+ ...definition_default$12,
1815
1815
  mode: "prophoto",
1816
1816
  parse: ["prophoto-rgb"],
1817
1817
  serialize: "prophoto-rgb",
@@ -1824,10 +1824,10 @@ const definition$3 = {
1824
1824
  rgb: (color) => convertXyz50ToRgb_default(convertProphotoToXyz50_default(color))
1825
1825
  }
1826
1826
  };
1827
- var definition_default$11 = definition$3;
1827
+ var definition_default$10 = definition$3;
1828
1828
 
1829
1829
  //#endregion
1830
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
1830
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
1831
1831
  const α$1 = 1.09929682680944;
1832
1832
  const β$1 = .018053968510807;
1833
1833
  const gamma = (v) => {
@@ -1851,7 +1851,7 @@ const convertXyz65ToRec2020 = ({ x, y, z, alpha }) => {
1851
1851
  var convertXyz65ToRec2020_default = convertXyz65ToRec2020;
1852
1852
 
1853
1853
  //#endregion
1854
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/convertRec2020ToXyz65.js
1854
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/convertRec2020ToXyz65.js
1855
1855
  const α = 1.09929682680944;
1856
1856
  const β = .018053968510807;
1857
1857
  const linearize = (v = 0) => {
@@ -1875,9 +1875,9 @@ const convertRec2020ToXyz65 = (rec2020) => {
1875
1875
  var convertRec2020ToXyz65_default = convertRec2020ToXyz65;
1876
1876
 
1877
1877
  //#endregion
1878
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/definition.js
1878
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/definition.js
1879
1879
  const definition$2 = {
1880
- ...definition_default$13,
1880
+ ...definition_default$12,
1881
1881
  mode: "rec2020",
1882
1882
  fromMode: {
1883
1883
  xyz65: convertXyz65ToRec2020_default,
@@ -1890,10 +1890,10 @@ const definition$2 = {
1890
1890
  parse: ["rec2020"],
1891
1891
  serialize: "rec2020"
1892
1892
  };
1893
- var definition_default$12 = definition$2;
1893
+ var definition_default$11 = definition$2;
1894
1894
 
1895
1895
  //#endregion
1896
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/definition.js
1896
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/definition.js
1897
1897
  const definition$1 = {
1898
1898
  mode: "xyz50",
1899
1899
  parse: ["xyz-d50"],
@@ -1927,10 +1927,10 @@ const definition$1 = {
1927
1927
  }
1928
1928
  }
1929
1929
  };
1930
- var definition_default$14 = definition$1;
1930
+ var definition_default$13 = definition$1;
1931
1931
 
1932
1932
  //#endregion
1933
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
1933
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
1934
1934
  const convertXyz65ToXyz50 = (xyz65) => {
1935
1935
  let { x, y, z, alpha } = xyz65;
1936
1936
  if (x === void 0) x = 0;
@@ -1948,7 +1948,7 @@ const convertXyz65ToXyz50 = (xyz65) => {
1948
1948
  var convertXyz65ToXyz50_default = convertXyz65ToXyz50;
1949
1949
 
1950
1950
  //#endregion
1951
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/convertXyz50ToXyz65.js
1951
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz50ToXyz65.js
1952
1952
  const convertXyz50ToXyz65 = (xyz50) => {
1953
1953
  let { x, y, z, alpha } = xyz50;
1954
1954
  if (x === void 0) x = 0;
@@ -1966,7 +1966,7 @@ const convertXyz50ToXyz65 = (xyz50) => {
1966
1966
  var convertXyz50ToXyz65_default = convertXyz50ToXyz65;
1967
1967
 
1968
1968
  //#endregion
1969
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/definition.js
1969
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/definition.js
1970
1970
  const definition = {
1971
1971
  mode: "xyz65",
1972
1972
  toMode: {
@@ -2000,16 +2000,193 @@ const definition = {
2000
2000
  }
2001
2001
  }
2002
2002
  };
2003
- var definition_default$15 = definition;
2003
+ var definition_default$14 = definition;
2004
+
2005
+ //#endregion
2006
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsl/helpers.js
2007
+ function toe(x) {
2008
+ const k_1 = .206;
2009
+ const k_2 = .03;
2010
+ const k_3 = (1 + k_1) / (1 + k_2);
2011
+ return .5 * (k_3 * x - k_1 + Math.sqrt((k_3 * x - k_1) * (k_3 * x - k_1) + 4 * k_2 * k_3 * x));
2012
+ }
2013
+ function toe_inv(x) {
2014
+ const k_1 = .206;
2015
+ const k_2 = .03;
2016
+ const k_3 = (1 + k_1) / (1 + k_2);
2017
+ return (x * x + k_1 * x) / (k_3 * (x + k_2));
2018
+ }
2019
+ function compute_max_saturation(a, b) {
2020
+ let k0, k1, k2, k3, k4, wl, wm, ws;
2021
+ if (-1.88170328 * a - .80936493 * b > 1) {
2022
+ k0 = 1.19086277;
2023
+ k1 = 1.76576728;
2024
+ k2 = .59662641;
2025
+ k3 = .75515197;
2026
+ k4 = .56771245;
2027
+ wl = 4.0767416621;
2028
+ wm = -3.3077115913;
2029
+ ws = .2309699292;
2030
+ } else if (1.81444104 * a - 1.19445276 * b > 1) {
2031
+ k0 = .73956515;
2032
+ k1 = -.45954404;
2033
+ k2 = .08285427;
2034
+ k3 = .1254107;
2035
+ k4 = .14503204;
2036
+ wl = -1.2684380046;
2037
+ wm = 2.6097574011;
2038
+ ws = -.3413193965;
2039
+ } else {
2040
+ k0 = 1.35733652;
2041
+ k1 = -.00915799;
2042
+ k2 = -1.1513021;
2043
+ k3 = -.50559606;
2044
+ k4 = .00692167;
2045
+ wl = -.0041960863;
2046
+ wm = -.7034186147;
2047
+ ws = 1.707614701;
2048
+ }
2049
+ let S = k0 + k1 * a + k2 * b + k3 * a * a + k4 * a * b;
2050
+ let k_l = .3963377774 * a + .2158037573 * b;
2051
+ let k_m = -.1055613458 * a - .0638541728 * b;
2052
+ let k_s = -.0894841775 * a - 1.291485548 * b;
2053
+ {
2054
+ let l_ = 1 + S * k_l;
2055
+ let m_ = 1 + S * k_m;
2056
+ let s_ = 1 + S * k_s;
2057
+ let l = l_ * l_ * l_;
2058
+ let m = m_ * m_ * m_;
2059
+ let s = s_ * s_ * s_;
2060
+ let l_dS = 3 * k_l * l_ * l_;
2061
+ let m_dS = 3 * k_m * m_ * m_;
2062
+ let s_dS = 3 * k_s * s_ * s_;
2063
+ let l_dS2 = 6 * k_l * k_l * l_;
2064
+ let m_dS2 = 6 * k_m * k_m * m_;
2065
+ let s_dS2 = 6 * k_s * k_s * s_;
2066
+ let f$2 = wl * l + wm * m + ws * s;
2067
+ let f1 = wl * l_dS + wm * m_dS + ws * s_dS;
2068
+ let f2 = wl * l_dS2 + wm * m_dS2 + ws * s_dS2;
2069
+ S = S - f$2 * f1 / (f1 * f1 - .5 * f$2 * f2);
2070
+ }
2071
+ return S;
2072
+ }
2073
+ function find_cusp(a, b) {
2074
+ let S_cusp = compute_max_saturation(a, b);
2075
+ let rgb$2 = convertOklabToLrgb_default({
2076
+ l: 1,
2077
+ a: S_cusp * a,
2078
+ b: S_cusp * b
2079
+ });
2080
+ let L_cusp = Math.cbrt(1 / Math.max(rgb$2.r, rgb$2.g, rgb$2.b));
2081
+ let C_cusp = L_cusp * S_cusp;
2082
+ return [L_cusp, C_cusp];
2083
+ }
2084
+ function get_ST_max(a_, b_, cusp = null) {
2085
+ if (!cusp) cusp = find_cusp(a_, b_);
2086
+ let L = cusp[0];
2087
+ let C = cusp[1];
2088
+ return [C / L, C / (1 - L)];
2089
+ }
2004
2090
 
2005
2091
  //#endregion
2006
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/round.js
2092
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/convertOklabToOkhsv.js
2093
+ function convertOklabToOkhsv(lab) {
2094
+ let l = lab.l !== void 0 ? lab.l : 0;
2095
+ let a = lab.a !== void 0 ? lab.a : 0;
2096
+ let b = lab.b !== void 0 ? lab.b : 0;
2097
+ let c$1 = Math.sqrt(a * a + b * b);
2098
+ let a_ = c$1 ? a / c$1 : 1;
2099
+ let b_ = c$1 ? b / c$1 : 1;
2100
+ let [S_max, T] = get_ST_max(a_, b_);
2101
+ let S_0 = .5;
2102
+ let k$3 = 1 - S_0 / S_max;
2103
+ let t = T / (c$1 + l * T);
2104
+ let L_v = t * l;
2105
+ let C_v = t * c$1;
2106
+ let L_vt = toe_inv(L_v);
2107
+ let C_vt = C_v * L_vt / L_v;
2108
+ let rgb_scale = convertOklabToLrgb_default({
2109
+ l: L_vt,
2110
+ a: a_ * C_vt,
2111
+ b: b_ * C_vt
2112
+ });
2113
+ let scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
2114
+ l = l / scale_L;
2115
+ c$1 = c$1 / scale_L * toe(l) / l;
2116
+ l = toe(l);
2117
+ const ret = {
2118
+ mode: "okhsv",
2119
+ s: c$1 ? (S_0 + T) * C_v / (T * S_0 + T * k$3 * C_v) : 0,
2120
+ v: l ? l / L_v : 0
2121
+ };
2122
+ if (ret.s) ret.h = normalizeHue_default(Math.atan2(b, a) * 180 / Math.PI);
2123
+ if (lab.alpha !== void 0) ret.alpha = lab.alpha;
2124
+ return ret;
2125
+ }
2126
+
2127
+ //#endregion
2128
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/convertOkhsvToOklab.js
2129
+ function convertOkhsvToOklab(hsv) {
2130
+ const ret = { mode: "oklab" };
2131
+ if (hsv.alpha !== void 0) ret.alpha = hsv.alpha;
2132
+ const h = hsv.h !== void 0 ? hsv.h : 0;
2133
+ const s = hsv.s !== void 0 ? hsv.s : 0;
2134
+ const v = hsv.v !== void 0 ? hsv.v : 0;
2135
+ const a_ = Math.cos(h / 180 * Math.PI);
2136
+ const b_ = Math.sin(h / 180 * Math.PI);
2137
+ const [S_max, T] = get_ST_max(a_, b_);
2138
+ const S_0 = .5;
2139
+ const k$3 = 1 - S_0 / S_max;
2140
+ const L_v = 1 - s * S_0 / (S_0 + T - T * k$3 * s);
2141
+ const C_v = s * T * S_0 / (S_0 + T - T * k$3 * s);
2142
+ const L_vt = toe_inv(L_v);
2143
+ const C_vt = C_v * L_vt / L_v;
2144
+ const rgb_scale = convertOklabToLrgb_default({
2145
+ l: L_vt,
2146
+ a: a_ * C_vt,
2147
+ b: b_ * C_vt
2148
+ });
2149
+ const scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
2150
+ const L_new = toe_inv(v * L_v);
2151
+ const C = C_v * L_new / L_v;
2152
+ ret.l = L_new * scale_L;
2153
+ ret.a = C * a_ * scale_L;
2154
+ ret.b = C * b_ * scale_L;
2155
+ return ret;
2156
+ }
2157
+
2158
+ //#endregion
2159
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/modeOkhsv.js
2160
+ const modeOkhsv = {
2161
+ ...definition_default$15,
2162
+ mode: "okhsv",
2163
+ channels: [
2164
+ "h",
2165
+ "s",
2166
+ "v",
2167
+ "alpha"
2168
+ ],
2169
+ parse: ["--okhsv"],
2170
+ serialize: "--okhsv",
2171
+ fromMode: {
2172
+ oklab: convertOklabToOkhsv,
2173
+ rgb: (c$1) => convertOklabToOkhsv(convertRgbToOklab_default(c$1))
2174
+ },
2175
+ toMode: {
2176
+ oklab: convertOkhsvToOklab,
2177
+ rgb: (c$1) => convertOklabToRgb_default(convertOkhsvToOklab(c$1))
2178
+ }
2179
+ };
2180
+ var modeOkhsv_default = modeOkhsv;
2181
+
2182
+ //#endregion
2183
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/round.js
2007
2184
  const r = (value, precision) => Math.round(value * (precision = Math.pow(10, precision))) / precision;
2008
2185
  const round = (precision = 4) => (value) => typeof value === "number" ? r(value, precision) : value;
2009
2186
  var round_default = round;
2010
2187
 
2011
2188
  //#endregion
2012
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/formatter.js
2189
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/formatter.js
2013
2190
  let twoDecimals = round_default(2);
2014
2191
  const clamp = (value) => Math.max(0, Math.min(1, value || 0));
2015
2192
  const fixup = (value) => Math.round(clamp(value) * 255);
@@ -2046,7 +2223,7 @@ const formatHex = (c$1) => serializeHex(rgb$1(c$1));
2046
2223
  const formatHex8 = (c$1) => serializeHex8(rgb$1(c$1));
2047
2224
 
2048
2225
  //#endregion
2049
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/clamp.js
2226
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/clamp.js
2050
2227
  const rgb = converter_default("rgb");
2051
2228
  const fixup_rgb = (c$1) => {
2052
2229
  const res = {
@@ -2094,6 +2271,7 @@ function toGamut(dest = "rgb", mode = "oklch", delta = differenceEuclidean("oklc
2094
2271
  const clipToGamut = clampGamut(dest);
2095
2272
  const ucs = converter_default(mode);
2096
2273
  const { ranges } = getMode(mode);
2274
+ if (!ranges.l || !ranges.c) throw new Error("LCH-like space expected");
2097
2275
  return (color) => {
2098
2276
  color = _prepare_default(color);
2099
2277
  if (color === void 0) return void 0;
@@ -2132,12 +2310,11 @@ function toGamut(dest = "rgb", mode = "oklch", delta = differenceEuclidean("oklc
2132
2310
  }
2133
2311
 
2134
2312
  //#endregion
2135
- //#region ../token-tools/dist/string-Cq7Oa0sE.js
2313
+ //#region ../token-tools/dist/string-BwN3ybNv.js
2136
2314
  const HEX_RE = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i;
2137
2315
  const CULORI_TO_CSS = {
2138
- a98: "a98",
2316
+ a98: "a98-rgb",
2139
2317
  hsl: "hsl",
2140
- hsv: "hsv",
2141
2318
  hwb: "hwb",
2142
2319
  lab: "lab",
2143
2320
  lab65: "lab-d65",
@@ -2145,6 +2322,7 @@ const CULORI_TO_CSS = {
2145
2322
  lrgb: "srgb-linear",
2146
2323
  oklab: "oklab",
2147
2324
  oklch: "oklch",
2325
+ okhsv: "okhsv",
2148
2326
  p3: "display-p3",
2149
2327
  prophoto: "prophoto-rgb",
2150
2328
  rec2020: "rec2020",
@@ -2153,20 +2331,21 @@ const CULORI_TO_CSS = {
2153
2331
  xyz65: "xyz-d65"
2154
2332
  };
2155
2333
  const CSS_TO_CULORI = {
2156
- a98: "a98",
2334
+ "a98-rgb": "a98",
2157
2335
  "display-p3": "p3",
2158
2336
  hsl: "hsl",
2159
- hsv: "hsv",
2160
2337
  hwb: "hwb",
2161
2338
  lab: "lab",
2162
2339
  "lab-d65": "lab65",
2163
2340
  lch: "lch",
2164
2341
  oklab: "oklab",
2165
2342
  oklch: "oklch",
2343
+ okhsv: "okhsv",
2166
2344
  "prophoto-rgb": "prophoto",
2167
2345
  rec2020: "rec2020",
2168
2346
  srgb: "rgb",
2169
2347
  "srgb-linear": "lrgb",
2348
+ xyz: "xyz65",
2170
2349
  "xyz-d50": "xyz50",
2171
2350
  "xyz-d65": "xyz65"
2172
2351
  };
@@ -2196,26 +2375,22 @@ function parseColor(color) {
2196
2375
  break;
2197
2376
  }
2198
2377
  case "hsl": {
2378
+ const maxS = COLORSPACE[colorSpace].ranges[1]?.[1] ?? 1;
2379
+ const maxL = COLORSPACE[colorSpace].ranges[2]?.[1] ?? 1;
2199
2380
  components = [
2200
2381
  result.h ?? 0,
2201
- result.s,
2202
- result.l
2203
- ];
2204
- break;
2205
- }
2206
- case "hsv": {
2207
- components = [
2208
- result.h ?? 0,
2209
- result.s,
2210
- result.v
2382
+ result.s * maxS,
2383
+ result.l * maxL
2211
2384
  ];
2212
2385
  break;
2213
2386
  }
2214
2387
  case "hwb": {
2388
+ const maxW = COLORSPACE[colorSpace].ranges[1]?.[1] ?? 1;
2389
+ const maxB = COLORSPACE[colorSpace].ranges[2]?.[1] ?? 1;
2215
2390
  components = [
2216
2391
  result.h ?? 0,
2217
- result.w,
2218
- result.b
2392
+ result.w * maxW,
2393
+ result.b * maxB
2219
2394
  ];
2220
2395
  break;
2221
2396
  }
@@ -2238,6 +2413,14 @@ function parseColor(color) {
2238
2413
  ];
2239
2414
  break;
2240
2415
  }
2416
+ case "okhsv": {
2417
+ components = [
2418
+ result.h ?? 0,
2419
+ result.s,
2420
+ result.v
2421
+ ];
2422
+ break;
2423
+ }
2241
2424
  case "xyz50":
2242
2425
  case "xyz65": {
2243
2426
  components = [
@@ -2259,7 +2442,7 @@ function parseColor(color) {
2259
2442
  /** Convert a color token to a Culori color */
2260
2443
  function tokenToCulori(value) {
2261
2444
  switch (value.colorSpace) {
2262
- case "a98":
2445
+ case "a98-rgb":
2263
2446
  case "display-p3":
2264
2447
  case "prophoto-rgb":
2265
2448
  case "rec2020":
@@ -2276,31 +2459,25 @@ function tokenToCulori(value) {
2276
2459
  }
2277
2460
  case "hsl": {
2278
2461
  const [h, s, l] = value.components;
2462
+ const maxS = COLORSPACE[value.colorSpace].ranges[1]?.[1] ?? 1;
2463
+ const maxL = COLORSPACE[value.colorSpace].ranges[2]?.[1] ?? 1;
2279
2464
  return {
2280
2465
  mode: "hsl",
2281
2466
  h,
2282
- s,
2283
- l,
2284
- alpha: value.alpha
2285
- };
2286
- }
2287
- case "hsv": {
2288
- const [h, s, v] = value.components;
2289
- return {
2290
- mode: "hsv",
2291
- h,
2292
- s,
2293
- v,
2467
+ s: s / maxS,
2468
+ l: l / maxL,
2294
2469
  alpha: value.alpha
2295
2470
  };
2296
2471
  }
2297
2472
  case "hwb": {
2298
2473
  const [h, w, b] = value.components;
2474
+ const maxW = COLORSPACE[value.colorSpace].ranges[1]?.[1] ?? 1;
2475
+ const maxB = COLORSPACE[value.colorSpace].ranges[2]?.[1] ?? 1;
2299
2476
  return {
2300
2477
  mode: "hwb",
2301
2478
  h,
2302
- w,
2303
- b,
2479
+ w: w / maxW,
2480
+ b: b / maxB,
2304
2481
  alpha: value.alpha
2305
2482
  };
2306
2483
  }
@@ -2328,20 +2505,22 @@ function tokenToCulori(value) {
2328
2505
  alpha: value.alpha
2329
2506
  };
2330
2507
  }
2331
- case "xyz-d50": {
2332
- const [x, y, z] = value.components;
2508
+ case "okhsv": {
2509
+ const [h, s, v] = value.components;
2333
2510
  return {
2334
- mode: "xyz50",
2335
- x,
2336
- y,
2337
- z,
2511
+ mode: value.colorSpace,
2512
+ h,
2513
+ s,
2514
+ v,
2338
2515
  alpha: value.alpha
2339
2516
  };
2340
2517
  }
2518
+ case "xyz":
2519
+ case "xyz-d50":
2341
2520
  case "xyz-d65": {
2342
2521
  const [x, y, z] = value.components;
2343
2522
  return {
2344
- mode: "xyz65",
2523
+ mode: CSS_TO_CULORI[value.colorSpace],
2345
2524
  x,
2346
2525
  y,
2347
2526
  z,
@@ -2351,6 +2530,94 @@ function tokenToCulori(value) {
2351
2530
  default: throw new Error(`Invalid colorSpace "${value.colorSpace}". Expected one of ${Object.keys(CSS_TO_CULORI).join(", ")}`);
2352
2531
  }
2353
2532
  }
2533
+ /** Complete list of CSS Module 4 Colorspaces */
2534
+ const COLORSPACE = {
2535
+ "a98-rgb": { ranges: [
2536
+ [0, 1],
2537
+ [0, 1],
2538
+ [0, 1]
2539
+ ] },
2540
+ "display-p3": { ranges: [
2541
+ [0, 1],
2542
+ [0, 1],
2543
+ [0, 1]
2544
+ ] },
2545
+ hsl: { ranges: [
2546
+ [0, 360],
2547
+ [0, 100],
2548
+ [0, 100]
2549
+ ] },
2550
+ hwb: { ranges: [
2551
+ [0, 360],
2552
+ [0, 100],
2553
+ [0, 100]
2554
+ ] },
2555
+ lab: { ranges: [
2556
+ [0, 100],
2557
+ [-125, 125],
2558
+ [-125, 125]
2559
+ ] },
2560
+ "lab-d65": { ranges: [
2561
+ [0, 100],
2562
+ [-125, 125],
2563
+ [-125, 125]
2564
+ ] },
2565
+ lch: { ranges: [
2566
+ [0, 100],
2567
+ [0, 150],
2568
+ [0, 360]
2569
+ ] },
2570
+ oklab: { ranges: [
2571
+ [0, 1],
2572
+ [-.4, .4],
2573
+ [-.4, .4]
2574
+ ] },
2575
+ oklch: { ranges: [
2576
+ [0, 1],
2577
+ [0, .4],
2578
+ [0, 360]
2579
+ ] },
2580
+ okhsv: { ranges: [
2581
+ [0, 360],
2582
+ [0, 1],
2583
+ [0, 1]
2584
+ ] },
2585
+ "prophoto-rgb": { ranges: [
2586
+ [0, 1],
2587
+ [0, 1],
2588
+ [0, 1]
2589
+ ] },
2590
+ rec2020: { ranges: [
2591
+ [0, 1],
2592
+ [0, 1],
2593
+ [0, 1]
2594
+ ] },
2595
+ srgb: { ranges: [
2596
+ [0, 1],
2597
+ [0, 1],
2598
+ [0, 1]
2599
+ ] },
2600
+ "srgb-linear": { ranges: [
2601
+ [0, 1],
2602
+ [0, 1],
2603
+ [0, 1]
2604
+ ] },
2605
+ "xyz-d50": { ranges: [
2606
+ [0, 1],
2607
+ [0, 1],
2608
+ [0, 1]
2609
+ ] },
2610
+ xyz: { ranges: [
2611
+ [0, 1],
2612
+ [0, 1],
2613
+ [0, 1]
2614
+ ] },
2615
+ "xyz-d65": { ranges: [
2616
+ [0, 1],
2617
+ [0, 1],
2618
+ [0, 1]
2619
+ ] }
2620
+ };
2354
2621
  /** Turn a string into kebab-case */
2355
2622
  function kebabCase(str) {
2356
2623
  let output = "";
@@ -2547,25 +2814,31 @@ function transformColor(token, options) {
2547
2814
  colorSpace,
2548
2815
  components,
2549
2816
  alpha
2550
- }, color);
2817
+ }, color, options.color?.depth);
2551
2818
  }
2552
2819
  const converters = {
2553
2820
  a98: useMode(definition_default),
2554
2821
  hsl: useMode(definition_default$1),
2555
- hsv: useMode(definition_default$2),
2556
- hwb: useMode(definition_default$3),
2557
- lab: useMode(definition_default$4),
2558
- lab65: useMode(definition_default$5),
2559
- lch: useMode(definition_default$6),
2560
- lrgb: useMode(definition_default$7),
2561
- oklab: useMode(definition_default$8),
2562
- oklch: useMode(definition_default$9),
2563
- p3: useMode(definition_default$10),
2564
- prophoto: useMode(definition_default$11),
2565
- rec2020: useMode(definition_default$12),
2566
- rgb: useMode(definition_default$13),
2567
- xyz50: useMode(definition_default$14),
2568
- xyz65: useMode(definition_default$15)
2822
+ hwb: useMode(definition_default$2),
2823
+ lab: useMode(definition_default$3),
2824
+ lab65: useMode(definition_default$4),
2825
+ lch: useMode(definition_default$5),
2826
+ lrgb: useMode(definition_default$6),
2827
+ oklab: useMode(definition_default$7),
2828
+ oklch: useMode(definition_default$8),
2829
+ okhsv: useMode(modeOkhsv_default),
2830
+ p3: useMode(definition_default$9),
2831
+ prophoto: useMode(definition_default$10),
2832
+ rec2020: useMode(definition_default$11),
2833
+ rgb: useMode(definition_default$12),
2834
+ xyz50: useMode(definition_default$13),
2835
+ xyz65: useMode(definition_default$14)
2836
+ };
2837
+ const DEPTH_ROUNDING = {
2838
+ 24: round_default(4),
2839
+ 30: round_default(4),
2840
+ 36: round_default(5),
2841
+ 48: round_default(6)
2569
2842
  };
2570
2843
  /**
2571
2844
  * Downsample color to sRGB/Display P3/Rec2020 colorspaces.
@@ -2573,15 +2846,21 @@ const converters = {
2573
2846
  * we have to do an additional step of converting back. So we’re not really converting;
2574
2847
  * we’re just preserving the original colorspace.
2575
2848
  */
2576
- function downsample($value, culoriColor) {
2849
+ function downsample($value, culoriColor, depth = 30) {
2577
2850
  if (!($value.colorSpace in CSS_TO_CULORI)) throw new Error(`Invalid colorSpace "${$value.colorSpace}". Expected one of: ${Object.keys(CSS_TO_CULORI).join(", ")}`);
2578
2851
  const conversionSpace = CSS_TO_CULORI[$value.colorSpace] || "oklab";
2579
2852
  let gamutSpace = conversionSpace;
2580
2853
  if (gamutSpace === "lab" || gamutSpace === "lab65") gamutSpace = "lch";
2581
2854
  else if (gamutSpace === "oklab") gamutSpace = "oklch";
2582
- const srgb = converters[conversionSpace](toGamut("rgb", gamutSpace)(culoriColor));
2583
- const p3 = converters[conversionSpace](toGamut("p3", gamutSpace)(culoriColor));
2584
- const rec2020 = converters[conversionSpace](toGamut("rec2020", gamutSpace)(culoriColor));
2855
+ let srgb = converters[conversionSpace](toGamut("rgb", gamutSpace)(culoriColor));
2856
+ let p3 = converters[conversionSpace](toGamut("p3", gamutSpace)(culoriColor));
2857
+ let rec2020 = converters[conversionSpace](toGamut("rec2020", gamutSpace)(culoriColor));
2858
+ if (typeof depth === "number") {
2859
+ if (!DEPTH_ROUNDING[depth]) throw new Error(`Invalid bit depth: ${depth}. Supported values: ${Object.keys(DEPTH_ROUNDING).join(", ")}`);
2860
+ srgb = roundColor(srgb, depth);
2861
+ p3 = roundColor(p3, depth);
2862
+ rec2020 = roundColor(rec2020, depth);
2863
+ }
2585
2864
  return {
2586
2865
  ".": formatCss(culoriColor),
2587
2866
  srgb: formatCss(srgb),
@@ -2589,6 +2868,16 @@ function downsample($value, culoriColor) {
2589
2868
  rec2020: formatCss(rec2020)
2590
2869
  };
2591
2870
  }
2871
+ /** Round color to certain depth. */
2872
+ function roundColor(color, depth = 30) {
2873
+ if (depth === "unlimited") return color;
2874
+ const newColor = { ...color };
2875
+ for (const [k$3, v] of Object.entries(color)) {
2876
+ if (typeof v !== "number" || k$3 === "mode") continue;
2877
+ newColor[k$3] = DEPTH_ROUNDING[depth](v);
2878
+ }
2879
+ return newColor;
2880
+ }
2592
2881
  /** Convert dimension value to CSS */
2593
2882
  function transformDimension(token, options) {
2594
2883
  const { tokensSet, transformAlias = defaultAliasTransform } = options;