@terrazzo/plugin-css 0.10.0 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/dist/index.js +134 -111
- package/dist/index.js.map +1 -1
- package/package.json +5 -5
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
204
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/regex.js
|
|
205
205
|
const num$1 = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";
|
|
206
206
|
const num_none = `(?:${num$1}|none)`;
|
|
207
207
|
const per = `${num$1}%`;
|
|
@@ -214,7 +214,7 @@ const c = `\\s*,\\s*`;
|
|
|
214
214
|
const rx_num_per_none = new RegExp("^" + num_per_none + "$");
|
|
215
215
|
|
|
216
216
|
//#endregion
|
|
217
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
217
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseRgbLegacy.js
|
|
218
218
|
const rgb_num_old = new RegExp(`^rgba?\\(\\s*${num$1}${c}${num$1}${c}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
|
|
219
219
|
const rgb_per_old = new RegExp(`^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
|
|
220
220
|
const parseRgbLegacy = (color) => {
|
|
@@ -236,7 +236,7 @@ const parseRgbLegacy = (color) => {
|
|
|
236
236
|
var parseRgbLegacy_default = parseRgbLegacy;
|
|
237
237
|
|
|
238
238
|
//#endregion
|
|
239
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
239
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/_prepare.js
|
|
240
240
|
const prepare = (color, mode) => color === void 0 ? void 0 : typeof color !== "object" ? parse_default(color) : color.mode !== void 0 ? color : mode ? {
|
|
241
241
|
...color,
|
|
242
242
|
mode
|
|
@@ -244,12 +244,12 @@ const prepare = (color, mode) => color === void 0 ? void 0 : typeof color !== "o
|
|
|
244
244
|
var _prepare_default = prepare;
|
|
245
245
|
|
|
246
246
|
//#endregion
|
|
247
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
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.
|
|
252
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/modes.js
|
|
253
253
|
const converters$1 = {};
|
|
254
254
|
const modes = {};
|
|
255
255
|
const parsers = [];
|
|
@@ -289,7 +289,7 @@ const useParser = (parser, mode) => {
|
|
|
289
289
|
};
|
|
290
290
|
|
|
291
291
|
//#endregion
|
|
292
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
603
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/fixup/alpha.js
|
|
604
604
|
const fixupAlpha = (arr) => {
|
|
605
605
|
let some_defined = false;
|
|
606
606
|
let res = arr.map((v) => {
|
|
@@ -614,7 +614,7 @@ const fixupAlpha = (arr) => {
|
|
|
614
614
|
};
|
|
615
615
|
|
|
616
616
|
//#endregion
|
|
617
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
617
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/definition.js
|
|
618
618
|
const definition$15 = {
|
|
619
619
|
mode: "rgb",
|
|
620
620
|
channels: [
|
|
@@ -656,7 +656,7 @@ const definition$15 = {
|
|
|
656
656
|
var definition_default$12 = definition$15;
|
|
657
657
|
|
|
658
658
|
//#endregion
|
|
659
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
659
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/convertA98ToXyz65.js
|
|
660
660
|
const linearize$2 = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
|
|
661
661
|
const convertA98ToXyz65 = (a98) => {
|
|
662
662
|
let r$1 = linearize$2(a98.r);
|
|
@@ -674,7 +674,7 @@ const convertA98ToXyz65 = (a98) => {
|
|
|
674
674
|
var convertA98ToXyz65_default = convertA98ToXyz65;
|
|
675
675
|
|
|
676
676
|
//#endregion
|
|
677
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
677
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/convertXyz65ToA98.js
|
|
678
678
|
const gamma$2 = (v) => Math.pow(Math.abs(v), 256 / 563) * Math.sign(v);
|
|
679
679
|
const convertXyz65ToA98 = ({ x, y, z, alpha }) => {
|
|
680
680
|
if (x === void 0) x = 0;
|
|
@@ -692,7 +692,7 @@ const convertXyz65ToA98 = ({ x, y, z, alpha }) => {
|
|
|
692
692
|
var convertXyz65ToA98_default = convertXyz65ToA98;
|
|
693
693
|
|
|
694
694
|
//#endregion
|
|
695
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
695
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/convertRgbToLrgb.js
|
|
696
696
|
const fn$3 = (c$1 = 0) => {
|
|
697
697
|
const abs = Math.abs(c$1);
|
|
698
698
|
if (abs <= .04045) return c$1 / 12.92;
|
|
@@ -711,7 +711,7 @@ const convertRgbToLrgb = ({ r: r$1, g, b, alpha }) => {
|
|
|
711
711
|
var convertRgbToLrgb_default = convertRgbToLrgb;
|
|
712
712
|
|
|
713
713
|
//#endregion
|
|
714
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
714
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertRgbToXyz65.js
|
|
715
715
|
const convertRgbToXyz65 = (rgb$2) => {
|
|
716
716
|
let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
|
|
717
717
|
let res = {
|
|
@@ -726,7 +726,7 @@ const convertRgbToXyz65 = (rgb$2) => {
|
|
|
726
726
|
var convertRgbToXyz65_default = convertRgbToXyz65;
|
|
727
727
|
|
|
728
728
|
//#endregion
|
|
729
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
729
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/convertLrgbToRgb.js
|
|
730
730
|
const fn$2 = (c$1 = 0) => {
|
|
731
731
|
const abs = Math.abs(c$1);
|
|
732
732
|
if (abs > .0031308) return (Math.sign(c$1) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
|
|
@@ -745,7 +745,7 @@ const convertLrgbToRgb = ({ r: r$1, g, b, alpha }, mode = "rgb") => {
|
|
|
745
745
|
var convertLrgbToRgb_default = convertLrgbToRgb;
|
|
746
746
|
|
|
747
747
|
//#endregion
|
|
748
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
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,7 +761,7 @@ 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.
|
|
764
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/definition.js
|
|
765
765
|
const definition$14 = {
|
|
766
766
|
...definition_default$12,
|
|
767
767
|
mode: "a98",
|
|
@@ -779,12 +779,12 @@ const definition$14 = {
|
|
|
779
779
|
var definition_default = definition$14;
|
|
780
780
|
|
|
781
781
|
//#endregion
|
|
782
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
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.
|
|
787
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/convertHslToRgb.js
|
|
788
788
|
function convertHslToRgb({ h, s, l, alpha }) {
|
|
789
789
|
h = normalizeHue_default(h !== void 0 ? h : 0);
|
|
790
790
|
if (s === void 0) s = 0;
|
|
@@ -847,7 +847,7 @@ function convertHslToRgb({ h, s, l, alpha }) {
|
|
|
847
847
|
}
|
|
848
848
|
|
|
849
849
|
//#endregion
|
|
850
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
850
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/convertRgbToHsl.js
|
|
851
851
|
function convertRgbToHsl({ r: r$1, g, b, alpha }) {
|
|
852
852
|
if (r$1 === void 0) r$1 = 0;
|
|
853
853
|
if (g === void 0) g = 0;
|
|
@@ -864,7 +864,7 @@ function convertRgbToHsl({ r: r$1, g, b, alpha }) {
|
|
|
864
864
|
}
|
|
865
865
|
|
|
866
866
|
//#endregion
|
|
867
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
867
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/hue.js
|
|
868
868
|
const hueToDeg = (val, unit) => {
|
|
869
869
|
switch (unit) {
|
|
870
870
|
case "deg": return +val;
|
|
@@ -876,7 +876,7 @@ const hueToDeg = (val, unit) => {
|
|
|
876
876
|
var hue_default = hueToDeg;
|
|
877
877
|
|
|
878
878
|
//#endregion
|
|
879
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
879
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/parseHslLegacy.js
|
|
880
880
|
const hsl_old = new RegExp(`^hsla?\\(\\s*${hue$1}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
|
|
881
881
|
const parseHslLegacy = (color) => {
|
|
882
882
|
let match = color.match(hsl_old);
|
|
@@ -893,7 +893,7 @@ const parseHslLegacy = (color) => {
|
|
|
893
893
|
var parseHslLegacy_default = parseHslLegacy;
|
|
894
894
|
|
|
895
895
|
//#endregion
|
|
896
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
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.
|
|
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.
|
|
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.
|
|
981
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/average.js
|
|
982
982
|
const averageAngle = (val) => {
|
|
983
983
|
let sum = val.reduce((sum$1, val$1) => {
|
|
984
984
|
if (val$1 !== void 0) {
|
|
@@ -996,7 +996,7 @@ const averageAngle = (val) => {
|
|
|
996
996
|
};
|
|
997
997
|
|
|
998
998
|
//#endregion
|
|
999
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
999
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/definition.js
|
|
1000
1000
|
const definition$13 = {
|
|
1001
1001
|
mode: "hsl",
|
|
1002
1002
|
toMode: { rgb: convertHslToRgb },
|
|
@@ -1029,7 +1029,7 @@ const definition$13 = {
|
|
|
1029
1029
|
var definition_default$1 = definition$13;
|
|
1030
1030
|
|
|
1031
1031
|
//#endregion
|
|
1032
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1032
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/convertHsvToRgb.js
|
|
1033
1033
|
function convertHsvToRgb({ h, s, v, alpha }) {
|
|
1034
1034
|
h = normalizeHue_default(h !== void 0 ? h : 0);
|
|
1035
1035
|
if (s === void 0) s = 0;
|
|
@@ -1091,7 +1091,7 @@ function convertHsvToRgb({ h, s, v, alpha }) {
|
|
|
1091
1091
|
}
|
|
1092
1092
|
|
|
1093
1093
|
//#endregion
|
|
1094
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1094
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/convertRgbToHsv.js
|
|
1095
1095
|
function convertRgbToHsv({ r: r$1, g, b, alpha }) {
|
|
1096
1096
|
if (r$1 === void 0) r$1 = 0;
|
|
1097
1097
|
if (g === void 0) g = 0;
|
|
@@ -1108,7 +1108,7 @@ function convertRgbToHsv({ r: r$1, g, b, alpha }) {
|
|
|
1108
1108
|
}
|
|
1109
1109
|
|
|
1110
1110
|
//#endregion
|
|
1111
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1111
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/definition.js
|
|
1112
1112
|
const definition$12 = {
|
|
1113
1113
|
mode: "hsv",
|
|
1114
1114
|
toMode: { rgb: convertHsvToRgb },
|
|
@@ -1141,7 +1141,7 @@ const definition$12 = {
|
|
|
1141
1141
|
var definition_default$15 = definition$12;
|
|
1142
1142
|
|
|
1143
1143
|
//#endregion
|
|
1144
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1144
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/convertHwbToRgb.js
|
|
1145
1145
|
function convertHwbToRgb({ h, w, b, alpha }) {
|
|
1146
1146
|
if (w === void 0) w = 0;
|
|
1147
1147
|
if (b === void 0) b = 0;
|
|
@@ -1159,7 +1159,7 @@ function convertHwbToRgb({ h, w, b, alpha }) {
|
|
|
1159
1159
|
}
|
|
1160
1160
|
|
|
1161
1161
|
//#endregion
|
|
1162
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1162
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/convertRgbToHwb.js
|
|
1163
1163
|
function convertRgbToHwb(rgba) {
|
|
1164
1164
|
let hsv = convertRgbToHsv(rgba);
|
|
1165
1165
|
if (hsv === void 0) return void 0;
|
|
@@ -1176,7 +1176,7 @@ function convertRgbToHwb(rgba) {
|
|
|
1176
1176
|
}
|
|
1177
1177
|
|
|
1178
1178
|
//#endregion
|
|
1179
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1179
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/parseHwb.js
|
|
1180
1180
|
function ParseHwb(color, parsed) {
|
|
1181
1181
|
if (!parsed || parsed[0] !== "hwb") return void 0;
|
|
1182
1182
|
const res = { mode: "hwb" };
|
|
@@ -1199,7 +1199,7 @@ function ParseHwb(color, parsed) {
|
|
|
1199
1199
|
var parseHwb_default = ParseHwb;
|
|
1200
1200
|
|
|
1201
1201
|
//#endregion
|
|
1202
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1202
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/definition.js
|
|
1203
1203
|
const definition$11 = {
|
|
1204
1204
|
mode: "hwb",
|
|
1205
1205
|
toMode: { rgb: convertHwbToRgb },
|
|
@@ -1232,12 +1232,12 @@ const definition$11 = {
|
|
|
1232
1232
|
var definition_default$2 = definition$11;
|
|
1233
1233
|
|
|
1234
1234
|
//#endregion
|
|
1235
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1235
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/constants.js
|
|
1236
1236
|
const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
|
|
1237
1237
|
const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1238
1238
|
|
|
1239
1239
|
//#endregion
|
|
1240
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1240
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/constants.js
|
|
1241
1241
|
const D50 = {
|
|
1242
1242
|
X: .3457 / .3585,
|
|
1243
1243
|
Y: 1,
|
|
@@ -1252,7 +1252,7 @@ const k$2 = Math.pow(29, 3) / Math.pow(3, 3);
|
|
|
1252
1252
|
const e$2 = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1253
1253
|
|
|
1254
1254
|
//#endregion
|
|
1255
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1255
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertLabToXyz50.js
|
|
1256
1256
|
let fn$1 = (v) => Math.pow(v, 3) > e$1 ? Math.pow(v, 3) : (116 * v - 16) / k$1;
|
|
1257
1257
|
const convertLabToXyz50 = ({ l, a, b, alpha }) => {
|
|
1258
1258
|
if (l === void 0) l = 0;
|
|
@@ -1273,7 +1273,7 @@ const convertLabToXyz50 = ({ l, a, b, alpha }) => {
|
|
|
1273
1273
|
var convertLabToXyz50_default = convertLabToXyz50;
|
|
1274
1274
|
|
|
1275
1275
|
//#endregion
|
|
1276
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1276
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/convertXyz50ToRgb.js
|
|
1277
1277
|
const convertXyz50ToRgb = ({ x, y, z, alpha }) => {
|
|
1278
1278
|
if (x === void 0) x = 0;
|
|
1279
1279
|
if (y === void 0) y = 0;
|
|
@@ -1289,12 +1289,12 @@ const convertXyz50ToRgb = ({ x, y, z, alpha }) => {
|
|
|
1289
1289
|
var convertXyz50ToRgb_default = convertXyz50ToRgb;
|
|
1290
1290
|
|
|
1291
1291
|
//#endregion
|
|
1292
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1292
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertLabToRgb.js
|
|
1293
1293
|
const convertLabToRgb = (lab) => convertXyz50ToRgb_default(convertLabToXyz50_default(lab));
|
|
1294
1294
|
var convertLabToRgb_default = convertLabToRgb;
|
|
1295
1295
|
|
|
1296
1296
|
//#endregion
|
|
1297
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1297
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/convertRgbToXyz50.js
|
|
1298
1298
|
const convertRgbToXyz50 = (rgb$2) => {
|
|
1299
1299
|
let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
|
|
1300
1300
|
let res = {
|
|
@@ -1309,7 +1309,7 @@ const convertRgbToXyz50 = (rgb$2) => {
|
|
|
1309
1309
|
var convertRgbToXyz50_default = convertRgbToXyz50;
|
|
1310
1310
|
|
|
1311
1311
|
//#endregion
|
|
1312
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1312
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertXyz50ToLab.js
|
|
1313
1313
|
const f$1 = (value) => value > e$1 ? Math.cbrt(value) : (k$1 * value + 16) / 116;
|
|
1314
1314
|
const convertXyz50ToLab = ({ x, y, z, alpha }) => {
|
|
1315
1315
|
if (x === void 0) x = 0;
|
|
@@ -1330,7 +1330,7 @@ const convertXyz50ToLab = ({ x, y, z, alpha }) => {
|
|
|
1330
1330
|
var convertXyz50ToLab_default = convertXyz50ToLab;
|
|
1331
1331
|
|
|
1332
1332
|
//#endregion
|
|
1333
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1333
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertRgbToLab.js
|
|
1334
1334
|
const convertRgbToLab = (rgb$2) => {
|
|
1335
1335
|
let res = convertXyz50ToLab_default(convertRgbToXyz50_default(rgb$2));
|
|
1336
1336
|
if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
|
|
@@ -1339,7 +1339,7 @@ const convertRgbToLab = (rgb$2) => {
|
|
|
1339
1339
|
var convertRgbToLab_default = convertRgbToLab;
|
|
1340
1340
|
|
|
1341
1341
|
//#endregion
|
|
1342
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1342
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/parseLab.js
|
|
1343
1343
|
function parseLab(color, parsed) {
|
|
1344
1344
|
if (!parsed || parsed[0] !== "lab") return void 0;
|
|
1345
1345
|
const res = { mode: "lab" };
|
|
@@ -1354,7 +1354,7 @@ function parseLab(color, parsed) {
|
|
|
1354
1354
|
var parseLab_default = parseLab;
|
|
1355
1355
|
|
|
1356
1356
|
//#endregion
|
|
1357
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1357
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/definition.js
|
|
1358
1358
|
const definition$10 = {
|
|
1359
1359
|
mode: "lab",
|
|
1360
1360
|
toMode: {
|
|
@@ -1373,8 +1373,8 @@ const definition$10 = {
|
|
|
1373
1373
|
],
|
|
1374
1374
|
ranges: {
|
|
1375
1375
|
l: [0, 100],
|
|
1376
|
-
a: [-
|
|
1377
|
-
b: [-
|
|
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}` : ""})`,
|
|
@@ -1391,12 +1391,12 @@ const definition$10 = {
|
|
|
1391
1391
|
var definition_default$3 = definition$10;
|
|
1392
1392
|
|
|
1393
1393
|
//#endregion
|
|
1394
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1394
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/constants.js
|
|
1395
1395
|
const k = Math.pow(29, 3) / Math.pow(3, 3);
|
|
1396
1396
|
const e = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1397
1397
|
|
|
1398
1398
|
//#endregion
|
|
1399
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1399
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToXyz65.js
|
|
1400
1400
|
let fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
|
|
1401
1401
|
const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
|
|
1402
1402
|
if (l === void 0) l = 0;
|
|
@@ -1417,12 +1417,12 @@ const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
|
|
|
1417
1417
|
var convertLab65ToXyz65_default = convertLab65ToXyz65;
|
|
1418
1418
|
|
|
1419
1419
|
//#endregion
|
|
1420
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1420
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToRgb.js
|
|
1421
1421
|
const convertLab65ToRgb = (lab) => convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab));
|
|
1422
1422
|
var convertLab65ToRgb_default = convertLab65ToRgb;
|
|
1423
1423
|
|
|
1424
1424
|
//#endregion
|
|
1425
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1425
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertXyz65ToLab65.js
|
|
1426
1426
|
const f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
|
|
1427
1427
|
const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
|
|
1428
1428
|
if (x === void 0) x = 0;
|
|
@@ -1443,7 +1443,7 @@ const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
|
|
|
1443
1443
|
var convertXyz65ToLab65_default = convertXyz65ToLab65;
|
|
1444
1444
|
|
|
1445
1445
|
//#endregion
|
|
1446
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1446
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertRgbToLab65.js
|
|
1447
1447
|
const convertRgbToLab65 = (rgb$2) => {
|
|
1448
1448
|
let res = convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$2));
|
|
1449
1449
|
if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
|
|
@@ -1452,7 +1452,7 @@ const convertRgbToLab65 = (rgb$2) => {
|
|
|
1452
1452
|
var convertRgbToLab65_default = convertRgbToLab65;
|
|
1453
1453
|
|
|
1454
1454
|
//#endregion
|
|
1455
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1455
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/definition.js
|
|
1456
1456
|
const definition$9 = {
|
|
1457
1457
|
...definition_default$3,
|
|
1458
1458
|
mode: "lab65",
|
|
@@ -1468,14 +1468,14 @@ const definition$9 = {
|
|
|
1468
1468
|
},
|
|
1469
1469
|
ranges: {
|
|
1470
1470
|
l: [0, 100],
|
|
1471
|
-
a: [-
|
|
1472
|
-
b: [-
|
|
1471
|
+
a: [-125, 125],
|
|
1472
|
+
b: [-125, 125]
|
|
1473
1473
|
}
|
|
1474
1474
|
};
|
|
1475
1475
|
var definition_default$4 = definition$9;
|
|
1476
1476
|
|
|
1477
1477
|
//#endregion
|
|
1478
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
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.
|
|
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.
|
|
1510
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/parseLch.js
|
|
1511
1511
|
function parseLch(color, parsed) {
|
|
1512
1512
|
if (!parsed || parsed[0] !== "lch") return void 0;
|
|
1513
1513
|
const res = { mode: "lch" };
|
|
@@ -1527,7 +1527,7 @@ function parseLch(color, parsed) {
|
|
|
1527
1527
|
var parseLch_default = parseLch;
|
|
1528
1528
|
|
|
1529
1529
|
//#endregion
|
|
1530
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1530
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/definition.js
|
|
1531
1531
|
const definition$8 = {
|
|
1532
1532
|
mode: "lch",
|
|
1533
1533
|
toMode: {
|
|
@@ -1569,7 +1569,7 @@ const definition$8 = {
|
|
|
1569
1569
|
var definition_default$5 = definition$8;
|
|
1570
1570
|
|
|
1571
1571
|
//#endregion
|
|
1572
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1572
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/definition.js
|
|
1573
1573
|
const definition$7 = {
|
|
1574
1574
|
...definition_default$12,
|
|
1575
1575
|
mode: "lrgb",
|
|
@@ -1581,19 +1581,19 @@ const definition$7 = {
|
|
|
1581
1581
|
var definition_default$6 = definition$7;
|
|
1582
1582
|
|
|
1583
1583
|
//#endregion
|
|
1584
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1584
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToLrgb.js
|
|
1585
1585
|
const convertOklabToLrgb = ({ l, a, b, alpha }) => {
|
|
1586
1586
|
if (l === void 0) l = 0;
|
|
1587
1587
|
if (a === void 0) a = 0;
|
|
1588
1588
|
if (b === void 0) b = 0;
|
|
1589
|
-
let L = Math.pow(l
|
|
1590
|
-
let M = Math.pow(l
|
|
1591
|
-
let S = Math.pow(l
|
|
1589
|
+
let L = Math.pow(l + .3963377773761749 * a + .2158037573099136 * b, 3);
|
|
1590
|
+
let M = Math.pow(l - .1055613458156586 * a - .0638541728258133 * b, 3);
|
|
1591
|
+
let S = Math.pow(l - .0894841775298119 * a - 1.2914855480194092 * b, 3);
|
|
1592
1592
|
let res = {
|
|
1593
1593
|
mode: "lrgb",
|
|
1594
|
-
r: 4.
|
|
1595
|
-
g: -1.
|
|
1596
|
-
b: -.
|
|
1594
|
+
r: 4.076741636075957 * L - 3.3077115392580616 * M + .2309699031821044 * S,
|
|
1595
|
+
g: -1.2684379732850317 * L + 2.6097573492876887 * M - .3413193760026573 * S,
|
|
1596
|
+
b: -.0041960761386756 * L - .7034186179359362 * M + 1.7076146940746117 * S
|
|
1597
1597
|
};
|
|
1598
1598
|
if (alpha !== void 0) res.alpha = alpha;
|
|
1599
1599
|
return res;
|
|
@@ -1601,19 +1601,19 @@ const convertOklabToLrgb = ({ l, a, b, alpha }) => {
|
|
|
1601
1601
|
var convertOklabToLrgb_default = convertOklabToLrgb;
|
|
1602
1602
|
|
|
1603
1603
|
//#endregion
|
|
1604
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1604
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertLrgbToOklab.js
|
|
1605
1605
|
const convertLrgbToOklab = ({ r: r$1, g, b, alpha }) => {
|
|
1606
1606
|
if (r$1 === void 0) r$1 = 0;
|
|
1607
1607
|
if (g === void 0) g = 0;
|
|
1608
1608
|
if (b === void 0) b = 0;
|
|
1609
|
-
let L = Math.cbrt(.
|
|
1610
|
-
let M = Math.cbrt(.
|
|
1611
|
-
let S = Math.cbrt(.
|
|
1609
|
+
let L = Math.cbrt(.412221469470763 * r$1 + .5363325372617348 * g + .0514459932675022 * b);
|
|
1610
|
+
let M = Math.cbrt(.2119034958178252 * r$1 + .6806995506452344 * g + .1073969535369406 * b);
|
|
1611
|
+
let S = Math.cbrt(.0883024591900564 * r$1 + .2817188391361215 * g + .6299787016738222 * b);
|
|
1612
1612
|
let res = {
|
|
1613
1613
|
mode: "oklab",
|
|
1614
|
-
l: .
|
|
1615
|
-
a: 1.
|
|
1616
|
-
b: .
|
|
1614
|
+
l: .210454268309314 * L + .7936177747023054 * M - .0040720430116193 * S,
|
|
1615
|
+
a: 1.9779985324311684 * L - 2.42859224204858 * M + .450593709617411 * S,
|
|
1616
|
+
b: .0259040424655478 * L + .7827717124575296 * M - .8086757549230774 * S
|
|
1617
1617
|
};
|
|
1618
1618
|
if (alpha !== void 0) res.alpha = alpha;
|
|
1619
1619
|
return res;
|
|
@@ -1621,7 +1621,7 @@ const convertLrgbToOklab = ({ r: r$1, g, b, alpha }) => {
|
|
|
1621
1621
|
var convertLrgbToOklab_default = convertLrgbToOklab;
|
|
1622
1622
|
|
|
1623
1623
|
//#endregion
|
|
1624
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1624
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertRgbToOklab.js
|
|
1625
1625
|
const convertRgbToOklab = (rgb$2) => {
|
|
1626
1626
|
let res = convertLrgbToOklab_default(convertRgbToLrgb_default(rgb$2));
|
|
1627
1627
|
if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
|
|
@@ -1630,12 +1630,12 @@ const convertRgbToOklab = (rgb$2) => {
|
|
|
1630
1630
|
var convertRgbToOklab_default = convertRgbToOklab;
|
|
1631
1631
|
|
|
1632
1632
|
//#endregion
|
|
1633
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1633
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToRgb.js
|
|
1634
1634
|
const convertOklabToRgb = (c$1) => convertLrgbToRgb_default(convertOklabToLrgb_default(c$1));
|
|
1635
1635
|
var convertOklabToRgb_default = convertOklabToRgb;
|
|
1636
1636
|
|
|
1637
1637
|
//#endregion
|
|
1638
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1638
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/parseOklab.js
|
|
1639
1639
|
function parseOklab(color, parsed) {
|
|
1640
1640
|
if (!parsed || parsed[0] !== "oklab") return void 0;
|
|
1641
1641
|
const res = { mode: "oklab" };
|
|
@@ -1650,7 +1650,7 @@ function parseOklab(color, parsed) {
|
|
|
1650
1650
|
var parseOklab_default = parseOklab;
|
|
1651
1651
|
|
|
1652
1652
|
//#endregion
|
|
1653
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1653
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/definition.js
|
|
1654
1654
|
const definition$6 = {
|
|
1655
1655
|
...definition_default$3,
|
|
1656
1656
|
mode: "oklab",
|
|
@@ -1673,7 +1673,7 @@ const definition$6 = {
|
|
|
1673
1673
|
var definition_default$7 = definition$6;
|
|
1674
1674
|
|
|
1675
1675
|
//#endregion
|
|
1676
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1676
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklch/parseOklch.js
|
|
1677
1677
|
function parseOklch(color, parsed) {
|
|
1678
1678
|
if (!parsed || parsed[0] !== "oklch") return void 0;
|
|
1679
1679
|
const res = { mode: "oklch" };
|
|
@@ -1693,7 +1693,7 @@ function parseOklch(color, parsed) {
|
|
|
1693
1693
|
var parseOklch_default = parseOklch;
|
|
1694
1694
|
|
|
1695
1695
|
//#endregion
|
|
1696
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1696
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklch/definition.js
|
|
1697
1697
|
const definition$5 = {
|
|
1698
1698
|
...definition_default$5,
|
|
1699
1699
|
mode: "oklch",
|
|
@@ -1716,7 +1716,7 @@ const definition$5 = {
|
|
|
1716
1716
|
var definition_default$8 = definition$5;
|
|
1717
1717
|
|
|
1718
1718
|
//#endregion
|
|
1719
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1719
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/convertP3ToXyz65.js
|
|
1720
1720
|
const convertP3ToXyz65 = (rgb$2) => {
|
|
1721
1721
|
let { r: r$1, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
|
|
1722
1722
|
let res = {
|
|
@@ -1731,7 +1731,7 @@ const convertP3ToXyz65 = (rgb$2) => {
|
|
|
1731
1731
|
var convertP3ToXyz65_default = convertP3ToXyz65;
|
|
1732
1732
|
|
|
1733
1733
|
//#endregion
|
|
1734
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1734
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/convertXyz65ToP3.js
|
|
1735
1735
|
const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
|
|
1736
1736
|
if (x === void 0) x = 0;
|
|
1737
1737
|
if (y === void 0) y = 0;
|
|
@@ -1747,7 +1747,7 @@ const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
|
|
|
1747
1747
|
var convertXyz65ToP3_default = convertXyz65ToP3;
|
|
1748
1748
|
|
|
1749
1749
|
//#endregion
|
|
1750
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1750
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/definition.js
|
|
1751
1751
|
const definition$4 = {
|
|
1752
1752
|
...definition_default$12,
|
|
1753
1753
|
mode: "p3",
|
|
@@ -1765,7 +1765,7 @@ const definition$4 = {
|
|
|
1765
1765
|
var definition_default$9 = definition$4;
|
|
1766
1766
|
|
|
1767
1767
|
//#endregion
|
|
1768
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1768
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
|
|
1769
1769
|
const gamma$1 = (v) => {
|
|
1770
1770
|
let abs = Math.abs(v);
|
|
1771
1771
|
if (abs >= 1 / 512) return Math.sign(v) * Math.pow(abs, 1 / 1.8);
|
|
@@ -1787,7 +1787,7 @@ const convertXyz50ToProphoto = ({ x, y, z, alpha }) => {
|
|
|
1787
1787
|
var convertXyz50ToProphoto_default = convertXyz50ToProphoto;
|
|
1788
1788
|
|
|
1789
1789
|
//#endregion
|
|
1790
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1790
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/convertProphotoToXyz50.js
|
|
1791
1791
|
const linearize$1 = (v = 0) => {
|
|
1792
1792
|
let abs = Math.abs(v);
|
|
1793
1793
|
if (abs >= 16 / 512) return Math.sign(v) * Math.pow(abs, 1.8);
|
|
@@ -1809,7 +1809,7 @@ const convertProphotoToXyz50 = (prophoto) => {
|
|
|
1809
1809
|
var convertProphotoToXyz50_default = convertProphotoToXyz50;
|
|
1810
1810
|
|
|
1811
1811
|
//#endregion
|
|
1812
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1812
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/definition.js
|
|
1813
1813
|
const definition$3 = {
|
|
1814
1814
|
...definition_default$12,
|
|
1815
1815
|
mode: "prophoto",
|
|
@@ -1827,7 +1827,7 @@ const definition$3 = {
|
|
|
1827
1827
|
var definition_default$10 = definition$3;
|
|
1828
1828
|
|
|
1829
1829
|
//#endregion
|
|
1830
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1830
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
|
|
1831
1831
|
const α$1 = 1.09929682680944;
|
|
1832
1832
|
const β$1 = .018053968510807;
|
|
1833
1833
|
const gamma = (v) => {
|
|
@@ -1851,7 +1851,7 @@ const convertXyz65ToRec2020 = ({ x, y, z, alpha }) => {
|
|
|
1851
1851
|
var convertXyz65ToRec2020_default = convertXyz65ToRec2020;
|
|
1852
1852
|
|
|
1853
1853
|
//#endregion
|
|
1854
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1854
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/convertRec2020ToXyz65.js
|
|
1855
1855
|
const α = 1.09929682680944;
|
|
1856
1856
|
const β = .018053968510807;
|
|
1857
1857
|
const linearize = (v = 0) => {
|
|
@@ -1875,7 +1875,7 @@ const convertRec2020ToXyz65 = (rec2020) => {
|
|
|
1875
1875
|
var convertRec2020ToXyz65_default = convertRec2020ToXyz65;
|
|
1876
1876
|
|
|
1877
1877
|
//#endregion
|
|
1878
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1878
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/definition.js
|
|
1879
1879
|
const definition$2 = {
|
|
1880
1880
|
...definition_default$12,
|
|
1881
1881
|
mode: "rec2020",
|
|
@@ -1893,7 +1893,7 @@ const definition$2 = {
|
|
|
1893
1893
|
var definition_default$11 = definition$2;
|
|
1894
1894
|
|
|
1895
1895
|
//#endregion
|
|
1896
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1896
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/definition.js
|
|
1897
1897
|
const definition$1 = {
|
|
1898
1898
|
mode: "xyz50",
|
|
1899
1899
|
parse: ["xyz-d50"],
|
|
@@ -1930,7 +1930,7 @@ const definition$1 = {
|
|
|
1930
1930
|
var definition_default$13 = definition$1;
|
|
1931
1931
|
|
|
1932
1932
|
//#endregion
|
|
1933
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1933
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
|
|
1934
1934
|
const convertXyz65ToXyz50 = (xyz65) => {
|
|
1935
1935
|
let { x, y, z, alpha } = xyz65;
|
|
1936
1936
|
if (x === void 0) x = 0;
|
|
@@ -1948,7 +1948,7 @@ const convertXyz65ToXyz50 = (xyz65) => {
|
|
|
1948
1948
|
var convertXyz65ToXyz50_default = convertXyz65ToXyz50;
|
|
1949
1949
|
|
|
1950
1950
|
//#endregion
|
|
1951
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1951
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz50ToXyz65.js
|
|
1952
1952
|
const convertXyz50ToXyz65 = (xyz50) => {
|
|
1953
1953
|
let { x, y, z, alpha } = xyz50;
|
|
1954
1954
|
if (x === void 0) x = 0;
|
|
@@ -1966,7 +1966,7 @@ const convertXyz50ToXyz65 = (xyz50) => {
|
|
|
1966
1966
|
var convertXyz50ToXyz65_default = convertXyz50ToXyz65;
|
|
1967
1967
|
|
|
1968
1968
|
//#endregion
|
|
1969
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1969
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/definition.js
|
|
1970
1970
|
const definition = {
|
|
1971
1971
|
mode: "xyz65",
|
|
1972
1972
|
toMode: {
|
|
@@ -2003,7 +2003,7 @@ const definition = {
|
|
|
2003
2003
|
var definition_default$14 = definition;
|
|
2004
2004
|
|
|
2005
2005
|
//#endregion
|
|
2006
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2006
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsl/helpers.js
|
|
2007
2007
|
function toe(x) {
|
|
2008
2008
|
const k_1 = .206;
|
|
2009
2009
|
const k_2 = .03;
|
|
@@ -2089,7 +2089,7 @@ function get_ST_max(a_, b_, cusp = null) {
|
|
|
2089
2089
|
}
|
|
2090
2090
|
|
|
2091
2091
|
//#endregion
|
|
2092
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2092
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/convertOklabToOkhsv.js
|
|
2093
2093
|
function convertOklabToOkhsv(lab) {
|
|
2094
2094
|
let l = lab.l !== void 0 ? lab.l : 0;
|
|
2095
2095
|
let a = lab.a !== void 0 ? lab.a : 0;
|
|
@@ -2125,7 +2125,7 @@ function convertOklabToOkhsv(lab) {
|
|
|
2125
2125
|
}
|
|
2126
2126
|
|
|
2127
2127
|
//#endregion
|
|
2128
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2128
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/convertOkhsvToOklab.js
|
|
2129
2129
|
function convertOkhsvToOklab(hsv) {
|
|
2130
2130
|
const ret = { mode: "oklab" };
|
|
2131
2131
|
if (hsv.alpha !== void 0) ret.alpha = hsv.alpha;
|
|
@@ -2156,7 +2156,7 @@ function convertOkhsvToOklab(hsv) {
|
|
|
2156
2156
|
}
|
|
2157
2157
|
|
|
2158
2158
|
//#endregion
|
|
2159
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2159
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/modeOkhsv.js
|
|
2160
2160
|
const modeOkhsv = {
|
|
2161
2161
|
...definition_default$15,
|
|
2162
2162
|
mode: "okhsv",
|
|
@@ -2180,13 +2180,13 @@ const modeOkhsv = {
|
|
|
2180
2180
|
var modeOkhsv_default = modeOkhsv;
|
|
2181
2181
|
|
|
2182
2182
|
//#endregion
|
|
2183
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2183
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/round.js
|
|
2184
2184
|
const r = (value, precision) => Math.round(value * (precision = Math.pow(10, precision))) / precision;
|
|
2185
2185
|
const round = (precision = 4) => (value) => typeof value === "number" ? r(value, precision) : value;
|
|
2186
2186
|
var round_default = round;
|
|
2187
2187
|
|
|
2188
2188
|
//#endregion
|
|
2189
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2189
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/formatter.js
|
|
2190
2190
|
let twoDecimals = round_default(2);
|
|
2191
2191
|
const clamp = (value) => Math.max(0, Math.min(1, value || 0));
|
|
2192
2192
|
const fixup = (value) => Math.round(clamp(value) * 255);
|
|
@@ -2223,7 +2223,7 @@ const formatHex = (c$1) => serializeHex(rgb$1(c$1));
|
|
|
2223
2223
|
const formatHex8 = (c$1) => serializeHex8(rgb$1(c$1));
|
|
2224
2224
|
|
|
2225
2225
|
//#endregion
|
|
2226
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2226
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/clamp.js
|
|
2227
2227
|
const rgb = converter_default("rgb");
|
|
2228
2228
|
const fixup_rgb = (c$1) => {
|
|
2229
2229
|
const res = {
|
|
@@ -2271,6 +2271,7 @@ function toGamut(dest = "rgb", mode = "oklch", delta = differenceEuclidean("oklc
|
|
|
2271
2271
|
const clipToGamut = clampGamut(dest);
|
|
2272
2272
|
const ucs = converter_default(mode);
|
|
2273
2273
|
const { ranges } = getMode(mode);
|
|
2274
|
+
if (!ranges.l || !ranges.c) throw new Error("LCH-like space expected");
|
|
2274
2275
|
return (color) => {
|
|
2275
2276
|
color = _prepare_default(color);
|
|
2276
2277
|
if (color === void 0) return void 0;
|
|
@@ -2813,7 +2814,7 @@ function transformColor(token, options) {
|
|
|
2813
2814
|
colorSpace,
|
|
2814
2815
|
components,
|
|
2815
2816
|
alpha
|
|
2816
|
-
}, color);
|
|
2817
|
+
}, color, options.color?.depth);
|
|
2817
2818
|
}
|
|
2818
2819
|
const converters = {
|
|
2819
2820
|
a98: useMode(definition_default),
|
|
@@ -2833,21 +2834,33 @@ const converters = {
|
|
|
2833
2834
|
xyz50: useMode(definition_default$13),
|
|
2834
2835
|
xyz65: useMode(definition_default$14)
|
|
2835
2836
|
};
|
|
2837
|
+
const DEPTH_ROUNDING = {
|
|
2838
|
+
24: round_default(4),
|
|
2839
|
+
30: round_default(4),
|
|
2840
|
+
36: round_default(5),
|
|
2841
|
+
48: round_default(6)
|
|
2842
|
+
};
|
|
2836
2843
|
/**
|
|
2837
2844
|
* Downsample color to sRGB/Display P3/Rec2020 colorspaces.
|
|
2838
2845
|
* Note: because Culori tends to convert to RGB color spaces to ensure the operation,
|
|
2839
2846
|
* we have to do an additional step of converting back. So we’re not really converting;
|
|
2840
2847
|
* we’re just preserving the original colorspace.
|
|
2841
2848
|
*/
|
|
2842
|
-
function downsample($value, culoriColor) {
|
|
2849
|
+
function downsample($value, culoriColor, depth = 30) {
|
|
2843
2850
|
if (!($value.colorSpace in CSS_TO_CULORI)) throw new Error(`Invalid colorSpace "${$value.colorSpace}". Expected one of: ${Object.keys(CSS_TO_CULORI).join(", ")}`);
|
|
2844
2851
|
const conversionSpace = CSS_TO_CULORI[$value.colorSpace] || "oklab";
|
|
2845
2852
|
let gamutSpace = conversionSpace;
|
|
2846
2853
|
if (gamutSpace === "lab" || gamutSpace === "lab65") gamutSpace = "lch";
|
|
2847
2854
|
else if (gamutSpace === "oklab") gamutSpace = "oklch";
|
|
2848
|
-
|
|
2849
|
-
|
|
2850
|
-
|
|
2855
|
+
let srgb = converters[conversionSpace](toGamut("rgb", gamutSpace)(culoriColor));
|
|
2856
|
+
let p3 = converters[conversionSpace](toGamut("p3", gamutSpace)(culoriColor));
|
|
2857
|
+
let rec2020 = converters[conversionSpace](toGamut("rec2020", gamutSpace)(culoriColor));
|
|
2858
|
+
if (typeof depth === "number") {
|
|
2859
|
+
if (!DEPTH_ROUNDING[depth]) throw new Error(`Invalid bit depth: ${depth}. Supported values: ${Object.keys(DEPTH_ROUNDING).join(", ")}`);
|
|
2860
|
+
srgb = roundColor(srgb, depth);
|
|
2861
|
+
p3 = roundColor(p3, depth);
|
|
2862
|
+
rec2020 = roundColor(rec2020, depth);
|
|
2863
|
+
}
|
|
2851
2864
|
return {
|
|
2852
2865
|
".": formatCss(culoriColor),
|
|
2853
2866
|
srgb: formatCss(srgb),
|
|
@@ -2855,6 +2868,16 @@ function downsample($value, culoriColor) {
|
|
|
2855
2868
|
rec2020: formatCss(rec2020)
|
|
2856
2869
|
};
|
|
2857
2870
|
}
|
|
2871
|
+
/** Round color to certain depth. */
|
|
2872
|
+
function roundColor(color, depth = 30) {
|
|
2873
|
+
if (depth === "unlimited") return color;
|
|
2874
|
+
const newColor = { ...color };
|
|
2875
|
+
for (const [k$3, v] of Object.entries(color)) {
|
|
2876
|
+
if (typeof v !== "number" || k$3 === "mode") continue;
|
|
2877
|
+
newColor[k$3] = DEPTH_ROUNDING[depth](v);
|
|
2878
|
+
}
|
|
2879
|
+
return newColor;
|
|
2880
|
+
}
|
|
2858
2881
|
/** Convert dimension value to CSS */
|
|
2859
2882
|
function transformDimension(token, options) {
|
|
2860
2883
|
const { tokensSet, transformAlias = defaultAliasTransform } = options;
|