@terrazzo/plugin-css 0.10.0 → 0.10.2

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}%`;
@@ -211,12 +211,12 @@ const num_per_none = `(?:${num$1}%|${num$1}|none)`;
211
211
  const hue$1 = `(?:${num$1}(deg|grad|rad|turn)|${num$1})`;
212
212
  const hue_none = `(?:${num$1}(deg|grad|rad|turn)|${num$1}|none)`;
213
213
  const c = `\\s*,\\s*`;
214
- const rx_num_per_none = new RegExp("^" + num_per_none + "$");
214
+ const rx_num_per_none = /* @__PURE__ */ 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
218
- const rgb_num_old = new RegExp(`^rgba?\\(\\s*${num$1}${c}${num$1}${c}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
219
- const rgb_per_old = new RegExp(`^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
217
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseRgbLegacy.js
218
+ const rgb_num_old = /* @__PURE__ */ new RegExp(`^rgba?\\(\\s*${num$1}${c}${num$1}${c}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
219
+ const rgb_per_old = /* @__PURE__ */ new RegExp(`^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
220
220
  const parseRgbLegacy = (color) => {
221
221
  let res = { mode: "rgb" };
222
222
  let match;
@@ -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,39 +244,39 @@ 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 = [];
256
256
  const colorProfiles = {};
257
257
  const identity = (v) => v;
258
- const useMode = (definition$16) => {
259
- converters$1[definition$16.mode] = {
260
- ...converters$1[definition$16.mode],
261
- ...definition$16.toMode
258
+ const useMode = (definition$28) => {
259
+ converters$1[definition$28.mode] = {
260
+ ...converters$1[definition$28.mode],
261
+ ...definition$28.toMode
262
262
  };
263
- Object.keys(definition$16.fromMode || {}).forEach((k$3) => {
263
+ Object.keys(definition$28.fromMode || {}).forEach((k$3) => {
264
264
  if (!converters$1[k$3]) converters$1[k$3] = {};
265
- converters$1[k$3][definition$16.mode] = definition$16.fromMode[k$3];
265
+ converters$1[k$3][definition$28.mode] = definition$28.fromMode[k$3];
266
266
  });
267
- if (!definition$16.ranges) definition$16.ranges = {};
268
- if (!definition$16.difference) definition$16.difference = {};
269
- definition$16.channels.forEach((channel) => {
270
- if (definition$16.ranges[channel] === void 0) definition$16.ranges[channel] = [0, 1];
271
- if (!definition$16.interpolate[channel]) throw new Error(`Missing interpolator for: ${channel}`);
272
- if (typeof definition$16.interpolate[channel] === "function") definition$16.interpolate[channel] = { use: definition$16.interpolate[channel] };
273
- if (!definition$16.interpolate[channel].fixup) definition$16.interpolate[channel].fixup = identity;
267
+ if (!definition$28.ranges) definition$28.ranges = {};
268
+ if (!definition$28.difference) definition$28.difference = {};
269
+ definition$28.channels.forEach((channel) => {
270
+ if (definition$28.ranges[channel] === void 0) definition$28.ranges[channel] = [0, 1];
271
+ if (!definition$28.interpolate[channel]) throw new Error(`Missing interpolator for: ${channel}`);
272
+ if (typeof definition$28.interpolate[channel] === "function") definition$28.interpolate[channel] = { use: definition$28.interpolate[channel] };
273
+ if (!definition$28.interpolate[channel].fixup) definition$28.interpolate[channel].fixup = identity;
274
274
  });
275
- modes[definition$16.mode] = definition$16;
276
- (definition$16.parse || []).forEach((parser) => {
277
- useParser(parser, definition$16.mode);
275
+ modes[definition$28.mode] = definition$28;
276
+ (definition$28.parse || []).forEach((parser) => {
277
+ useParser(parser, definition$28.mode);
278
278
  });
279
- return converter_default(definition$16.mode);
279
+ return converter_default(definition$28.mode);
280
280
  };
281
281
  const getMode = (mode) => modes[mode];
282
282
  const useParser = (parser, mode) => {
@@ -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,8 +614,8 @@ 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
618
- const definition$15 = {
617
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/definition.js
618
+ const definition$27 = {
619
619
  mode: "rgb",
620
620
  channels: [
621
621
  "r",
@@ -653,28 +653,28 @@ const definition$15 = {
653
653
  b: 0
654
654
  }
655
655
  };
656
- var definition_default$12 = definition$15;
656
+ var definition_default$12 = definition$27;
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
- const convertA98ToXyz65 = (a98) => {
662
- let r$1 = linearize$2(a98.r);
663
- let g = linearize$2(a98.g);
664
- let b = linearize$2(a98.b);
661
+ const convertA98ToXyz65 = (a98$2) => {
662
+ let r$1 = linearize$2(a98$2.r);
663
+ let g = linearize$2(a98$2.g);
664
+ let b = linearize$2(a98$2.b);
665
665
  let res = {
666
666
  mode: "xyz65",
667
667
  x: .5766690429101305 * r$1 + .1855582379065463 * g + .1882286462349947 * b,
668
668
  y: .297344975250536 * r$1 + .6273635662554661 * g + .0752914584939979 * b,
669
669
  z: .0270313613864123 * r$1 + .0706888525358272 * g + .9913375368376386 * b
670
670
  };
671
- if (a98.alpha !== void 0) res.alpha = a98.alpha;
671
+ if (a98$2.alpha !== void 0) res.alpha = a98$2.alpha;
672
672
  return res;
673
673
  };
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,11 +692,11 @@ 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
- const abs = Math.abs(c$1);
698
- if (abs <= .04045) return c$1 / 12.92;
699
- return (Math.sign(c$1) || 1) * Math.pow((abs + .055) / 1.055, 2.4);
697
+ const abs$1 = Math.abs(c$1);
698
+ if (abs$1 <= .04045) return c$1 / 12.92;
699
+ return (Math.sign(c$1) || 1) * Math.pow((abs$1 + .055) / 1.055, 2.4);
700
700
  };
701
701
  const convertRgbToLrgb = ({ r: r$1, g, b, alpha }) => {
702
702
  let res = {
@@ -711,9 +711,9 @@ 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
715
- const convertRgbToXyz65 = (rgb$2) => {
716
- let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
714
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertRgbToXyz65.js
715
+ const convertRgbToXyz65 = (rgb$4) => {
716
+ let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$4);
717
717
  let res = {
718
718
  mode: "xyz65",
719
719
  x: .4123907992659593 * r$1 + .357584339383878 * g + .1804807884018343 * b,
@@ -726,10 +726,10 @@ 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
- const abs = Math.abs(c$1);
732
- if (abs > .0031308) return (Math.sign(c$1) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
731
+ const abs$1 = Math.abs(c$1);
732
+ if (abs$1 > .0031308) return (Math.sign(c$1) || 1) * (1.055 * Math.pow(abs$1, 1 / 2.4) - .055);
733
733
  return c$1 * 12.92;
734
734
  };
735
735
  const convertLrgbToRgb = ({ r: r$1, g, b, alpha }, mode = "rgb") => {
@@ -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,8 +761,8 @@ 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
765
- const definition$14 = {
764
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/definition.js
765
+ const definition$26 = {
766
766
  ...definition_default$12,
767
767
  mode: "a98",
768
768
  parse: ["a98-rgb"],
@@ -776,15 +776,15 @@ const definition$14 = {
776
776
  xyz65: convertA98ToXyz65_default
777
777
  }
778
778
  };
779
- var definition_default = definition$14;
779
+ var definition_default = definition$26;
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,24 +847,24 @@ 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;
854
854
  if (b === void 0) b = 0;
855
- let M = Math.max(r$1, g, b), m = Math.min(r$1, g, b);
855
+ let M$1 = Math.max(r$1, g, b), m = Math.min(r$1, g, b);
856
856
  let res = {
857
857
  mode: "hsl",
858
- s: M === m ? 0 : (M - m) / (1 - Math.abs(M + m - 1)),
859
- l: .5 * (M + m)
858
+ s: M$1 === m ? 0 : (M$1 - m) / (1 - Math.abs(M$1 + m - 1)),
859
+ l: .5 * (M$1 + m)
860
860
  };
861
- if (M - m !== 0) res.h = (M === r$1 ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r$1) / (M - m) + 2 : (r$1 - g) / (M - m) + 4) * 60;
861
+ if (M$1 - m !== 0) res.h = (M$1 === r$1 ? (g - b) / (M$1 - m) + (g < b) * 6 : M$1 === g ? (b - r$1) / (M$1 - m) + 2 : (r$1 - g) / (M$1 - m) + 4) * 60;
862
862
  if (alpha !== void 0) res.alpha = alpha;
863
863
  return res;
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,8 +876,8 @@ 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
880
- const hsl_old = new RegExp(`^hsla?\\(\\s*${hue$1}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
879
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/parseHslLegacy.js
880
+ const hsl_old = /* @__PURE__ */ 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);
883
883
  if (!match) return;
@@ -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,8 +996,8 @@ 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
1000
- const definition$13 = {
999
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/definition.js
1000
+ const definition$25 = {
1001
1001
  mode: "hsl",
1002
1002
  toMode: { rgb: convertHslToRgb },
1003
1003
  fromMode: { rgb: convertRgbToHsl },
@@ -1026,10 +1026,10 @@ const definition$13 = {
1026
1026
  difference: { h: differenceHueSaturation },
1027
1027
  average: { h: averageAngle }
1028
1028
  };
1029
- var definition_default$1 = definition$13;
1029
+ var definition_default$1 = definition$25;
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,25 +1091,25 @@ 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;
1098
1098
  if (b === void 0) b = 0;
1099
- let M = Math.max(r$1, g, b), m = Math.min(r$1, g, b);
1099
+ let M$1 = Math.max(r$1, g, b), m = Math.min(r$1, g, b);
1100
1100
  let res = {
1101
1101
  mode: "hsv",
1102
- s: M === 0 ? 0 : 1 - m / M,
1103
- v: M
1102
+ s: M$1 === 0 ? 0 : 1 - m / M$1,
1103
+ v: M$1
1104
1104
  };
1105
- if (M - m !== 0) res.h = (M === r$1 ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r$1) / (M - m) + 2 : (r$1 - g) / (M - m) + 4) * 60;
1105
+ if (M$1 - m !== 0) res.h = (M$1 === r$1 ? (g - b) / (M$1 - m) + (g < b) * 6 : M$1 === g ? (b - r$1) / (M$1 - m) + 2 : (r$1 - g) / (M$1 - m) + 4) * 60;
1106
1106
  if (alpha !== void 0) res.alpha = alpha;
1107
1107
  return res;
1108
1108
  }
1109
1109
 
1110
1110
  //#endregion
1111
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/hsv/definition.js
1112
- const definition$12 = {
1111
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/definition.js
1112
+ const definition$24 = {
1113
1113
  mode: "hsv",
1114
1114
  toMode: { rgb: convertHsvToRgb },
1115
1115
  parse: ["--hsv"],
@@ -1138,10 +1138,10 @@ const definition$12 = {
1138
1138
  difference: { h: differenceHueSaturation },
1139
1139
  average: { h: averageAngle }
1140
1140
  };
1141
- var definition_default$15 = definition$12;
1141
+ var definition_default$19 = definition$24;
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,24 +1159,24 @@ 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
- let hsv = convertRgbToHsv(rgba);
1165
- if (hsv === void 0) return void 0;
1166
- let s = hsv.s !== void 0 ? hsv.s : 0;
1167
- let v = hsv.v !== void 0 ? hsv.v : 0;
1164
+ let hsv$2 = convertRgbToHsv(rgba);
1165
+ if (hsv$2 === void 0) return void 0;
1166
+ let s = hsv$2.s !== void 0 ? hsv$2.s : 0;
1167
+ let v = hsv$2.v !== void 0 ? hsv$2.v : 0;
1168
1168
  let res = {
1169
1169
  mode: "hwb",
1170
1170
  w: (1 - s) * v,
1171
1171
  b: 1 - v
1172
1172
  };
1173
- if (hsv.h !== void 0) res.h = hsv.h;
1174
- if (hsv.alpha !== void 0) res.alpha = hsv.alpha;
1173
+ if (hsv$2.h !== void 0) res.h = hsv$2.h;
1174
+ if (hsv$2.alpha !== void 0) res.alpha = hsv$2.alpha;
1175
1175
  return res;
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,8 +1199,8 @@ 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
1203
- const definition$11 = {
1202
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/definition.js
1203
+ const definition$23 = {
1204
1204
  mode: "hwb",
1205
1205
  toMode: { rgb: convertHwbToRgb },
1206
1206
  fromMode: { rgb: convertRgbToHwb },
@@ -1229,15 +1229,15 @@ const definition$11 = {
1229
1229
  difference: { h: differenceHueNaive },
1230
1230
  average: { h: averageAngle }
1231
1231
  };
1232
- var definition_default$2 = definition$11;
1232
+ var definition_default$2 = definition$23;
1233
1233
 
1234
1234
  //#endregion
1235
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/constants.js
1236
- const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
1237
- const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
1235
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/constants.js
1236
+ const k = Math.pow(29, 3) / Math.pow(3, 3);
1237
+ const e = 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,8 +1252,8 @@ 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
1256
- let fn$1 = (v) => Math.pow(v, 3) > e$1 ? Math.pow(v, 3) : (116 * v - 16) / k$1;
1255
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertLabToXyz50.js
1256
+ let fn$1 = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
1257
1257
  const convertLabToXyz50 = ({ l, a, b, alpha }) => {
1258
1258
  if (l === void 0) l = 0;
1259
1259
  if (a === void 0) a = 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,14 +1289,14 @@ 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
1293
- const convertLabToRgb = (lab) => convertXyz50ToRgb_default(convertLabToXyz50_default(lab));
1292
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertLabToRgb.js
1293
+ const convertLabToRgb = (lab$2) => convertXyz50ToRgb_default(convertLabToXyz50_default(lab$2));
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
1298
- const convertRgbToXyz50 = (rgb$2) => {
1299
- let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
1297
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/convertRgbToXyz50.js
1298
+ const convertRgbToXyz50 = (rgb$4) => {
1299
+ let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$4);
1300
1300
  let res = {
1301
1301
  mode: "xyz50",
1302
1302
  x: .436065742824811 * r$1 + .3851514688337912 * g + .14307845442264197 * b,
@@ -1309,8 +1309,8 @@ 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
1313
- const f$1 = (value) => value > e$1 ? Math.cbrt(value) : (k$1 * value + 16) / 116;
1312
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertXyz50ToLab.js
1313
+ const f$1 = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
1314
1314
  const convertXyz50ToLab = ({ x, y, z, alpha }) => {
1315
1315
  if (x === void 0) x = 0;
1316
1316
  if (y === void 0) y = 0;
@@ -1330,16 +1330,16 @@ 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
1334
- const convertRgbToLab = (rgb$2) => {
1335
- let res = convertXyz50ToLab_default(convertRgbToXyz50_default(rgb$2));
1336
- if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
1333
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertRgbToLab.js
1334
+ const convertRgbToLab = (rgb$4) => {
1335
+ let res = convertXyz50ToLab_default(convertRgbToXyz50_default(rgb$4));
1336
+ if (rgb$4.r === rgb$4.b && rgb$4.b === rgb$4.g) res.a = res.b = 0;
1337
1337
  return res;
1338
1338
  };
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,8 +1354,8 @@ 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
1358
- const definition$10 = {
1357
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/definition.js
1358
+ const definition$22 = {
1359
1359
  mode: "lab",
1360
1360
  toMode: {
1361
1361
  xyz50: convertLabToXyz50_default,
@@ -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,16 +1388,16 @@ const definition$10 = {
1388
1388
  }
1389
1389
  }
1390
1390
  };
1391
- var definition_default$3 = definition$10;
1391
+ var definition_default$3 = definition$22;
1392
1392
 
1393
1393
  //#endregion
1394
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/constants.js
1395
- const k = Math.pow(29, 3) / Math.pow(3, 3);
1396
- const e = Math.pow(6, 3) / Math.pow(29, 3);
1394
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/constants.js
1395
+ const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
1396
+ const e$1 = 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
1400
- let fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
1399
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToXyz65.js
1400
+ let fn = (v) => Math.pow(v, 3) > e$1 ? Math.pow(v, 3) : (116 * v - 16) / k$1;
1401
1401
  const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
1402
1402
  if (l === void 0) l = 0;
1403
1403
  if (a === void 0) a = 0;
@@ -1417,13 +1417,13 @@ 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
1421
- const convertLab65ToRgb = (lab) => convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab));
1420
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToRgb.js
1421
+ const convertLab65ToRgb = (lab$2) => convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab$2));
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
1426
- const f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
1425
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertXyz65ToLab65.js
1426
+ const f = (value) => value > e$1 ? Math.cbrt(value) : (k$1 * value + 16) / 116;
1427
1427
  const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
1428
1428
  if (x === void 0) x = 0;
1429
1429
  if (y === void 0) y = 0;
@@ -1443,17 +1443,17 @@ 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
1447
- const convertRgbToLab65 = (rgb$2) => {
1448
- let res = convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$2));
1449
- if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
1446
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertRgbToLab65.js
1447
+ const convertRgbToLab65 = (rgb$4) => {
1448
+ let res = convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$4));
1449
+ if (rgb$4.r === rgb$4.b && rgb$4.b === rgb$4.g) res.a = res.b = 0;
1450
1450
  return res;
1451
1451
  };
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
1456
- const definition$9 = {
1455
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/definition.js
1456
+ const definition$21 = {
1457
1457
  ...definition_default$3,
1458
1458
  mode: "lab65",
1459
1459
  parse: ["--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$4 = definition$9;
1475
+ var definition_default$4 = definition$21;
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,8 +1527,8 @@ 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
1531
- const definition$8 = {
1530
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/definition.js
1531
+ const definition$20 = {
1532
1532
  mode: "lch",
1533
1533
  toMode: {
1534
1534
  lab: convertLchToLab_default,
@@ -1566,11 +1566,34 @@ const definition$8 = {
1566
1566
  difference: { h: differenceHueChroma },
1567
1567
  average: { h: averageAngle }
1568
1568
  };
1569
- var definition_default$5 = definition$8;
1569
+ var definition_default$5 = definition$20;
1570
1570
 
1571
1571
  //#endregion
1572
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/lrgb/definition.js
1573
- const definition$7 = {
1572
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch65/definition.js
1573
+ const definition$19 = {
1574
+ ...definition_default$5,
1575
+ mode: "lch65",
1576
+ parse: ["--lch-d65"],
1577
+ serialize: "--lch-d65",
1578
+ toMode: {
1579
+ lab65: (c$1) => convertLchToLab_default(c$1, "lab65"),
1580
+ rgb: (c$1) => convertLab65ToRgb_default(convertLchToLab_default(c$1, "lab65"))
1581
+ },
1582
+ fromMode: {
1583
+ rgb: (c$1) => convertLabToLch_default(convertRgbToLab65_default(c$1), "lch65"),
1584
+ lab65: (c$1) => convertLabToLch_default(c$1, "lch65")
1585
+ },
1586
+ ranges: {
1587
+ l: [0, 100],
1588
+ c: [0, 150],
1589
+ h: [0, 360]
1590
+ }
1591
+ };
1592
+ var definition_default$23 = definition$19;
1593
+
1594
+ //#endregion
1595
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/definition.js
1596
+ const definition$18 = {
1574
1597
  ...definition_default$12,
1575
1598
  mode: "lrgb",
1576
1599
  toMode: { rgb: convertLrgbToRgb_default },
@@ -1578,22 +1601,22 @@ const definition$7 = {
1578
1601
  parse: ["srgb-linear"],
1579
1602
  serialize: "srgb-linear"
1580
1603
  };
1581
- var definition_default$6 = definition$7;
1604
+ var definition_default$6 = definition$18;
1582
1605
 
1583
1606
  //#endregion
1584
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertOklabToLrgb.js
1607
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToLrgb.js
1585
1608
  const convertOklabToLrgb = ({ l, a, b, alpha }) => {
1586
1609
  if (l === void 0) l = 0;
1587
1610
  if (a === void 0) a = 0;
1588
1611
  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);
1612
+ let L = Math.pow(l + .3963377773761749 * a + .2158037573099136 * b, 3);
1613
+ let M$1 = Math.pow(l - .1055613458156586 * a - .0638541728258133 * b, 3);
1614
+ let S = Math.pow(l - .0894841775298119 * a - 1.2914855480194092 * b, 3);
1592
1615
  let res = {
1593
1616
  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
1617
+ r: 4.076741636075957 * L - 3.3077115392580616 * M$1 + .2309699031821044 * S,
1618
+ g: -1.2684379732850317 * L + 2.6097573492876887 * M$1 - .3413193760026573 * S,
1619
+ b: -.0041960761386756 * L - .7034186179359362 * M$1 + 1.7076146940746117 * S
1597
1620
  };
1598
1621
  if (alpha !== void 0) res.alpha = alpha;
1599
1622
  return res;
@@ -1601,19 +1624,19 @@ const convertOklabToLrgb = ({ l, a, b, alpha }) => {
1601
1624
  var convertOklabToLrgb_default = convertOklabToLrgb;
1602
1625
 
1603
1626
  //#endregion
1604
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertLrgbToOklab.js
1627
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertLrgbToOklab.js
1605
1628
  const convertLrgbToOklab = ({ r: r$1, g, b, alpha }) => {
1606
1629
  if (r$1 === void 0) r$1 = 0;
1607
1630
  if (g === void 0) g = 0;
1608
1631
  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);
1632
+ let L = Math.cbrt(.412221469470763 * r$1 + .5363325372617348 * g + .0514459932675022 * b);
1633
+ let M$1 = Math.cbrt(.2119034958178252 * r$1 + .6806995506452344 * g + .1073969535369406 * b);
1634
+ let S = Math.cbrt(.0883024591900564 * r$1 + .2817188391361215 * g + .6299787016738222 * b);
1612
1635
  let res = {
1613
1636
  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
1637
+ l: .210454268309314 * L + .7936177747023054 * M$1 - .0040720430116193 * S,
1638
+ a: 1.9779985324311684 * L - 2.42859224204858 * M$1 + .450593709617411 * S,
1639
+ b: .0259040424655478 * L + .7827717124575296 * M$1 - .8086757549230774 * S
1617
1640
  };
1618
1641
  if (alpha !== void 0) res.alpha = alpha;
1619
1642
  return res;
@@ -1621,21 +1644,21 @@ const convertLrgbToOklab = ({ r: r$1, g, b, alpha }) => {
1621
1644
  var convertLrgbToOklab_default = convertLrgbToOklab;
1622
1645
 
1623
1646
  //#endregion
1624
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertRgbToOklab.js
1625
- const convertRgbToOklab = (rgb$2) => {
1626
- let res = convertLrgbToOklab_default(convertRgbToLrgb_default(rgb$2));
1627
- if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
1647
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertRgbToOklab.js
1648
+ const convertRgbToOklab = (rgb$4) => {
1649
+ let res = convertLrgbToOklab_default(convertRgbToLrgb_default(rgb$4));
1650
+ if (rgb$4.r === rgb$4.b && rgb$4.b === rgb$4.g) res.a = res.b = 0;
1628
1651
  return res;
1629
1652
  };
1630
1653
  var convertRgbToOklab_default = convertRgbToOklab;
1631
1654
 
1632
1655
  //#endregion
1633
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/convertOklabToRgb.js
1656
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToRgb.js
1634
1657
  const convertOklabToRgb = (c$1) => convertLrgbToRgb_default(convertOklabToLrgb_default(c$1));
1635
1658
  var convertOklabToRgb_default = convertOklabToRgb;
1636
1659
 
1637
1660
  //#endregion
1638
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/parseOklab.js
1661
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/parseOklab.js
1639
1662
  function parseOklab(color, parsed) {
1640
1663
  if (!parsed || parsed[0] !== "oklab") return void 0;
1641
1664
  const res = { mode: "oklab" };
@@ -1650,8 +1673,8 @@ function parseOklab(color, parsed) {
1650
1673
  var parseOklab_default = parseOklab;
1651
1674
 
1652
1675
  //#endregion
1653
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklab/definition.js
1654
- const definition$6 = {
1676
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/definition.js
1677
+ const definition$17 = {
1655
1678
  ...definition_default$3,
1656
1679
  mode: "oklab",
1657
1680
  toMode: {
@@ -1670,10 +1693,10 @@ const definition$6 = {
1670
1693
  parse: [parseOklab_default],
1671
1694
  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
1695
  };
1673
- var definition_default$7 = definition$6;
1696
+ var definition_default$7 = definition$17;
1674
1697
 
1675
1698
  //#endregion
1676
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklch/parseOklch.js
1699
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklch/parseOklch.js
1677
1700
  function parseOklch(color, parsed) {
1678
1701
  if (!parsed || parsed[0] !== "oklch") return void 0;
1679
1702
  const res = { mode: "oklch" };
@@ -1693,8 +1716,8 @@ function parseOklch(color, parsed) {
1693
1716
  var parseOklch_default = parseOklch;
1694
1717
 
1695
1718
  //#endregion
1696
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/oklch/definition.js
1697
- const definition$5 = {
1719
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklch/definition.js
1720
+ const definition$16 = {
1698
1721
  ...definition_default$5,
1699
1722
  mode: "oklch",
1700
1723
  toMode: {
@@ -1713,12 +1736,12 @@ const definition$5 = {
1713
1736
  h: [0, 360]
1714
1737
  }
1715
1738
  };
1716
- var definition_default$8 = definition$5;
1739
+ var definition_default$8 = definition$16;
1717
1740
 
1718
1741
  //#endregion
1719
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/convertP3ToXyz65.js
1720
- const convertP3ToXyz65 = (rgb$2) => {
1721
- let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
1742
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/convertP3ToXyz65.js
1743
+ const convertP3ToXyz65 = (rgb$4) => {
1744
+ let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$4);
1722
1745
  let res = {
1723
1746
  mode: "xyz65",
1724
1747
  x: .486570948648216 * r$1 + .265667693169093 * g + .1982172852343625 * b,
@@ -1731,7 +1754,7 @@ const convertP3ToXyz65 = (rgb$2) => {
1731
1754
  var convertP3ToXyz65_default = convertP3ToXyz65;
1732
1755
 
1733
1756
  //#endregion
1734
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/convertXyz65ToP3.js
1757
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/convertXyz65ToP3.js
1735
1758
  const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
1736
1759
  if (x === void 0) x = 0;
1737
1760
  if (y === void 0) y = 0;
@@ -1747,8 +1770,8 @@ const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
1747
1770
  var convertXyz65ToP3_default = convertXyz65ToP3;
1748
1771
 
1749
1772
  //#endregion
1750
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/p3/definition.js
1751
- const definition$4 = {
1773
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/definition.js
1774
+ const definition$15 = {
1752
1775
  ...definition_default$12,
1753
1776
  mode: "p3",
1754
1777
  parse: ["display-p3"],
@@ -1762,13 +1785,13 @@ const definition$4 = {
1762
1785
  xyz65: convertP3ToXyz65_default
1763
1786
  }
1764
1787
  };
1765
- var definition_default$9 = definition$4;
1788
+ var definition_default$9 = definition$15;
1766
1789
 
1767
1790
  //#endregion
1768
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
1791
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
1769
1792
  const gamma$1 = (v) => {
1770
- let abs = Math.abs(v);
1771
- if (abs >= 1 / 512) return Math.sign(v) * Math.pow(abs, 1 / 1.8);
1793
+ let abs$1 = Math.abs(v);
1794
+ if (abs$1 >= 1 / 512) return Math.sign(v) * Math.pow(abs$1, 1 / 1.8);
1772
1795
  return 16 * v;
1773
1796
  };
1774
1797
  const convertXyz50ToProphoto = ({ x, y, z, alpha }) => {
@@ -1787,30 +1810,30 @@ const convertXyz50ToProphoto = ({ x, y, z, alpha }) => {
1787
1810
  var convertXyz50ToProphoto_default = convertXyz50ToProphoto;
1788
1811
 
1789
1812
  //#endregion
1790
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/convertProphotoToXyz50.js
1813
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/convertProphotoToXyz50.js
1791
1814
  const linearize$1 = (v = 0) => {
1792
- let abs = Math.abs(v);
1793
- if (abs >= 16 / 512) return Math.sign(v) * Math.pow(abs, 1.8);
1815
+ let abs$1 = Math.abs(v);
1816
+ if (abs$1 >= 16 / 512) return Math.sign(v) * Math.pow(abs$1, 1.8);
1794
1817
  return v / 16;
1795
1818
  };
1796
- const convertProphotoToXyz50 = (prophoto) => {
1797
- let r$1 = linearize$1(prophoto.r);
1798
- let g = linearize$1(prophoto.g);
1799
- let b = linearize$1(prophoto.b);
1819
+ const convertProphotoToXyz50 = (prophoto$2) => {
1820
+ let r$1 = linearize$1(prophoto$2.r);
1821
+ let g = linearize$1(prophoto$2.g);
1822
+ let b = linearize$1(prophoto$2.b);
1800
1823
  let res = {
1801
1824
  mode: "xyz50",
1802
1825
  x: .7977666449006423 * r$1 + .1351812974005331 * g + .0313477341283922 * b,
1803
1826
  y: .2880748288194013 * r$1 + .7118352342418731 * g + 899369387256e-16 * b,
1804
1827
  z: 0 * r$1 + 0 * g + .8251046025104602 * b
1805
1828
  };
1806
- if (prophoto.alpha !== void 0) res.alpha = prophoto.alpha;
1829
+ if (prophoto$2.alpha !== void 0) res.alpha = prophoto$2.alpha;
1807
1830
  return res;
1808
1831
  };
1809
1832
  var convertProphotoToXyz50_default = convertProphotoToXyz50;
1810
1833
 
1811
1834
  //#endregion
1812
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/prophoto/definition.js
1813
- const definition$3 = {
1835
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/definition.js
1836
+ const definition$14 = {
1814
1837
  ...definition_default$12,
1815
1838
  mode: "prophoto",
1816
1839
  parse: ["prophoto-rgb"],
@@ -1824,15 +1847,15 @@ const definition$3 = {
1824
1847
  rgb: (color) => convertXyz50ToRgb_default(convertProphotoToXyz50_default(color))
1825
1848
  }
1826
1849
  };
1827
- var definition_default$10 = definition$3;
1850
+ var definition_default$10 = definition$14;
1828
1851
 
1829
1852
  //#endregion
1830
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
1853
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
1831
1854
  const α$1 = 1.09929682680944;
1832
1855
  const β$1 = .018053968510807;
1833
1856
  const gamma = (v) => {
1834
- const abs = Math.abs(v);
1835
- if (abs > β$1) return (Math.sign(v) || 1) * (α$1 * Math.pow(abs, .45) - (α$1 - 1));
1857
+ const abs$1 = Math.abs(v);
1858
+ if (abs$1 > β$1) return (Math.sign(v) || 1) * (α$1 * Math.pow(abs$1, .45) - (α$1 - 1));
1836
1859
  return 4.5 * v;
1837
1860
  };
1838
1861
  const convertXyz65ToRec2020 = ({ x, y, z, alpha }) => {
@@ -1851,32 +1874,32 @@ const convertXyz65ToRec2020 = ({ x, y, z, alpha }) => {
1851
1874
  var convertXyz65ToRec2020_default = convertXyz65ToRec2020;
1852
1875
 
1853
1876
  //#endregion
1854
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/convertRec2020ToXyz65.js
1877
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/convertRec2020ToXyz65.js
1855
1878
  const α = 1.09929682680944;
1856
1879
  const β = .018053968510807;
1857
1880
  const linearize = (v = 0) => {
1858
- let abs = Math.abs(v);
1859
- if (abs < β * 4.5) return v / 4.5;
1860
- return (Math.sign(v) || 1) * Math.pow((abs + α - 1) / α, 1 / .45);
1861
- };
1862
- const convertRec2020ToXyz65 = (rec2020) => {
1863
- let r$1 = linearize(rec2020.r);
1864
- let g = linearize(rec2020.g);
1865
- let b = linearize(rec2020.b);
1881
+ let abs$1 = Math.abs(v);
1882
+ if (abs$1 < β * 4.5) return v / 4.5;
1883
+ return (Math.sign(v) || 1) * Math.pow((abs$1 + α - 1) / α, 1 / .45);
1884
+ };
1885
+ const convertRec2020ToXyz65 = (rec2020$2) => {
1886
+ let r$1 = linearize(rec2020$2.r);
1887
+ let g = linearize(rec2020$2.g);
1888
+ let b = linearize(rec2020$2.b);
1866
1889
  let res = {
1867
1890
  mode: "xyz65",
1868
1891
  x: .6369580483012911 * r$1 + .1446169035862083 * g + .1688809751641721 * b,
1869
1892
  y: .262700212011267 * r$1 + .6779980715188708 * g + .059301716469862 * b,
1870
1893
  z: 0 * r$1 + .0280726930490874 * g + 1.0609850577107909 * b
1871
1894
  };
1872
- if (rec2020.alpha !== void 0) res.alpha = rec2020.alpha;
1895
+ if (rec2020$2.alpha !== void 0) res.alpha = rec2020$2.alpha;
1873
1896
  return res;
1874
1897
  };
1875
1898
  var convertRec2020ToXyz65_default = convertRec2020ToXyz65;
1876
1899
 
1877
1900
  //#endregion
1878
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/rec2020/definition.js
1879
- const definition$2 = {
1901
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/definition.js
1902
+ const definition$13 = {
1880
1903
  ...definition_default$12,
1881
1904
  mode: "rec2020",
1882
1905
  fromMode: {
@@ -1890,120 +1913,937 @@ const definition$2 = {
1890
1913
  parse: ["rec2020"],
1891
1914
  serialize: "rec2020"
1892
1915
  };
1893
- var definition_default$11 = definition$2;
1916
+ var definition_default$11 = definition$13;
1917
+
1918
+ //#endregion
1919
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/definition.js
1920
+ const definition$12 = {
1921
+ mode: "xyz50",
1922
+ parse: ["xyz-d50"],
1923
+ serialize: "xyz-d50",
1924
+ toMode: {
1925
+ rgb: convertXyz50ToRgb_default,
1926
+ lab: convertXyz50ToLab_default
1927
+ },
1928
+ fromMode: {
1929
+ rgb: convertRgbToXyz50_default,
1930
+ lab: convertLabToXyz50_default
1931
+ },
1932
+ channels: [
1933
+ "x",
1934
+ "y",
1935
+ "z",
1936
+ "alpha"
1937
+ ],
1938
+ ranges: {
1939
+ x: [0, .964],
1940
+ y: [0, .999],
1941
+ z: [0, .825]
1942
+ },
1943
+ interpolate: {
1944
+ x: interpolatorLinear,
1945
+ y: interpolatorLinear,
1946
+ z: interpolatorLinear,
1947
+ alpha: {
1948
+ use: interpolatorLinear,
1949
+ fixup: fixupAlpha
1950
+ }
1951
+ }
1952
+ };
1953
+ var definition_default$13 = definition$12;
1954
+
1955
+ //#endregion
1956
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
1957
+ const convertXyz65ToXyz50 = (xyz65$2) => {
1958
+ let { x, y, z, alpha } = xyz65$2;
1959
+ if (x === void 0) x = 0;
1960
+ if (y === void 0) y = 0;
1961
+ if (z === void 0) z = 0;
1962
+ let res = {
1963
+ mode: "xyz50",
1964
+ x: 1.0479298208405488 * x + .0229467933410191 * y - .0501922295431356 * z,
1965
+ y: .0296278156881593 * x + .990434484573249 * y - .0170738250293851 * z,
1966
+ z: -.0092430581525912 * x + .0150551448965779 * y + .7518742899580008 * z
1967
+ };
1968
+ if (alpha !== void 0) res.alpha = alpha;
1969
+ return res;
1970
+ };
1971
+ var convertXyz65ToXyz50_default = convertXyz65ToXyz50;
1972
+
1973
+ //#endregion
1974
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz50ToXyz65.js
1975
+ const convertXyz50ToXyz65 = (xyz50$2) => {
1976
+ let { x, y, z, alpha } = xyz50$2;
1977
+ if (x === void 0) x = 0;
1978
+ if (y === void 0) y = 0;
1979
+ if (z === void 0) z = 0;
1980
+ let res = {
1981
+ mode: "xyz65",
1982
+ x: .9554734527042182 * x - .0230985368742614 * y + .0632593086610217 * z,
1983
+ y: -.0283697069632081 * x + 1.0099954580058226 * y + .021041398966943 * z,
1984
+ z: .0123140016883199 * x - .0205076964334779 * y + 1.3303659366080753 * z
1985
+ };
1986
+ if (alpha !== void 0) res.alpha = alpha;
1987
+ return res;
1988
+ };
1989
+ var convertXyz50ToXyz65_default = convertXyz50ToXyz65;
1990
+
1991
+ //#endregion
1992
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/definition.js
1993
+ const definition$11 = {
1994
+ mode: "xyz65",
1995
+ toMode: {
1996
+ rgb: convertXyz65ToRgb_default,
1997
+ xyz50: convertXyz65ToXyz50_default
1998
+ },
1999
+ fromMode: {
2000
+ rgb: convertRgbToXyz65_default,
2001
+ xyz50: convertXyz50ToXyz65_default
2002
+ },
2003
+ ranges: {
2004
+ x: [0, .95],
2005
+ y: [0, 1],
2006
+ z: [0, 1.088]
2007
+ },
2008
+ channels: [
2009
+ "x",
2010
+ "y",
2011
+ "z",
2012
+ "alpha"
2013
+ ],
2014
+ parse: ["xyz", "xyz-d65"],
2015
+ serialize: "xyz-d65",
2016
+ interpolate: {
2017
+ x: interpolatorLinear,
2018
+ y: interpolatorLinear,
2019
+ z: interpolatorLinear,
2020
+ alpha: {
2021
+ use: interpolatorLinear,
2022
+ fixup: fixupAlpha
2023
+ }
2024
+ }
2025
+ };
2026
+ var definition_default$14 = definition$11;
2027
+
2028
+ //#endregion
2029
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/bootstrap/css.js
2030
+ const a98$1 = useMode(definition_default);
2031
+ const hsl$2 = useMode(definition_default$1);
2032
+ const hsv$1 = useMode(definition_default$19);
2033
+ const hwb$1 = useMode(definition_default$2);
2034
+ const lab$1 = useMode(definition_default$3);
2035
+ const lab65$1 = useMode(definition_default$4);
2036
+ const lch$1 = useMode(definition_default$5);
2037
+ const lch65$1 = useMode(definition_default$23);
2038
+ const lrgb$1 = useMode(definition_default$6);
2039
+ const oklab$1 = useMode(definition_default$7);
2040
+ const oklch$1 = useMode(definition_default$8);
2041
+ const p3$1 = useMode(definition_default$9);
2042
+ const prophoto$1 = useMode(definition_default$10);
2043
+ const rec2020$1 = useMode(definition_default$11);
2044
+ const rgb$3 = useMode(definition_default$12);
2045
+ const xyz50$1 = useMode(definition_default$13);
2046
+ const xyz65$1 = useMode(definition_default$14);
2047
+
2048
+ //#endregion
2049
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/cubehelix/constants.js
2050
+ const M = [
2051
+ -.14861,
2052
+ 1.78277,
2053
+ -.29227,
2054
+ -.90649,
2055
+ 1.97294,
2056
+ 0
2057
+ ];
2058
+ const degToRad = Math.PI / 180;
2059
+ const radToDeg = 180 / Math.PI;
2060
+
2061
+ //#endregion
2062
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/cubehelix/convertRgbToCubehelix.js
2063
+ let DE = M[3] * M[4];
2064
+ let BE = M[1] * M[4];
2065
+ let BCAD = M[1] * M[2] - M[0] * M[3];
2066
+ const convertRgbToCubehelix = ({ r: r$1, g, b, alpha }) => {
2067
+ if (r$1 === void 0) r$1 = 0;
2068
+ if (g === void 0) g = 0;
2069
+ if (b === void 0) b = 0;
2070
+ let l = (BCAD * b + r$1 * DE - g * BE) / (BCAD + DE - BE);
2071
+ let x = b - l;
2072
+ let y = (M[4] * (g - l) - M[2] * x) / M[3];
2073
+ let res = {
2074
+ mode: "cubehelix",
2075
+ l,
2076
+ s: l === 0 || l === 1 ? void 0 : Math.sqrt(x * x + y * y) / (M[4] * l * (1 - l))
2077
+ };
2078
+ if (res.s) res.h = Math.atan2(y, x) * radToDeg - 120;
2079
+ if (alpha !== void 0) res.alpha = alpha;
2080
+ return res;
2081
+ };
2082
+ var convertRgbToCubehelix_default = convertRgbToCubehelix;
2083
+
2084
+ //#endregion
2085
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/cubehelix/convertCubehelixToRgb.js
2086
+ const convertCubehelixToRgb = ({ h, s, l, alpha }) => {
2087
+ let res = { mode: "rgb" };
2088
+ h = (h === void 0 ? 0 : h + 120) * degToRad;
2089
+ if (l === void 0) l = 0;
2090
+ let amp = s === void 0 ? 0 : s * l * (1 - l);
2091
+ let cosh = Math.cos(h);
2092
+ let sinh = Math.sin(h);
2093
+ res.r = l + amp * (M[0] * cosh + M[1] * sinh);
2094
+ res.g = l + amp * (M[2] * cosh + M[3] * sinh);
2095
+ res.b = l + amp * (M[4] * cosh + M[5] * sinh);
2096
+ if (alpha !== void 0) res.alpha = alpha;
2097
+ return res;
2098
+ };
2099
+ var convertCubehelixToRgb_default = convertCubehelixToRgb;
2100
+
2101
+ //#endregion
2102
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/cubehelix/definition.js
2103
+ const definition$10 = {
2104
+ mode: "cubehelix",
2105
+ channels: [
2106
+ "h",
2107
+ "s",
2108
+ "l",
2109
+ "alpha"
2110
+ ],
2111
+ parse: ["--cubehelix"],
2112
+ serialize: "--cubehelix",
2113
+ ranges: {
2114
+ h: [0, 360],
2115
+ s: [0, 4.614],
2116
+ l: [0, 1]
2117
+ },
2118
+ fromMode: { rgb: convertRgbToCubehelix_default },
2119
+ toMode: { rgb: convertCubehelixToRgb_default },
2120
+ interpolate: {
2121
+ h: {
2122
+ use: interpolatorLinear,
2123
+ fixup: fixupHueShorter
2124
+ },
2125
+ s: interpolatorLinear,
2126
+ l: interpolatorLinear,
2127
+ alpha: {
2128
+ use: interpolatorLinear,
2129
+ fixup: fixupAlpha
2130
+ }
2131
+ },
2132
+ difference: { h: differenceHueSaturation },
2133
+ average: { h: averageAngle }
2134
+ };
2135
+ var definition_default$15 = definition$10;
2136
+
2137
+ //#endregion
2138
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/dlch/constants.js
2139
+ const kE = 1;
2140
+ const kCH = 1;
2141
+ const θ = 26 / 180 * Math.PI;
2142
+ const cosθ = Math.cos(θ);
2143
+ const sinθ = Math.sin(θ);
2144
+ const factor = 100 / Math.log(139 / 100);
2145
+
2146
+ //#endregion
2147
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/dlch/convertDlchToLab65.js
2148
+ const convertDlchToLab65 = ({ l, c: c$1, h, alpha }) => {
2149
+ if (l === void 0) l = 0;
2150
+ if (c$1 === void 0) c$1 = 0;
2151
+ if (h === void 0) h = 0;
2152
+ let res = {
2153
+ mode: "lab65",
2154
+ l: (Math.exp(l * kE / factor) - 1) / .0039
2155
+ };
2156
+ let G = (Math.exp(.0435 * c$1 * kCH * kE) - 1) / .075;
2157
+ let e$3 = G * Math.cos(h / 180 * Math.PI - θ);
2158
+ let f$2 = G * Math.sin(h / 180 * Math.PI - θ);
2159
+ res.a = e$3 * cosθ - f$2 / .83 * sinθ;
2160
+ res.b = e$3 * sinθ + f$2 / .83 * cosθ;
2161
+ if (alpha !== void 0) res.alpha = alpha;
2162
+ return res;
2163
+ };
2164
+ var convertDlchToLab65_default = convertDlchToLab65;
2165
+
2166
+ //#endregion
2167
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/dlch/convertLab65ToDlch.js
2168
+ const convertLab65ToDlch = ({ l, a, b, alpha }) => {
2169
+ if (l === void 0) l = 0;
2170
+ if (a === void 0) a = 0;
2171
+ if (b === void 0) b = 0;
2172
+ let e$3 = a * cosθ + b * sinθ;
2173
+ let f$2 = .83 * (b * cosθ - a * sinθ);
2174
+ let G = Math.sqrt(e$3 * e$3 + f$2 * f$2);
2175
+ let res = {
2176
+ mode: "dlch",
2177
+ l: factor / kE * Math.log(1 + .0039 * l),
2178
+ c: Math.log(1 + .075 * G) / (.0435 * kCH * kE)
2179
+ };
2180
+ if (res.c) res.h = normalizeHue_default((Math.atan2(f$2, e$3) + θ) / Math.PI * 180);
2181
+ if (alpha !== void 0) res.alpha = alpha;
2182
+ return res;
2183
+ };
2184
+ var convertLab65ToDlch_default = convertLab65ToDlch;
2185
+
2186
+ //#endregion
2187
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/dlab/definition.js
2188
+ const convertDlabToLab65 = (c$1) => convertDlchToLab65_default(convertLabToLch_default(c$1, "dlch"));
2189
+ const convertLab65ToDlab = (c$1) => convertLchToLab_default(convertLab65ToDlch_default(c$1), "dlab");
2190
+ const definition$9 = {
2191
+ mode: "dlab",
2192
+ parse: ["--din99o-lab"],
2193
+ serialize: "--din99o-lab",
2194
+ toMode: {
2195
+ lab65: convertDlabToLab65,
2196
+ rgb: (c$1) => convertLab65ToRgb_default(convertDlabToLab65(c$1))
2197
+ },
2198
+ fromMode: {
2199
+ lab65: convertLab65ToDlab,
2200
+ rgb: (c$1) => convertLab65ToDlab(convertRgbToLab65_default(c$1))
2201
+ },
2202
+ channels: [
2203
+ "l",
2204
+ "a",
2205
+ "b",
2206
+ "alpha"
2207
+ ],
2208
+ ranges: {
2209
+ l: [0, 100],
2210
+ a: [-40.09, 45.501],
2211
+ b: [-40.469, 44.344]
2212
+ },
2213
+ interpolate: {
2214
+ l: interpolatorLinear,
2215
+ a: interpolatorLinear,
2216
+ b: interpolatorLinear,
2217
+ alpha: {
2218
+ use: interpolatorLinear,
2219
+ fixup: fixupAlpha
2220
+ }
2221
+ }
2222
+ };
2223
+ var definition_default$16 = definition$9;
2224
+
2225
+ //#endregion
2226
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/dlch/definition.js
2227
+ const definition$8 = {
2228
+ mode: "dlch",
2229
+ parse: ["--din99o-lch"],
2230
+ serialize: "--din99o-lch",
2231
+ toMode: {
2232
+ lab65: convertDlchToLab65_default,
2233
+ dlab: (c$1) => convertLchToLab_default(c$1, "dlab"),
2234
+ rgb: (c$1) => convertLab65ToRgb_default(convertDlchToLab65_default(c$1))
2235
+ },
2236
+ fromMode: {
2237
+ lab65: convertLab65ToDlch_default,
2238
+ dlab: (c$1) => convertLabToLch_default(c$1, "dlch"),
2239
+ rgb: (c$1) => convertLab65ToDlch_default(convertRgbToLab65_default(c$1))
2240
+ },
2241
+ channels: [
2242
+ "l",
2243
+ "c",
2244
+ "h",
2245
+ "alpha"
2246
+ ],
2247
+ ranges: {
2248
+ l: [0, 100],
2249
+ c: [0, 51.484],
2250
+ h: [0, 360]
2251
+ },
2252
+ interpolate: {
2253
+ l: interpolatorLinear,
2254
+ c: interpolatorLinear,
2255
+ h: {
2256
+ use: interpolatorLinear,
2257
+ fixup: fixupHueShorter
2258
+ },
2259
+ alpha: {
2260
+ use: interpolatorLinear,
2261
+ fixup: fixupAlpha
2262
+ }
2263
+ },
2264
+ difference: { h: differenceHueChroma },
2265
+ average: { h: averageAngle }
2266
+ };
2267
+ var definition_default$17 = definition$8;
2268
+
2269
+ //#endregion
2270
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsi/convertHsiToRgb.js
2271
+ function convertHsiToRgb({ h, s, i, alpha }) {
2272
+ h = normalizeHue_default(h !== void 0 ? h : 0);
2273
+ if (s === void 0) s = 0;
2274
+ if (i === void 0) i = 0;
2275
+ let f$2 = Math.abs(h / 60 % 2 - 1);
2276
+ let res;
2277
+ switch (Math.floor(h / 60)) {
2278
+ case 0:
2279
+ res = {
2280
+ r: i * (1 + s * (3 / (2 - f$2) - 1)),
2281
+ g: i * (1 + s * (3 * (1 - f$2) / (2 - f$2) - 1)),
2282
+ b: i * (1 - s)
2283
+ };
2284
+ break;
2285
+ case 1:
2286
+ res = {
2287
+ r: i * (1 + s * (3 * (1 - f$2) / (2 - f$2) - 1)),
2288
+ g: i * (1 + s * (3 / (2 - f$2) - 1)),
2289
+ b: i * (1 - s)
2290
+ };
2291
+ break;
2292
+ case 2:
2293
+ res = {
2294
+ r: i * (1 - s),
2295
+ g: i * (1 + s * (3 / (2 - f$2) - 1)),
2296
+ b: i * (1 + s * (3 * (1 - f$2) / (2 - f$2) - 1))
2297
+ };
2298
+ break;
2299
+ case 3:
2300
+ res = {
2301
+ r: i * (1 - s),
2302
+ g: i * (1 + s * (3 * (1 - f$2) / (2 - f$2) - 1)),
2303
+ b: i * (1 + s * (3 / (2 - f$2) - 1))
2304
+ };
2305
+ break;
2306
+ case 4:
2307
+ res = {
2308
+ r: i * (1 + s * (3 * (1 - f$2) / (2 - f$2) - 1)),
2309
+ g: i * (1 - s),
2310
+ b: i * (1 + s * (3 / (2 - f$2) - 1))
2311
+ };
2312
+ break;
2313
+ case 5:
2314
+ res = {
2315
+ r: i * (1 + s * (3 / (2 - f$2) - 1)),
2316
+ g: i * (1 - s),
2317
+ b: i * (1 + s * (3 * (1 - f$2) / (2 - f$2) - 1))
2318
+ };
2319
+ break;
2320
+ default: res = {
2321
+ r: i * (1 - s),
2322
+ g: i * (1 - s),
2323
+ b: i * (1 - s)
2324
+ };
2325
+ }
2326
+ res.mode = "rgb";
2327
+ if (alpha !== void 0) res.alpha = alpha;
2328
+ return res;
2329
+ }
2330
+
2331
+ //#endregion
2332
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsi/convertRgbToHsi.js
2333
+ function convertRgbToHsi({ r: r$1, g, b, alpha }) {
2334
+ if (r$1 === void 0) r$1 = 0;
2335
+ if (g === void 0) g = 0;
2336
+ if (b === void 0) b = 0;
2337
+ let M$1 = Math.max(r$1, g, b), m = Math.min(r$1, g, b);
2338
+ let res = {
2339
+ mode: "hsi",
2340
+ s: r$1 + g + b === 0 ? 0 : 1 - 3 * m / (r$1 + g + b),
2341
+ i: (r$1 + g + b) / 3
2342
+ };
2343
+ if (M$1 - m !== 0) res.h = (M$1 === r$1 ? (g - b) / (M$1 - m) + (g < b) * 6 : M$1 === g ? (b - r$1) / (M$1 - m) + 2 : (r$1 - g) / (M$1 - m) + 4) * 60;
2344
+ if (alpha !== void 0) res.alpha = alpha;
2345
+ return res;
2346
+ }
2347
+
2348
+ //#endregion
2349
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsi/definition.js
2350
+ const definition$7 = {
2351
+ mode: "hsi",
2352
+ toMode: { rgb: convertHsiToRgb },
2353
+ parse: ["--hsi"],
2354
+ serialize: "--hsi",
2355
+ fromMode: { rgb: convertRgbToHsi },
2356
+ channels: [
2357
+ "h",
2358
+ "s",
2359
+ "i",
2360
+ "alpha"
2361
+ ],
2362
+ ranges: { h: [0, 360] },
2363
+ gamut: "rgb",
2364
+ interpolate: {
2365
+ h: {
2366
+ use: interpolatorLinear,
2367
+ fixup: fixupHueShorter
2368
+ },
2369
+ s: interpolatorLinear,
2370
+ i: interpolatorLinear,
2371
+ alpha: {
2372
+ use: interpolatorLinear,
2373
+ fixup: fixupAlpha
2374
+ }
2375
+ },
2376
+ difference: { h: differenceHueSaturation },
2377
+ average: { h: averageAngle }
2378
+ };
2379
+ var definition_default$18 = definition$7;
2380
+
2381
+ //#endregion
2382
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hdr/constants.js
2383
+ const YW = 203;
2384
+
2385
+ //#endregion
2386
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hdr/transfer.js
2387
+ const M1 = .1593017578125;
2388
+ const M2 = 78.84375;
2389
+ const C1 = .8359375;
2390
+ const C2 = 18.8515625;
2391
+ const C3 = 18.6875;
2392
+ function transferPqDecode(v) {
2393
+ if (v < 0) return 0;
2394
+ const c$1 = Math.pow(v, 1 / M2);
2395
+ return 1e4 * Math.pow(Math.max(0, c$1 - C1) / (C2 - C3 * c$1), 1 / M1);
2396
+ }
2397
+ function transferPqEncode(v) {
2398
+ if (v < 0) return 0;
2399
+ const c$1 = Math.pow(v / 1e4, M1);
2400
+ return Math.pow((C1 + C2 * c$1) / (1 + C3 * c$1), M2);
2401
+ }
2402
+
2403
+ //#endregion
2404
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/itp/convertItpToXyz65.js
2405
+ const toRel = (c$1) => Math.max(c$1 / YW, 0);
2406
+ const convertItpToXyz65 = ({ i, t, p: p$2, alpha }) => {
2407
+ if (i === void 0) i = 0;
2408
+ if (t === void 0) t = 0;
2409
+ if (p$2 === void 0) p$2 = 0;
2410
+ const l = transferPqDecode(i + .008609037037932761 * t + .11102962500302593 * p$2);
2411
+ const m = transferPqDecode(i - .00860903703793275 * t - .11102962500302599 * p$2);
2412
+ const s = transferPqDecode(i + .5600313357106791 * t - .32062717498731885 * p$2);
2413
+ const res = {
2414
+ mode: "xyz65",
2415
+ x: toRel(2.070152218389422 * l - 1.3263473389671556 * m + .2066510476294051 * s),
2416
+ y: toRel(.3647385209748074 * l + .680566024947227 * m - .0453045459220346 * s),
2417
+ z: toRel(-.049747207535812 * l - .0492609666966138 * m + 1.1880659249923042 * s)
2418
+ };
2419
+ if (alpha !== void 0) res.alpha = alpha;
2420
+ return res;
2421
+ };
2422
+ var convertItpToXyz65_default = convertItpToXyz65;
2423
+
2424
+ //#endregion
2425
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/itp/convertXyz65ToItp.js
2426
+ const toAbs = (c$1 = 0) => Math.max(c$1 * YW, 0);
2427
+ const convertXyz65ToItp = ({ x, y, z, alpha }) => {
2428
+ const absX = toAbs(x);
2429
+ const absY = toAbs(y);
2430
+ const absZ = toAbs(z);
2431
+ const l = transferPqEncode(.3592832590121217 * absX + .6976051147779502 * absY - .0358915932320289 * absZ);
2432
+ const m = transferPqEncode(-.1920808463704995 * absX + 1.1004767970374323 * absY + .0753748658519118 * absZ);
2433
+ const s = transferPqEncode(.0070797844607477 * absX + .0748396662186366 * absY + .8433265453898765 * absZ);
2434
+ const i = .5 * l + .5 * m;
2435
+ const t = 1.61376953125 * l - 3.323486328125 * m + 1.709716796875 * s;
2436
+ const p$2 = 4.378173828125 * l - 4.24560546875 * m - .132568359375 * s;
2437
+ const res = {
2438
+ mode: "itp",
2439
+ i,
2440
+ t,
2441
+ p: p$2
2442
+ };
2443
+ if (alpha !== void 0) res.alpha = alpha;
2444
+ return res;
2445
+ };
2446
+ var convertXyz65ToItp_default = convertXyz65ToItp;
2447
+
2448
+ //#endregion
2449
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/itp/definition.js
2450
+ const definition$6 = {
2451
+ mode: "itp",
2452
+ channels: [
2453
+ "i",
2454
+ "t",
2455
+ "p",
2456
+ "alpha"
2457
+ ],
2458
+ parse: ["--ictcp"],
2459
+ serialize: "--ictcp",
2460
+ toMode: {
2461
+ xyz65: convertItpToXyz65_default,
2462
+ rgb: (color) => convertXyz65ToRgb_default(convertItpToXyz65_default(color))
2463
+ },
2464
+ fromMode: {
2465
+ xyz65: convertXyz65ToItp_default,
2466
+ rgb: (color) => convertXyz65ToItp_default(convertRgbToXyz65_default(color))
2467
+ },
2468
+ ranges: {
2469
+ i: [0, .581],
2470
+ t: [-.369, .272],
2471
+ p: [-.164, .331]
2472
+ },
2473
+ interpolate: {
2474
+ i: interpolatorLinear,
2475
+ t: interpolatorLinear,
2476
+ p: interpolatorLinear,
2477
+ alpha: {
2478
+ use: interpolatorLinear,
2479
+ fixup: fixupAlpha
2480
+ }
2481
+ }
2482
+ };
2483
+ var definition_default$20 = definition$6;
2484
+
2485
+ //#endregion
2486
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/jab/convertXyz65ToJab.js
2487
+ const p$1 = 134.03437499999998;
2488
+ const d0$1 = 16295499532821565e-27;
2489
+ const jabPqEncode = (v) => {
2490
+ if (v < 0) return 0;
2491
+ let vn$2 = Math.pow(v / 1e4, M1);
2492
+ return Math.pow((C1 + C2 * vn$2) / (1 + C3 * vn$2), p$1);
2493
+ };
2494
+ const abs = (v = 0) => Math.max(v * 203, 0);
2495
+ const convertXyz65ToJab = ({ x, y, z, alpha }) => {
2496
+ x = abs(x);
2497
+ y = abs(y);
2498
+ z = abs(z);
2499
+ let xp = 1.15 * x - .15 * z;
2500
+ let yp = .66 * y + .34 * x;
2501
+ let l = jabPqEncode(.41478972 * xp + .579999 * yp + .014648 * z);
2502
+ let m = jabPqEncode(-.20151 * xp + 1.120649 * yp + .0531008 * z);
2503
+ let s = jabPqEncode(-.0166008 * xp + .2648 * yp + .6684799 * z);
2504
+ let i = (l + m) / 2;
2505
+ let res = {
2506
+ mode: "jab",
2507
+ j: .44 * i / (1 - .56 * i) - d0$1,
2508
+ a: 3.524 * l - 4.066708 * m + .542708 * s,
2509
+ b: .199076 * l + 1.096799 * m - 1.295875 * s
2510
+ };
2511
+ if (alpha !== void 0) res.alpha = alpha;
2512
+ return res;
2513
+ };
2514
+ var convertXyz65ToJab_default = convertXyz65ToJab;
2515
+
2516
+ //#endregion
2517
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/jab/convertJabToXyz65.js
2518
+ const p = 134.03437499999998;
2519
+ const d0 = 16295499532821565e-27;
2520
+ const jabPqDecode = (v) => {
2521
+ if (v < 0) return 0;
2522
+ let vp = Math.pow(v, 1 / p);
2523
+ return 1e4 * Math.pow((C1 - vp) / (C3 * vp - C2), 1 / M1);
2524
+ };
2525
+ const rel = (v) => v / 203;
2526
+ const convertJabToXyz65 = ({ j, a, b, alpha }) => {
2527
+ if (j === void 0) j = 0;
2528
+ if (a === void 0) a = 0;
2529
+ if (b === void 0) b = 0;
2530
+ let i = (j + d0) / (.44 + .56 * (j + d0));
2531
+ let l = jabPqDecode(i + .13860504 * a + .058047316 * b);
2532
+ let m = jabPqDecode(i - .13860504 * a - .058047316 * b);
2533
+ let s = jabPqDecode(i - .096019242 * a - .8118919 * b);
2534
+ let res = {
2535
+ mode: "xyz65",
2536
+ x: rel(1.661373024652174 * l - .914523081304348 * m + .23136208173913045 * s),
2537
+ y: rel(-.3250758611844533 * l + 1.571847026732543 * m - .21825383453227928 * s),
2538
+ z: rel(-.090982811 * l - .31272829 * m + 1.5227666 * s)
2539
+ };
2540
+ if (alpha !== void 0) res.alpha = alpha;
2541
+ return res;
2542
+ };
2543
+ var convertJabToXyz65_default = convertJabToXyz65;
2544
+
2545
+ //#endregion
2546
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/jab/convertRgbToJab.js
2547
+ const convertRgbToJab = (rgb$4) => {
2548
+ let res = convertXyz65ToJab_default(convertRgbToXyz65_default(rgb$4));
2549
+ if (rgb$4.r === rgb$4.b && rgb$4.b === rgb$4.g) res.a = res.b = 0;
2550
+ return res;
2551
+ };
2552
+ var convertRgbToJab_default = convertRgbToJab;
2553
+
2554
+ //#endregion
2555
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/jab/convertJabToRgb.js
2556
+ const convertJabToRgb = (color) => convertXyz65ToRgb_default(convertJabToXyz65_default(color));
2557
+ var convertJabToRgb_default = convertJabToRgb;
2558
+
2559
+ //#endregion
2560
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/jab/definition.js
2561
+ const definition$5 = {
2562
+ mode: "jab",
2563
+ channels: [
2564
+ "j",
2565
+ "a",
2566
+ "b",
2567
+ "alpha"
2568
+ ],
2569
+ parse: ["--jzazbz"],
2570
+ serialize: "--jzazbz",
2571
+ fromMode: {
2572
+ rgb: convertRgbToJab_default,
2573
+ xyz65: convertXyz65ToJab_default
2574
+ },
2575
+ toMode: {
2576
+ rgb: convertJabToRgb_default,
2577
+ xyz65: convertJabToXyz65_default
2578
+ },
2579
+ ranges: {
2580
+ j: [0, .222],
2581
+ a: [-.109, .129],
2582
+ b: [-.185, .134]
2583
+ },
2584
+ interpolate: {
2585
+ j: interpolatorLinear,
2586
+ a: interpolatorLinear,
2587
+ b: interpolatorLinear,
2588
+ alpha: {
2589
+ use: interpolatorLinear,
2590
+ fixup: fixupAlpha
2591
+ }
2592
+ }
2593
+ };
2594
+ var definition_default$21 = definition$5;
2595
+
2596
+ //#endregion
2597
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/jch/convertJabToJch.js
2598
+ const convertJabToJch = ({ j, a, b, alpha }) => {
2599
+ if (a === void 0) a = 0;
2600
+ if (b === void 0) b = 0;
2601
+ let c$1 = Math.sqrt(a * a + b * b);
2602
+ let res = {
2603
+ mode: "jch",
2604
+ j,
2605
+ c: c$1
2606
+ };
2607
+ if (c$1) res.h = normalizeHue_default(Math.atan2(b, a) * 180 / Math.PI);
2608
+ if (alpha !== void 0) res.alpha = alpha;
2609
+ return res;
2610
+ };
2611
+ var convertJabToJch_default = convertJabToJch;
2612
+
2613
+ //#endregion
2614
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/jch/convertJchToJab.js
2615
+ const convertJchToJab = ({ j, c: c$1, h, alpha }) => {
2616
+ if (h === void 0) h = 0;
2617
+ let res = {
2618
+ mode: "jab",
2619
+ j,
2620
+ a: c$1 ? c$1 * Math.cos(h / 180 * Math.PI) : 0,
2621
+ b: c$1 ? c$1 * Math.sin(h / 180 * Math.PI) : 0
2622
+ };
2623
+ if (alpha !== void 0) res.alpha = alpha;
2624
+ return res;
2625
+ };
2626
+ var convertJchToJab_default = convertJchToJab;
1894
2627
 
1895
2628
  //#endregion
1896
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz50/definition.js
1897
- const definition$1 = {
1898
- mode: "xyz50",
1899
- parse: ["xyz-d50"],
1900
- serialize: "xyz-d50",
2629
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/jch/definition.js
2630
+ const definition$4 = {
2631
+ mode: "jch",
2632
+ parse: ["--jzczhz"],
2633
+ serialize: "--jzczhz",
1901
2634
  toMode: {
1902
- rgb: convertXyz50ToRgb_default,
1903
- lab: convertXyz50ToLab_default
2635
+ jab: convertJchToJab_default,
2636
+ rgb: (c$1) => convertJabToRgb_default(convertJchToJab_default(c$1))
1904
2637
  },
1905
2638
  fromMode: {
1906
- rgb: convertRgbToXyz50_default,
1907
- lab: convertLabToXyz50_default
2639
+ rgb: (c$1) => convertJabToJch_default(convertRgbToJab_default(c$1)),
2640
+ jab: convertJabToJch_default
1908
2641
  },
1909
2642
  channels: [
1910
- "x",
1911
- "y",
1912
- "z",
2643
+ "j",
2644
+ "c",
2645
+ "h",
1913
2646
  "alpha"
1914
2647
  ],
1915
2648
  ranges: {
1916
- x: [0, .964],
1917
- y: [0, .999],
1918
- z: [0, .825]
2649
+ j: [0, .221],
2650
+ c: [0, .19],
2651
+ h: [0, 360]
1919
2652
  },
1920
2653
  interpolate: {
1921
- x: interpolatorLinear,
1922
- y: interpolatorLinear,
1923
- z: interpolatorLinear,
2654
+ h: {
2655
+ use: interpolatorLinear,
2656
+ fixup: fixupHueShorter
2657
+ },
2658
+ c: interpolatorLinear,
2659
+ j: interpolatorLinear,
1924
2660
  alpha: {
1925
2661
  use: interpolatorLinear,
1926
2662
  fixup: fixupAlpha
1927
2663
  }
1928
- }
2664
+ },
2665
+ difference: { h: differenceHueChroma },
2666
+ average: { h: averageAngle }
1929
2667
  };
1930
- var definition_default$13 = definition$1;
2668
+ var definition_default$22 = definition$4;
1931
2669
 
1932
2670
  //#endregion
1933
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
1934
- const convertXyz65ToXyz50 = (xyz65) => {
1935
- let { x, y, z, alpha } = xyz65;
1936
- if (x === void 0) x = 0;
1937
- if (y === void 0) y = 0;
1938
- if (z === void 0) z = 0;
2671
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lchuv/convertLuvToLchuv.js
2672
+ const convertLuvToLchuv = ({ l, u, v, alpha }) => {
2673
+ if (u === void 0) u = 0;
2674
+ if (v === void 0) v = 0;
2675
+ let c$1 = Math.sqrt(u * u + v * v);
1939
2676
  let res = {
1940
- mode: "xyz50",
1941
- x: 1.0479298208405488 * x + .0229467933410191 * y - .0501922295431356 * z,
1942
- y: .0296278156881593 * x + .990434484573249 * y - .0170738250293851 * z,
1943
- z: -.0092430581525912 * x + .0150551448965779 * y + .7518742899580008 * z
2677
+ mode: "lchuv",
2678
+ l,
2679
+ c: c$1
1944
2680
  };
2681
+ if (c$1) res.h = normalizeHue_default(Math.atan2(v, u) * 180 / Math.PI);
1945
2682
  if (alpha !== void 0) res.alpha = alpha;
1946
2683
  return res;
1947
2684
  };
1948
- var convertXyz65ToXyz50_default = convertXyz65ToXyz50;
2685
+ var convertLuvToLchuv_default = convertLuvToLchuv;
2686
+
2687
+ //#endregion
2688
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lchuv/convertLchuvToLuv.js
2689
+ const convertLchuvToLuv = ({ l, c: c$1, h, alpha }) => {
2690
+ if (h === void 0) h = 0;
2691
+ let res = {
2692
+ mode: "luv",
2693
+ l,
2694
+ u: c$1 ? c$1 * Math.cos(h / 180 * Math.PI) : 0,
2695
+ v: c$1 ? c$1 * Math.sin(h / 180 * Math.PI) : 0
2696
+ };
2697
+ if (alpha !== void 0) res.alpha = alpha;
2698
+ return res;
2699
+ };
2700
+ var convertLchuvToLuv_default = convertLchuvToLuv;
1949
2701
 
1950
2702
  //#endregion
1951
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/convertXyz50ToXyz65.js
1952
- const convertXyz50ToXyz65 = (xyz50) => {
1953
- let { x, y, z, alpha } = xyz50;
2703
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/luv/convertXyz50ToLuv.js
2704
+ const u_fn$1 = (x, y, z) => 4 * x / (x + 15 * y + 3 * z);
2705
+ const v_fn$1 = (x, y, z) => 9 * y / (x + 15 * y + 3 * z);
2706
+ const un$1 = u_fn$1(D50.X, D50.Y, D50.Z);
2707
+ const vn$1 = v_fn$1(D50.X, D50.Y, D50.Z);
2708
+ const l_fn = (value) => value <= e ? k * value : 116 * Math.cbrt(value) - 16;
2709
+ const convertXyz50ToLuv = ({ x, y, z, alpha }) => {
1954
2710
  if (x === void 0) x = 0;
1955
2711
  if (y === void 0) y = 0;
1956
2712
  if (z === void 0) z = 0;
2713
+ let l = l_fn(y / D50.Y);
2714
+ let u = u_fn$1(x, y, z);
2715
+ let v = v_fn$1(x, y, z);
2716
+ if (!isFinite(u) || !isFinite(v)) l = u = v = 0;
2717
+ else {
2718
+ u = 13 * l * (u - un$1);
2719
+ v = 13 * l * (v - vn$1);
2720
+ }
1957
2721
  let res = {
1958
- mode: "xyz65",
1959
- x: .9554734527042182 * x - .0230985368742614 * y + .0632593086610217 * z,
1960
- y: -.0283697069632081 * x + 1.0099954580058226 * y + .021041398966943 * z,
1961
- z: .0123140016883199 * x - .0205076964334779 * y + 1.3303659366080753 * z
2722
+ mode: "luv",
2723
+ l,
2724
+ u,
2725
+ v
1962
2726
  };
1963
2727
  if (alpha !== void 0) res.alpha = alpha;
1964
2728
  return res;
1965
2729
  };
1966
- var convertXyz50ToXyz65_default = convertXyz50ToXyz65;
2730
+ var convertXyz50ToLuv_default = convertXyz50ToLuv;
1967
2731
 
1968
2732
  //#endregion
1969
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/xyz65/definition.js
1970
- const definition = {
1971
- mode: "xyz65",
2733
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/luv/convertLuvToXyz50.js
2734
+ const u_fn = (x, y, z) => 4 * x / (x + 15 * y + 3 * z);
2735
+ const v_fn = (x, y, z) => 9 * y / (x + 15 * y + 3 * z);
2736
+ const un = u_fn(D50.X, D50.Y, D50.Z);
2737
+ const vn = v_fn(D50.X, D50.Y, D50.Z);
2738
+ const convertLuvToXyz50 = ({ l, u, v, alpha }) => {
2739
+ if (l === void 0) l = 0;
2740
+ if (l === 0) return {
2741
+ mode: "xyz50",
2742
+ x: 0,
2743
+ y: 0,
2744
+ z: 0
2745
+ };
2746
+ if (u === void 0) u = 0;
2747
+ if (v === void 0) v = 0;
2748
+ let up = u / (13 * l) + un;
2749
+ let vp = v / (13 * l) + vn;
2750
+ let y = D50.Y * (l <= 8 ? l / k : Math.pow((l + 16) / 116, 3));
2751
+ let x = y * (9 * up) / (4 * vp);
2752
+ let z = y * (12 - 3 * up - 20 * vp) / (4 * vp);
2753
+ let res = {
2754
+ mode: "xyz50",
2755
+ x,
2756
+ y,
2757
+ z
2758
+ };
2759
+ if (alpha !== void 0) res.alpha = alpha;
2760
+ return res;
2761
+ };
2762
+ var convertLuvToXyz50_default = convertLuvToXyz50;
2763
+
2764
+ //#endregion
2765
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lchuv/definition.js
2766
+ const convertRgbToLchuv = (rgb$4) => convertLuvToLchuv_default(convertXyz50ToLuv_default(convertRgbToXyz50_default(rgb$4)));
2767
+ const convertLchuvToRgb = (lchuv$1) => convertXyz50ToRgb_default(convertLuvToXyz50_default(convertLchuvToLuv_default(lchuv$1)));
2768
+ const definition$3 = {
2769
+ mode: "lchuv",
1972
2770
  toMode: {
1973
- rgb: convertXyz65ToRgb_default,
1974
- xyz50: convertXyz65ToXyz50_default
2771
+ luv: convertLchuvToLuv_default,
2772
+ rgb: convertLchuvToRgb
1975
2773
  },
1976
2774
  fromMode: {
1977
- rgb: convertRgbToXyz65_default,
1978
- xyz50: convertXyz50ToXyz65_default
2775
+ rgb: convertRgbToLchuv,
2776
+ luv: convertLuvToLchuv_default
1979
2777
  },
2778
+ channels: [
2779
+ "l",
2780
+ "c",
2781
+ "h",
2782
+ "alpha"
2783
+ ],
2784
+ parse: ["--lchuv"],
2785
+ serialize: "--lchuv",
1980
2786
  ranges: {
1981
- x: [0, .95],
1982
- y: [0, 1],
1983
- z: [0, 1.088]
2787
+ l: [0, 100],
2788
+ c: [0, 176.956],
2789
+ h: [0, 360]
2790
+ },
2791
+ interpolate: {
2792
+ h: {
2793
+ use: interpolatorLinear,
2794
+ fixup: fixupHueShorter
2795
+ },
2796
+ c: interpolatorLinear,
2797
+ l: interpolatorLinear,
2798
+ alpha: {
2799
+ use: interpolatorLinear,
2800
+ fixup: fixupAlpha
2801
+ }
2802
+ },
2803
+ difference: { h: differenceHueChroma },
2804
+ average: { h: averageAngle }
2805
+ };
2806
+ var definition_default$24 = definition$3;
2807
+
2808
+ //#endregion
2809
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/luv/definition.js
2810
+ const definition$2 = {
2811
+ mode: "luv",
2812
+ toMode: {
2813
+ xyz50: convertLuvToXyz50_default,
2814
+ rgb: (luv$1) => convertXyz50ToRgb_default(convertLuvToXyz50_default(luv$1))
2815
+ },
2816
+ fromMode: {
2817
+ xyz50: convertXyz50ToLuv_default,
2818
+ rgb: (rgb$4) => convertXyz50ToLuv_default(convertRgbToXyz50_default(rgb$4))
1984
2819
  },
1985
2820
  channels: [
1986
- "x",
1987
- "y",
1988
- "z",
2821
+ "l",
2822
+ "u",
2823
+ "v",
1989
2824
  "alpha"
1990
2825
  ],
1991
- parse: ["xyz", "xyz-d65"],
1992
- serialize: "xyz-d65",
2826
+ parse: ["--luv"],
2827
+ serialize: "--luv",
2828
+ ranges: {
2829
+ l: [0, 100],
2830
+ u: [-84.936, 175.042],
2831
+ v: [-125.882, 87.243]
2832
+ },
1993
2833
  interpolate: {
1994
- x: interpolatorLinear,
1995
- y: interpolatorLinear,
1996
- z: interpolatorLinear,
2834
+ l: interpolatorLinear,
2835
+ u: interpolatorLinear,
2836
+ v: interpolatorLinear,
1997
2837
  alpha: {
1998
2838
  use: interpolatorLinear,
1999
2839
  fixup: fixupAlpha
2000
2840
  }
2001
2841
  }
2002
2842
  };
2003
- var definition_default$14 = definition;
2843
+ var definition_default$25 = definition$2;
2004
2844
 
2005
2845
  //#endregion
2006
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/okhsl/helpers.js
2846
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsl/helpers.js
2007
2847
  function toe(x) {
2008
2848
  const k_1 = .206;
2009
2849
  const k_2 = .03;
@@ -2072,28 +2912,199 @@ function compute_max_saturation(a, b) {
2072
2912
  }
2073
2913
  function find_cusp(a, b) {
2074
2914
  let S_cusp = compute_max_saturation(a, b);
2075
- let rgb$2 = convertOklabToLrgb_default({
2915
+ let rgb$4 = convertOklabToLrgb_default({
2076
2916
  l: 1,
2077
2917
  a: S_cusp * a,
2078
2918
  b: S_cusp * b
2079
2919
  });
2080
- let L_cusp = Math.cbrt(1 / Math.max(rgb$2.r, rgb$2.g, rgb$2.b));
2920
+ let L_cusp = Math.cbrt(1 / Math.max(rgb$4.r, rgb$4.g, rgb$4.b));
2081
2921
  let C_cusp = L_cusp * S_cusp;
2082
2922
  return [L_cusp, C_cusp];
2083
2923
  }
2924
+ function find_gamut_intersection(a, b, L1, C1$1, L0, cusp = null) {
2925
+ if (!cusp) cusp = find_cusp(a, b);
2926
+ let t;
2927
+ if ((L1 - L0) * cusp[1] - (cusp[0] - L0) * C1$1 <= 0) t = cusp[1] * L0 / (C1$1 * cusp[0] + cusp[1] * (L0 - L1));
2928
+ else {
2929
+ t = cusp[1] * (L0 - 1) / (C1$1 * (cusp[0] - 1) + cusp[1] * (L0 - L1));
2930
+ {
2931
+ let dL = L1 - L0;
2932
+ let dC = C1$1;
2933
+ let k_l = .3963377774 * a + .2158037573 * b;
2934
+ let k_m = -.1055613458 * a - .0638541728 * b;
2935
+ let k_s = -.0894841775 * a - 1.291485548 * b;
2936
+ let l_dt = dL + dC * k_l;
2937
+ let m_dt = dL + dC * k_m;
2938
+ let s_dt = dL + dC * k_s;
2939
+ {
2940
+ let L = L0 * (1 - t) + t * L1;
2941
+ let C = t * C1$1;
2942
+ let l_ = L + C * k_l;
2943
+ let m_ = L + C * k_m;
2944
+ let s_ = L + C * k_s;
2945
+ let l = l_ * l_ * l_;
2946
+ let m = m_ * m_ * m_;
2947
+ let s = s_ * s_ * s_;
2948
+ let ldt = 3 * l_dt * l_ * l_;
2949
+ let mdt = 3 * m_dt * m_ * m_;
2950
+ let sdt = 3 * s_dt * s_ * s_;
2951
+ let ldt2 = 6 * l_dt * l_dt * l_;
2952
+ let mdt2 = 6 * m_dt * m_dt * m_;
2953
+ let sdt2 = 6 * s_dt * s_dt * s_;
2954
+ let r$1 = 4.0767416621 * l - 3.3077115913 * m + .2309699292 * s - 1;
2955
+ let r1 = 4.0767416621 * ldt - 3.3077115913 * mdt + .2309699292 * sdt;
2956
+ let r2 = 4.0767416621 * ldt2 - 3.3077115913 * mdt2 + .2309699292 * sdt2;
2957
+ let u_r = r1 / (r1 * r1 - .5 * r$1 * r2);
2958
+ let t_r = -r$1 * u_r;
2959
+ let g = -1.2684380046 * l + 2.6097574011 * m - .3413193965 * s - 1;
2960
+ let g1 = -1.2684380046 * ldt + 2.6097574011 * mdt - .3413193965 * sdt;
2961
+ let g2 = -1.2684380046 * ldt2 + 2.6097574011 * mdt2 - .3413193965 * sdt2;
2962
+ let u_g = g1 / (g1 * g1 - .5 * g * g2);
2963
+ let t_g = -g * u_g;
2964
+ let b$1 = -.0041960863 * l - .7034186147 * m + 1.707614701 * s - 1;
2965
+ let b1 = -.0041960863 * ldt - .7034186147 * mdt + 1.707614701 * sdt;
2966
+ let b2 = -.0041960863 * ldt2 - .7034186147 * mdt2 + 1.707614701 * sdt2;
2967
+ let u_b = b1 / (b1 * b1 - .5 * b$1 * b2);
2968
+ let t_b = -b$1 * u_b;
2969
+ t_r = u_r >= 0 ? t_r : 1e6;
2970
+ t_g = u_g >= 0 ? t_g : 1e6;
2971
+ t_b = u_b >= 0 ? t_b : 1e6;
2972
+ t += Math.min(t_r, Math.min(t_g, t_b));
2973
+ }
2974
+ }
2975
+ }
2976
+ return t;
2977
+ }
2084
2978
  function get_ST_max(a_, b_, cusp = null) {
2085
2979
  if (!cusp) cusp = find_cusp(a_, b_);
2086
2980
  let L = cusp[0];
2087
2981
  let C = cusp[1];
2088
2982
  return [C / L, C / (1 - L)];
2089
2983
  }
2984
+ function get_Cs(L, a_, b_) {
2985
+ let cusp = find_cusp(a_, b_);
2986
+ let C_max = find_gamut_intersection(a_, b_, L, 1, L, cusp);
2987
+ let ST_max = get_ST_max(a_, b_, cusp);
2988
+ let S_mid = .11516993 + 1 / (7.4477897 + 4.1590124 * b_ + a_ * (-2.19557347 + 1.75198401 * b_ + a_ * (-2.13704948 - 10.02301043 * b_ + a_ * (-4.24894561 + 5.38770819 * b_ + 4.69891013 * a_))));
2989
+ let T_mid = .11239642 + 1 / (1.6132032 - .68124379 * b_ + a_ * (.40370612 + .90148123 * b_ + a_ * (-.27087943 + .6122399 * b_ + a_ * (.00299215 - .45399568 * b_ - .14661872 * a_))));
2990
+ let k$3 = C_max / Math.min(L * ST_max[0], (1 - L) * ST_max[1]);
2991
+ let C_a = L * S_mid;
2992
+ let C_b = (1 - L) * T_mid;
2993
+ let C_mid = .9 * k$3 * Math.sqrt(Math.sqrt(1 / (1 / (C_a * C_a * C_a * C_a) + 1 / (C_b * C_b * C_b * C_b))));
2994
+ C_a = L * .4;
2995
+ C_b = (1 - L) * .8;
2996
+ let C_0 = Math.sqrt(1 / (1 / (C_a * C_a) + 1 / (C_b * C_b)));
2997
+ return [
2998
+ C_0,
2999
+ C_mid,
3000
+ C_max
3001
+ ];
3002
+ }
3003
+
3004
+ //#endregion
3005
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsl/convertOklabToOkhsl.js
3006
+ function convertOklabToOkhsl(lab$2) {
3007
+ const l = lab$2.l !== void 0 ? lab$2.l : 0;
3008
+ const a = lab$2.a !== void 0 ? lab$2.a : 0;
3009
+ const b = lab$2.b !== void 0 ? lab$2.b : 0;
3010
+ const ret = {
3011
+ mode: "okhsl",
3012
+ l: toe(l)
3013
+ };
3014
+ if (lab$2.alpha !== void 0) ret.alpha = lab$2.alpha;
3015
+ let c$1 = Math.sqrt(a * a + b * b);
3016
+ if (!c$1) {
3017
+ ret.s = 0;
3018
+ return ret;
3019
+ }
3020
+ let [C_0, C_mid, C_max] = get_Cs(l, a / c$1, b / c$1);
3021
+ let s;
3022
+ if (c$1 < C_mid) {
3023
+ let k_0 = 0;
3024
+ let k_1 = .8 * C_0;
3025
+ let k_2 = 1 - k_1 / C_mid;
3026
+ let t = (c$1 - k_0) / (k_1 + k_2 * (c$1 - k_0));
3027
+ s = t * .8;
3028
+ } else {
3029
+ let k_0 = C_mid;
3030
+ let k_1 = .2 * C_mid * C_mid * 1.25 * 1.25 / C_0;
3031
+ let k_2 = 1 - k_1 / (C_max - C_mid);
3032
+ let t = (c$1 - k_0) / (k_1 + k_2 * (c$1 - k_0));
3033
+ s = .8 + .2 * t;
3034
+ }
3035
+ if (s) {
3036
+ ret.s = s;
3037
+ ret.h = normalizeHue_default(Math.atan2(b, a) * 180 / Math.PI);
3038
+ }
3039
+ return ret;
3040
+ }
3041
+
3042
+ //#endregion
3043
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsl/convertOkhslToOklab.js
3044
+ function convertOkhslToOklab(hsl$3) {
3045
+ let h = hsl$3.h !== void 0 ? hsl$3.h : 0;
3046
+ let s = hsl$3.s !== void 0 ? hsl$3.s : 0;
3047
+ let l = hsl$3.l !== void 0 ? hsl$3.l : 0;
3048
+ const ret = {
3049
+ mode: "oklab",
3050
+ l: toe_inv(l)
3051
+ };
3052
+ if (hsl$3.alpha !== void 0) ret.alpha = hsl$3.alpha;
3053
+ if (!s || l === 1) {
3054
+ ret.a = ret.b = 0;
3055
+ return ret;
3056
+ }
3057
+ let a_ = Math.cos(h / 180 * Math.PI);
3058
+ let b_ = Math.sin(h / 180 * Math.PI);
3059
+ let [C_0, C_mid, C_max] = get_Cs(ret.l, a_, b_);
3060
+ let t, k_0, k_1, k_2;
3061
+ if (s < .8) {
3062
+ t = 1.25 * s;
3063
+ k_0 = 0;
3064
+ k_1 = .8 * C_0;
3065
+ k_2 = 1 - k_1 / C_mid;
3066
+ } else {
3067
+ t = 5 * (s - .8);
3068
+ k_0 = C_mid;
3069
+ k_1 = .2 * C_mid * C_mid * 1.25 * 1.25 / C_0;
3070
+ k_2 = 1 - k_1 / (C_max - C_mid);
3071
+ }
3072
+ let C = k_0 + t * k_1 / (1 - k_2 * t);
3073
+ ret.a = C * a_;
3074
+ ret.b = C * b_;
3075
+ return ret;
3076
+ }
3077
+
3078
+ //#endregion
3079
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsl/modeOkhsl.js
3080
+ const modeOkhsl = {
3081
+ ...definition_default$1,
3082
+ mode: "okhsl",
3083
+ channels: [
3084
+ "h",
3085
+ "s",
3086
+ "l",
3087
+ "alpha"
3088
+ ],
3089
+ parse: ["--okhsl"],
3090
+ serialize: "--okhsl",
3091
+ fromMode: {
3092
+ oklab: convertOklabToOkhsl,
3093
+ rgb: (c$1) => convertOklabToOkhsl(convertRgbToOklab_default(c$1))
3094
+ },
3095
+ toMode: {
3096
+ oklab: convertOkhslToOklab,
3097
+ rgb: (c$1) => convertOklabToRgb_default(convertOkhslToOklab(c$1))
3098
+ }
3099
+ };
3100
+ var modeOkhsl_default = modeOkhsl;
2090
3101
 
2091
3102
  //#endregion
2092
- //#region ../../node_modules/.pnpm/culori@4.0.1/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;
3103
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/convertOklabToOkhsv.js
3104
+ function convertOklabToOkhsv(lab$2) {
3105
+ let l = lab$2.l !== void 0 ? lab$2.l : 0;
3106
+ let a = lab$2.a !== void 0 ? lab$2.a : 0;
3107
+ let b = lab$2.b !== void 0 ? lab$2.b : 0;
2097
3108
  let c$1 = Math.sqrt(a * a + b * b);
2098
3109
  let a_ = c$1 ? a / c$1 : 1;
2099
3110
  let b_ = c$1 ? b / c$1 : 1;
@@ -2120,18 +3131,18 @@ function convertOklabToOkhsv(lab) {
2120
3131
  v: l ? l / L_v : 0
2121
3132
  };
2122
3133
  if (ret.s) ret.h = normalizeHue_default(Math.atan2(b, a) * 180 / Math.PI);
2123
- if (lab.alpha !== void 0) ret.alpha = lab.alpha;
3134
+ if (lab$2.alpha !== void 0) ret.alpha = lab$2.alpha;
2124
3135
  return ret;
2125
3136
  }
2126
3137
 
2127
3138
  //#endregion
2128
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/okhsv/convertOkhsvToOklab.js
2129
- function convertOkhsvToOklab(hsv) {
3139
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/convertOkhsvToOklab.js
3140
+ function convertOkhsvToOklab(hsv$2) {
2130
3141
  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;
3142
+ if (hsv$2.alpha !== void 0) ret.alpha = hsv$2.alpha;
3143
+ const h = hsv$2.h !== void 0 ? hsv$2.h : 0;
3144
+ const s = hsv$2.s !== void 0 ? hsv$2.s : 0;
3145
+ const v = hsv$2.v !== void 0 ? hsv$2.v : 0;
2135
3146
  const a_ = Math.cos(h / 180 * Math.PI);
2136
3147
  const b_ = Math.sin(h / 180 * Math.PI);
2137
3148
  const [S_max, T] = get_ST_max(a_, b_);
@@ -2156,9 +3167,9 @@ function convertOkhsvToOklab(hsv) {
2156
3167
  }
2157
3168
 
2158
3169
  //#endregion
2159
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/okhsv/modeOkhsv.js
3170
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/modeOkhsv.js
2160
3171
  const modeOkhsv = {
2161
- ...definition_default$15,
3172
+ ...definition_default$19,
2162
3173
  mode: "okhsv",
2163
3174
  channels: [
2164
3175
  "h",
@@ -2180,18 +3191,157 @@ const modeOkhsv = {
2180
3191
  var modeOkhsv_default = modeOkhsv;
2181
3192
 
2182
3193
  //#endregion
2183
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/round.js
3194
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyb/constants.js
3195
+ const bias = .0037930732552754493;
3196
+ const bias_cbrt = Math.cbrt(bias);
3197
+
3198
+ //#endregion
3199
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyb/convertRgbToXyb.js
3200
+ const transfer$1 = (v) => Math.cbrt(v) - bias_cbrt;
3201
+ const convertRgbToXyb = (color) => {
3202
+ const { r: r$1, g, b, alpha } = convertRgbToLrgb_default(color);
3203
+ const l = transfer$1(.3 * r$1 + .622 * g + .078 * b + bias);
3204
+ const m = transfer$1(.23 * r$1 + .692 * g + .078 * b + bias);
3205
+ const s = transfer$1(.2434226892454782 * r$1 + .2047674442449682 * g + .5518098665095535 * b + bias);
3206
+ const res = {
3207
+ mode: "xyb",
3208
+ x: (l - m) / 2,
3209
+ y: (l + m) / 2,
3210
+ b: s - (l + m) / 2
3211
+ };
3212
+ if (alpha !== void 0) res.alpha = alpha;
3213
+ return res;
3214
+ };
3215
+ var convertRgbToXyb_default = convertRgbToXyb;
3216
+
3217
+ //#endregion
3218
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyb/convertXybToRgb.js
3219
+ const transfer = (v) => Math.pow(v + bias_cbrt, 3);
3220
+ const convertXybToRgb = ({ x, y, b, alpha }) => {
3221
+ if (x === void 0) x = 0;
3222
+ if (y === void 0) y = 0;
3223
+ if (b === void 0) b = 0;
3224
+ const l = transfer(x + y) - bias;
3225
+ const m = transfer(y - x) - bias;
3226
+ const s = transfer(b + y) - bias;
3227
+ const res = convertLrgbToRgb_default({
3228
+ r: 11.031566904639861 * l - 9.866943908131562 * m - .16462299650829934 * s,
3229
+ g: -3.2541473810744237 * l + 4.418770377582723 * m - .16462299650829934 * s,
3230
+ b: -3.6588512867136815 * l + 2.7129230459360922 * m + 1.9459282407775895 * s
3231
+ });
3232
+ if (alpha !== void 0) res.alpha = alpha;
3233
+ return res;
3234
+ };
3235
+ var convertXybToRgb_default = convertXybToRgb;
3236
+
3237
+ //#endregion
3238
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyb/definition.js
3239
+ const definition$1 = {
3240
+ mode: "xyb",
3241
+ channels: [
3242
+ "x",
3243
+ "y",
3244
+ "b",
3245
+ "alpha"
3246
+ ],
3247
+ parse: ["--xyb"],
3248
+ serialize: "--xyb",
3249
+ toMode: { rgb: convertXybToRgb_default },
3250
+ fromMode: { rgb: convertRgbToXyb_default },
3251
+ ranges: {
3252
+ x: [-.0154, .0281],
3253
+ y: [0, .8453],
3254
+ b: [-.2778, .388]
3255
+ },
3256
+ interpolate: {
3257
+ x: interpolatorLinear,
3258
+ y: interpolatorLinear,
3259
+ b: interpolatorLinear,
3260
+ alpha: {
3261
+ use: interpolatorLinear,
3262
+ fixup: fixupAlpha
3263
+ }
3264
+ }
3265
+ };
3266
+ var definition_default$26 = definition$1;
3267
+
3268
+ //#endregion
3269
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/yiq/convertRgbToYiq.js
3270
+ const convertRgbToYiq = ({ r: r$1, g, b, alpha }) => {
3271
+ if (r$1 === void 0) r$1 = 0;
3272
+ if (g === void 0) g = 0;
3273
+ if (b === void 0) b = 0;
3274
+ const res = {
3275
+ mode: "yiq",
3276
+ y: .29889531 * r$1 + .58662247 * g + .11448223 * b,
3277
+ i: .59597799 * r$1 - .2741761 * g - .32180189 * b,
3278
+ q: .21147017 * r$1 - .52261711 * g + .31114694 * b
3279
+ };
3280
+ if (alpha !== void 0) res.alpha = alpha;
3281
+ return res;
3282
+ };
3283
+ var convertRgbToYiq_default = convertRgbToYiq;
3284
+
3285
+ //#endregion
3286
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/yiq/convertYiqToRgb.js
3287
+ const convertYiqToRgb = ({ y, i, q, alpha }) => {
3288
+ if (y === void 0) y = 0;
3289
+ if (i === void 0) i = 0;
3290
+ if (q === void 0) q = 0;
3291
+ const res = {
3292
+ mode: "rgb",
3293
+ r: y + .95608445 * i + .6208885 * q,
3294
+ g: y - .27137664 * i - .6486059 * q,
3295
+ b: y - 1.10561724 * i + 1.70250126 * q
3296
+ };
3297
+ if (alpha !== void 0) res.alpha = alpha;
3298
+ return res;
3299
+ };
3300
+ var convertYiqToRgb_default = convertYiqToRgb;
3301
+
3302
+ //#endregion
3303
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/yiq/definition.js
3304
+ const definition = {
3305
+ mode: "yiq",
3306
+ toMode: { rgb: convertYiqToRgb_default },
3307
+ fromMode: { rgb: convertRgbToYiq_default },
3308
+ channels: [
3309
+ "y",
3310
+ "i",
3311
+ "q",
3312
+ "alpha"
3313
+ ],
3314
+ parse: ["--yiq"],
3315
+ serialize: "--yiq",
3316
+ ranges: {
3317
+ i: [-.595, .595],
3318
+ q: [-.522, .522]
3319
+ },
3320
+ interpolate: {
3321
+ y: interpolatorLinear,
3322
+ i: interpolatorLinear,
3323
+ q: interpolatorLinear,
3324
+ alpha: {
3325
+ use: interpolatorLinear,
3326
+ fixup: fixupAlpha
3327
+ }
3328
+ }
3329
+ };
3330
+ var definition_default$27 = definition;
3331
+
3332
+ //#endregion
3333
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/round.js
2184
3334
  const r = (value, precision) => Math.round(value * (precision = Math.pow(10, precision))) / precision;
2185
3335
  const round = (precision = 4) => (value) => typeof value === "number" ? r(value, precision) : value;
2186
3336
  var round_default = round;
2187
3337
 
2188
3338
  //#endregion
2189
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/formatter.js
3339
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/formatter.js
2190
3340
  let twoDecimals = round_default(2);
2191
3341
  const clamp = (value) => Math.max(0, Math.min(1, value || 0));
2192
3342
  const fixup = (value) => Math.round(clamp(value) * 255);
2193
- const rgb$1 = converter_default("rgb");
2194
- const hsl = converter_default("hsl");
3343
+ const rgb$2 = converter_default("rgb");
3344
+ const hsl$1 = converter_default("hsl");
2195
3345
  const serializeHex = (color) => {
2196
3346
  if (color === void 0) return void 0;
2197
3347
  let r$1 = fixup(color.r);
@@ -2219,12 +3369,12 @@ const formatCss = (c$1) => {
2219
3369
  if (typeof def.serialize === "function") return def.serialize(color);
2220
3370
  return void 0;
2221
3371
  };
2222
- const formatHex = (c$1) => serializeHex(rgb$1(c$1));
2223
- const formatHex8 = (c$1) => serializeHex8(rgb$1(c$1));
3372
+ const formatHex = (c$1) => serializeHex(rgb$2(c$1));
3373
+ const formatHex8 = (c$1) => serializeHex8(rgb$2(c$1));
2224
3374
 
2225
3375
  //#endregion
2226
- //#region ../../node_modules/.pnpm/culori@4.0.1/node_modules/culori/src/clamp.js
2227
- const rgb = converter_default("rgb");
3376
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/clamp.js
3377
+ const rgb$1 = converter_default("rgb");
2228
3378
  const fixup_rgb = (c$1) => {
2229
3379
  const res = {
2230
3380
  mode: c$1.mode,
@@ -2239,7 +3389,7 @@ const inrange_rgb = (c$1) => {
2239
3389
  return c$1 !== void 0 && (c$1.r === void 0 || c$1.r >= 0 && c$1.r <= 1) && (c$1.g === void 0 || c$1.g >= 0 && c$1.g <= 1) && (c$1.b === void 0 || c$1.b >= 0 && c$1.b <= 1);
2240
3390
  };
2241
3391
  function displayable(color) {
2242
- return inrange_rgb(rgb(color));
3392
+ return inrange_rgb(rgb$1(color));
2243
3393
  }
2244
3394
  function inGamut(mode = "rgb") {
2245
3395
  const { gamut } = getMode(mode);
@@ -2271,6 +3421,7 @@ function toGamut(dest = "rgb", mode = "oklch", delta = differenceEuclidean("oklc
2271
3421
  const clipToGamut = clampGamut(dest);
2272
3422
  const ucs = converter_default(mode);
2273
3423
  const { ranges } = getMode(mode);
3424
+ if (!ranges.l || !ranges.c) throw new Error("LCH-like space expected");
2274
3425
  return (color) => {
2275
3426
  color = _prepare_default(color);
2276
3427
  if (color === void 0) return void 0;
@@ -2660,8 +3811,8 @@ function escapeRegExpString(str) {
2660
3811
  function transform(pattern, separator) {
2661
3812
  if (separator === void 0) separator = true;
2662
3813
  if (Array.isArray(pattern)) {
2663
- var regExpPatterns = pattern.map(function(p) {
2664
- return "^".concat(transform(p, separator), "$");
3814
+ var regExpPatterns = pattern.map(function(p$2) {
3815
+ return "^".concat(transform(p$2, separator), "$");
2665
3816
  });
2666
3817
  return "(?:".concat(regExpPatterns.join("|"), ")");
2667
3818
  }
@@ -2763,6 +3914,39 @@ function validateCustomTransform(value, { $type }) {
2763
3914
  }
2764
3915
  }
2765
3916
 
3917
+ //#endregion
3918
+ //#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/index.js
3919
+ const a98 = useMode(definition_default);
3920
+ const cubehelix = useMode(definition_default$15);
3921
+ const dlab = useMode(definition_default$16);
3922
+ const dlch = useMode(definition_default$17);
3923
+ const hsi = useMode(definition_default$18);
3924
+ const hsl = useMode(definition_default$1);
3925
+ const hsv = useMode(definition_default$19);
3926
+ const hwb = useMode(definition_default$2);
3927
+ const itp = useMode(definition_default$20);
3928
+ const jab = useMode(definition_default$21);
3929
+ const jch = useMode(definition_default$22);
3930
+ const lab = useMode(definition_default$3);
3931
+ const lab65 = useMode(definition_default$4);
3932
+ const lch = useMode(definition_default$5);
3933
+ const lch65 = useMode(definition_default$23);
3934
+ const lchuv = useMode(definition_default$24);
3935
+ const lrgb = useMode(definition_default$6);
3936
+ const luv = useMode(definition_default$25);
3937
+ const okhsl = useMode(modeOkhsl_default);
3938
+ const okhsv = useMode(modeOkhsv_default);
3939
+ const oklab = useMode(definition_default$7);
3940
+ const oklch = useMode(definition_default$8);
3941
+ const p3 = useMode(definition_default$9);
3942
+ const prophoto = useMode(definition_default$10);
3943
+ const rec2020 = useMode(definition_default$11);
3944
+ const rgb = useMode(definition_default$12);
3945
+ const xyb = useMode(definition_default$26);
3946
+ const xyz50 = useMode(definition_default$13);
3947
+ const xyz65 = useMode(definition_default$14);
3948
+ const yiq = useMode(definition_default$27);
3949
+
2766
3950
  //#endregion
2767
3951
  //#region ../token-tools/dist/css.js
2768
3952
  function defaultAliasTransform(token) {
@@ -2776,7 +3960,7 @@ function generateShorthand({ $type, localID }) {
2776
3960
  "duration",
2777
3961
  "delay",
2778
3962
  "timing-function"
2779
- ].map((p) => makeCSSVar(`${localID}-${p}`, { wrapVar: true })).join(" ");
3963
+ ].map((p$2) => makeCSSVar(`${localID}-${p$2}`, { wrapVar: true })).join(" ");
2780
3964
  }
2781
3965
  }
2782
3966
  const CSS_VAR_RE = /(?:(\p{Uppercase_Letter}?[\p{Lowercase_Letter}\p{Number}]+|[\p{Uppercase_Letter}\p{Number}]+|[\u{80}-\u{10FFFF}\p{Number}]+)|.)/u;
@@ -2813,7 +3997,7 @@ function transformColor(token, options) {
2813
3997
  colorSpace,
2814
3998
  components,
2815
3999
  alpha
2816
- }, color);
4000
+ }, color, options.color?.depth);
2817
4001
  }
2818
4002
  const converters = {
2819
4003
  a98: useMode(definition_default),
@@ -2833,28 +4017,50 @@ const converters = {
2833
4017
  xyz50: useMode(definition_default$13),
2834
4018
  xyz65: useMode(definition_default$14)
2835
4019
  };
4020
+ const DEPTH_ROUNDING = {
4021
+ 24: round_default(4),
4022
+ 30: round_default(4),
4023
+ 36: round_default(5),
4024
+ 48: round_default(6)
4025
+ };
2836
4026
  /**
2837
4027
  * Downsample color to sRGB/Display P3/Rec2020 colorspaces.
2838
4028
  * Note: because Culori tends to convert to RGB color spaces to ensure the operation,
2839
4029
  * we have to do an additional step of converting back. So we’re not really converting;
2840
4030
  * we’re just preserving the original colorspace.
2841
4031
  */
2842
- function downsample($value, culoriColor) {
4032
+ function downsample($value, culoriColor, depth = 30) {
2843
4033
  if (!($value.colorSpace in CSS_TO_CULORI)) throw new Error(`Invalid colorSpace "${$value.colorSpace}". Expected one of: ${Object.keys(CSS_TO_CULORI).join(", ")}`);
2844
4034
  const conversionSpace = CSS_TO_CULORI[$value.colorSpace] || "oklab";
2845
4035
  let gamutSpace = conversionSpace;
2846
4036
  if (gamutSpace === "lab" || gamutSpace === "lab65") gamutSpace = "lch";
2847
4037
  else if (gamutSpace === "oklab") gamutSpace = "oklch";
2848
- const srgb = converters[conversionSpace](toGamut("rgb", gamutSpace)(culoriColor));
2849
- const p3 = converters[conversionSpace](toGamut("p3", gamutSpace)(culoriColor));
2850
- const rec2020 = converters[conversionSpace](toGamut("rec2020", gamutSpace)(culoriColor));
4038
+ let srgb = converters[conversionSpace](toGamut("rgb", gamutSpace)(culoriColor));
4039
+ let p3$2 = converters[conversionSpace](toGamut("p3", gamutSpace)(culoriColor));
4040
+ let rec2020$2 = converters[conversionSpace](toGamut("rec2020", gamutSpace)(culoriColor));
4041
+ if (typeof depth === "number") {
4042
+ if (!DEPTH_ROUNDING[depth]) throw new Error(`Invalid bit depth: ${depth}. Supported values: ${Object.keys(DEPTH_ROUNDING).join(", ")}`);
4043
+ srgb = roundColor(srgb, depth);
4044
+ p3$2 = roundColor(p3$2, depth);
4045
+ rec2020$2 = roundColor(rec2020$2, depth);
4046
+ }
2851
4047
  return {
2852
4048
  ".": formatCss(culoriColor),
2853
4049
  srgb: formatCss(srgb),
2854
- p3: formatCss(p3),
2855
- rec2020: formatCss(rec2020)
4050
+ p3: formatCss(p3$2),
4051
+ rec2020: formatCss(rec2020$2)
2856
4052
  };
2857
4053
  }
4054
+ /** Round color to certain depth. */
4055
+ function roundColor(color, depth = 30) {
4056
+ if (depth === "unlimited") return color;
4057
+ const newColor = { ...color };
4058
+ for (const [k$3, v] of Object.entries(color)) {
4059
+ if (typeof v !== "number" || k$3 === "mode") continue;
4060
+ newColor[k$3] = DEPTH_ROUNDING[depth](v);
4061
+ }
4062
+ return newColor;
4063
+ }
2858
4064
  /** Convert dimension value to CSS */
2859
4065
  function transformDimension(token, options) {
2860
4066
  const { tokensSet, transformAlias = defaultAliasTransform } = options;
@@ -3109,7 +4315,7 @@ function _printRule(rule) {
3109
4315
  }
3110
4316
  const declarations = Object.entries(rule.declarations);
3111
4317
  declarations.sort((a, b) => a[0].localeCompare(b[0], "en-us", { numeric: true }));
3112
- for (const [k$3, v] of declarations) output.push(`${indent}${k$3}: ${v};`);
4318
+ for (const [k$3, d] of declarations) output.push(`${indent}${k$3}: ${d.value};${d.description ? ` /* ${d.description} */` : ""}`);
3113
4319
  while (indent !== "") {
3114
4320
  indent = indent.substring(0, indent.length - 2);
3115
4321
  output.push(`${indent}}`);
@@ -3134,7 +4340,7 @@ function makeSelector(token, prefix, subgroup) {
3134
4340
  return `.${prefix}${subgroup || ""}-${kebabCase(token.token.id).replace(GROUP_REGEX[prefix], "")}`;
3135
4341
  }
3136
4342
  function makeVarValue(token) {
3137
- return makeCSSVar(token.localID ?? token.token.id, { wrapVar: true });
4343
+ return { value: makeCSSVar(token.localID ?? token.token.id, { wrapVar: true }) };
3138
4344
  }
3139
4345
  function generateUtilityCSS(groups, tokens) {
3140
4346
  const output = [];
@@ -3161,7 +4367,7 @@ function generateUtilityCSS(groups, tokens) {
3161
4367
  }
3162
4368
  case "gradient": output.push({
3163
4369
  selectors: [selector],
3164
- declarations: { "background-image": `linear-gradient(${makeCSSVar(token.localID ?? token.token.id, { wrapVar: true })})` }
4370
+ declarations: { "background-image": { value: `linear-gradient(${makeCSSVar(token.localID ?? token.token.id, { wrapVar: true })})` } }
3165
4371
  });
3166
4372
  }
3167
4373
  }
@@ -3204,7 +4410,7 @@ function generateUtilityCSS(groups, tokens) {
3204
4410
  const selector = makeSelector(token, "font");
3205
4411
  if (token.token.$type === "typography" && token.type === "MULTI_VALUE") {
3206
4412
  const declarations = {};
3207
- for (const k$3 of Object.keys(token.value)) declarations[k$3] = makeCSSVar(`${token.localID ?? token.token.id}-${k$3}`, { wrapVar: true });
4413
+ for (const k$3 of Object.keys(token.value)) declarations[k$3] = { value: makeCSSVar(`${token.localID ?? token.token.id}-${k$3}`, { wrapVar: true }) };
3208
4414
  output.push({
3209
4415
  selectors: [selector],
3210
4416
  declarations
@@ -3304,9 +4510,9 @@ function generateUtilityCSS(groups, tokens) {
3304
4510
  output.push({
3305
4511
  selectors: [selector],
3306
4512
  declarations: {
3307
- background: `-webkit-linear-gradient(${value})`,
3308
- "-webkit-background-clip": "text",
3309
- "-webkit-text-fill-color": "transparent"
4513
+ background: { value: `-webkit-linear-gradient(${value.value})` },
4514
+ "-webkit-background-clip": { value: "text" },
4515
+ "-webkit-text-fill-color": { value: "transparent" }
3310
4516
  }
3311
4517
  });
3312
4518
  break;
@@ -3358,15 +4564,33 @@ function buildFormat({ getTransforms, exclude, utility, modeSelectors, baseSelec
3358
4564
  format: FORMAT_ID,
3359
4565
  id: token.token.aliasedBy
3360
4566
  }) : [];
3361
- if (token.type === "SINGLE_VALUE") rootRule.declarations[localID] = token.value;
4567
+ if (token.type === "SINGLE_VALUE") rootRule.declarations[localID] = {
4568
+ value: token.value,
4569
+ description: token.token.$description
4570
+ };
3362
4571
  else if (token.value.srgb && token.value.p3 && token.value.rec2020) {
3363
- rootRule.declarations[localID] = token.value.srgb;
4572
+ rootRule.declarations[localID] = {
4573
+ value: token.value.srgb,
4574
+ description: token.token.$description
4575
+ };
3364
4576
  if (token.value.p3 !== token.value.srgb) {
3365
- p3Rule.declarations[localID] = token.value.p3;
3366
- rec2020Rule.declarations[localID] = token.value.rec2020;
4577
+ p3Rule.declarations[localID] = {
4578
+ value: token.value.p3,
4579
+ description: token.token.$description
4580
+ };
4581
+ rec2020Rule.declarations[localID] = {
4582
+ value: token.value.rec2020,
4583
+ description: token.token.$description
4584
+ };
3367
4585
  for (const alias of aliasTokens) if (alias.localID && typeof alias.value === "string") {
3368
- p3Rule.declarations[alias.localID] ??= alias.value;
3369
- rec2020Rule.declarations[alias.localID] ??= alias.value;
4586
+ p3Rule.declarations[alias.localID] ??= {
4587
+ value: alias.value,
4588
+ description: token.token.$description
4589
+ };
4590
+ rec2020Rule.declarations[alias.localID] ??= {
4591
+ value: alias.value,
4592
+ description: token.token.$description
4593
+ };
3370
4594
  }
3371
4595
  }
3372
4596
  } else if (token.type === "MULTI_VALUE") {
@@ -3374,8 +4598,14 @@ function buildFormat({ getTransforms, exclude, utility, modeSelectors, baseSelec
3374
4598
  $type: token.token.$type,
3375
4599
  localID
3376
4600
  });
3377
- if (shorthand) rootRule.declarations[token.localID ?? token.token.id] = shorthand;
3378
- for (const [name, value] of Object.entries(token.value)) rootRule.declarations[name === "." ? localID : [localID, name].join("-")] = value;
4601
+ if (shorthand) rootRule.declarations[token.localID ?? token.token.id] = {
4602
+ value: shorthand,
4603
+ description: token.token.$description
4604
+ };
4605
+ for (const [name, value] of Object.entries(token.value)) rootRule.declarations[name === "." ? localID : [localID, name].join("-")] = {
4606
+ value,
4607
+ description: token.token.$description
4608
+ };
3379
4609
  }
3380
4610
  }
3381
4611
  }
@@ -3409,15 +4639,33 @@ function buildFormat({ getTransforms, exclude, utility, modeSelectors, baseSelec
3409
4639
  format: FORMAT_ID,
3410
4640
  id: token.token.aliasedBy
3411
4641
  }) : [];
3412
- if (token.type === "SINGLE_VALUE") selectorRule.declarations[localID] = token.value;
4642
+ if (token.type === "SINGLE_VALUE") selectorRule.declarations[localID] = {
4643
+ value: token.value,
4644
+ description: token.token.$description
4645
+ };
3413
4646
  else if (token.value.srgb && token.value.p3 && token.value.rec2020) {
3414
- selectorRule.declarations[localID] = token.value.srgb;
4647
+ selectorRule.declarations[localID] = {
4648
+ value: token.value.srgb,
4649
+ description: token.token.$description
4650
+ };
3415
4651
  if (token.value.p3 !== token.value.srgb) {
3416
- selectorP3Rule.declarations[localID] = token.value.p3;
3417
- selectorRec2020Rule.declarations[localID] = token.value.rec2020;
4652
+ selectorP3Rule.declarations[localID] = {
4653
+ value: token.value.p3,
4654
+ description: token.token.$description
4655
+ };
4656
+ selectorRec2020Rule.declarations[localID] = {
4657
+ value: token.value.rec2020,
4658
+ description: token.token.$description
4659
+ };
3418
4660
  for (const alias of aliasTokens) if (alias.localID && typeof alias.value === "string") {
3419
- selectorP3Rule.declarations[alias.localID] ??= alias.value;
3420
- selectorRec2020Rule.declarations[alias.localID] ??= alias.value;
4661
+ selectorP3Rule.declarations[alias.localID] ??= {
4662
+ value: alias.value,
4663
+ description: token.token.$description
4664
+ };
4665
+ selectorRec2020Rule.declarations[alias.localID] ??= {
4666
+ value: alias.value,
4667
+ description: token.token.$description
4668
+ };
3421
4669
  }
3422
4670
  }
3423
4671
  } else {
@@ -3425,12 +4673,24 @@ function buildFormat({ getTransforms, exclude, utility, modeSelectors, baseSelec
3425
4673
  $type: token.token.$type,
3426
4674
  localID
3427
4675
  });
3428
- if (shorthand) selectorRule.declarations[localID] = shorthand;
3429
- for (const [name, subvalue] of Object.entries(token.value)) selectorRule.declarations[`${localID}-${name}`] = subvalue;
4676
+ if (shorthand) selectorRule.declarations[localID] = {
4677
+ value: shorthand,
4678
+ description: token.token.$description
4679
+ };
4680
+ for (const [name, subvalue] of Object.entries(token.value)) selectorRule.declarations[`${localID}-${name}`] = {
4681
+ value: subvalue,
4682
+ description: token.token.$description
4683
+ };
3430
4684
  }
3431
- for (const alias of aliasTokens) if (alias.localID && typeof alias.value === "string") selectorAliasDeclarations[alias.localID] = alias.value;
4685
+ for (const alias of aliasTokens) if (alias.localID && typeof alias.value === "string") selectorAliasDeclarations[alias.localID] = {
4686
+ value: alias.value,
4687
+ description: token.token.$description
4688
+ };
3432
4689
  }
3433
- for (const [name, value] of Object.entries(selectorAliasDeclarations)) selectorRule.declarations[name] ??= value;
4690
+ for (const [name, { value, description }] of Object.entries(selectorAliasDeclarations)) selectorRule.declarations[name] ??= {
4691
+ value,
4692
+ description
4693
+ };
3434
4694
  }
3435
4695
  if (utility && Object.keys(utility).length) rules.push(...generateUtilityCSS(utility, getTransforms({
3436
4696
  format: FORMAT_ID,