@terrazzo/plugin-sass 0.9.1 → 0.10.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +39 -0
- package/dist/index.js +633 -273
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -517,9 +517,9 @@ var parse_default$1 = parse$1;
|
|
|
517
517
|
function parseRgb$1(color, parsed) {
|
|
518
518
|
if (!parsed || parsed[0] !== "rgb" && parsed[0] !== "rgba") return void 0;
|
|
519
519
|
const res = { mode: "rgb" };
|
|
520
|
-
const [, r$1, g, b, alpha] = parsed;
|
|
521
|
-
if (r$1.type === Tok$1.Hue || g.type === Tok$1.Hue || b.type === Tok$1.Hue) return void 0;
|
|
522
|
-
if (r$1.type !== Tok$1.None) res.r = r$1.type === Tok$1.Number ? r$1.value / 255 : r$1.value / 100;
|
|
520
|
+
const [, r$1$1, g, b, alpha] = parsed;
|
|
521
|
+
if (r$1$1.type === Tok$1.Hue || g.type === Tok$1.Hue || b.type === Tok$1.Hue) return void 0;
|
|
522
|
+
if (r$1$1.type !== Tok$1.None) res.r = r$1$1.type === Tok$1.Number ? r$1$1.value / 255 : r$1$1.value / 100;
|
|
523
523
|
if (g.type !== Tok$1.None) res.g = g.type === Tok$1.Number ? g.value / 255 : g.value / 100;
|
|
524
524
|
if (b.type !== Tok$1.None) res.b = b.type === Tok$1.Number ? b.value / 255 : b.value / 100;
|
|
525
525
|
if (alpha.type !== Tok$1.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok$1.Number ? alpha.value : alpha.value / 100));
|
|
@@ -605,17 +605,17 @@ const definition$15$1 = {
|
|
|
605
605
|
b: 0
|
|
606
606
|
}
|
|
607
607
|
};
|
|
608
|
-
var definition_default$
|
|
608
|
+
var definition_default$12$1 = definition$15$1;
|
|
609
609
|
const linearize$2$1 = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
|
|
610
610
|
const convertA98ToXyz65$1 = (a98) => {
|
|
611
|
-
let r$1 = linearize$2$1(a98.r);
|
|
611
|
+
let r$1$1 = linearize$2$1(a98.r);
|
|
612
612
|
let g = linearize$2$1(a98.g);
|
|
613
613
|
let b = linearize$2$1(a98.b);
|
|
614
614
|
let res = {
|
|
615
615
|
mode: "xyz65",
|
|
616
|
-
x: .5766690429101305 * r$1 + .1855582379065463 * g + .1882286462349947 * b,
|
|
617
|
-
y: .297344975250536 * r$1 + .6273635662554661 * g + .0752914584939979 * b,
|
|
618
|
-
z: .0270313613864123 * r$1 + .0706888525358272 * g + .9913375368376386 * b
|
|
616
|
+
x: .5766690429101305 * r$1$1 + .1855582379065463 * g + .1882286462349947 * b,
|
|
617
|
+
y: .297344975250536 * r$1$1 + .6273635662554661 * g + .0752914584939979 * b,
|
|
618
|
+
z: .0270313613864123 * r$1$1 + .0706888525358272 * g + .9913375368376386 * b
|
|
619
619
|
};
|
|
620
620
|
if (a98.alpha !== void 0) res.alpha = a98.alpha;
|
|
621
621
|
return res;
|
|
@@ -641,10 +641,10 @@ const fn$3$1 = (c$1$1 = 0) => {
|
|
|
641
641
|
if (abs <= .04045) return c$1$1 / 12.92;
|
|
642
642
|
return (Math.sign(c$1$1) || 1) * Math.pow((abs + .055) / 1.055, 2.4);
|
|
643
643
|
};
|
|
644
|
-
const convertRgbToLrgb$1 = ({ r: r$1, g, b, alpha }) => {
|
|
644
|
+
const convertRgbToLrgb$1 = ({ r: r$1$1, g, b, alpha }) => {
|
|
645
645
|
let res = {
|
|
646
646
|
mode: "lrgb",
|
|
647
|
-
r: fn$3$1(r$1),
|
|
647
|
+
r: fn$3$1(r$1$1),
|
|
648
648
|
g: fn$3$1(g),
|
|
649
649
|
b: fn$3$1(b)
|
|
650
650
|
};
|
|
@@ -653,12 +653,12 @@ const convertRgbToLrgb$1 = ({ r: r$1, g, b, alpha }) => {
|
|
|
653
653
|
};
|
|
654
654
|
var convertRgbToLrgb_default$1 = convertRgbToLrgb$1;
|
|
655
655
|
const convertRgbToXyz65$1 = (rgb$2) => {
|
|
656
|
-
let { r: r$1, g, b, alpha } = convertRgbToLrgb_default$1(rgb$2);
|
|
656
|
+
let { r: r$1$1, g, b, alpha } = convertRgbToLrgb_default$1(rgb$2);
|
|
657
657
|
let res = {
|
|
658
658
|
mode: "xyz65",
|
|
659
|
-
x: .4123907992659593 * r$1 + .357584339383878 * g + .1804807884018343 * b,
|
|
660
|
-
y: .2126390058715102 * r$1 + .715168678767756 * g + .0721923153607337 * b,
|
|
661
|
-
z: .0193308187155918 * r$1 + .119194779794626 * g + .9505321522496607 * b
|
|
659
|
+
x: .4123907992659593 * r$1$1 + .357584339383878 * g + .1804807884018343 * b,
|
|
660
|
+
y: .2126390058715102 * r$1$1 + .715168678767756 * g + .0721923153607337 * b,
|
|
661
|
+
z: .0193308187155918 * r$1$1 + .119194779794626 * g + .9505321522496607 * b
|
|
662
662
|
};
|
|
663
663
|
if (alpha !== void 0) res.alpha = alpha;
|
|
664
664
|
return res;
|
|
@@ -669,10 +669,10 @@ const fn$2$1 = (c$1$1 = 0) => {
|
|
|
669
669
|
if (abs > .0031308) return (Math.sign(c$1$1) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
|
|
670
670
|
return c$1$1 * 12.92;
|
|
671
671
|
};
|
|
672
|
-
const convertLrgbToRgb$1 = ({ r: r$1, g, b, alpha }, mode = "rgb") => {
|
|
672
|
+
const convertLrgbToRgb$1 = ({ r: r$1$1, g, b, alpha }, mode = "rgb") => {
|
|
673
673
|
let res = {
|
|
674
674
|
mode,
|
|
675
|
-
r: fn$2$1(r$1),
|
|
675
|
+
r: fn$2$1(r$1$1),
|
|
676
676
|
g: fn$2$1(g),
|
|
677
677
|
b: fn$2$1(b)
|
|
678
678
|
};
|
|
@@ -694,7 +694,7 @@ const convertXyz65ToRgb$1 = ({ x, y, z, alpha }) => {
|
|
|
694
694
|
};
|
|
695
695
|
var convertXyz65ToRgb_default$1 = convertXyz65ToRgb$1;
|
|
696
696
|
const definition$14$1 = {
|
|
697
|
-
...definition_default$
|
|
697
|
+
...definition_default$12$1,
|
|
698
698
|
mode: "a98",
|
|
699
699
|
parse: ["a98-rgb"],
|
|
700
700
|
serialize: "a98-rgb",
|
|
@@ -770,17 +770,17 @@ function convertHslToRgb$1({ h, s, l, alpha }) {
|
|
|
770
770
|
if (alpha !== void 0) res.alpha = alpha;
|
|
771
771
|
return res;
|
|
772
772
|
}
|
|
773
|
-
function convertRgbToHsl$1({ r: r$1, g, b, alpha }) {
|
|
774
|
-
if (r$1 === void 0) r$1 = 0;
|
|
773
|
+
function convertRgbToHsl$1({ r: r$1$1, g, b, alpha }) {
|
|
774
|
+
if (r$1$1 === void 0) r$1$1 = 0;
|
|
775
775
|
if (g === void 0) g = 0;
|
|
776
776
|
if (b === void 0) b = 0;
|
|
777
|
-
let M = Math.max(r$1, g, b), m = Math.min(r$1, g, b);
|
|
777
|
+
let M = Math.max(r$1$1, g, b), m = Math.min(r$1$1, g, b);
|
|
778
778
|
let res = {
|
|
779
779
|
mode: "hsl",
|
|
780
780
|
s: M === m ? 0 : (M - m) / (1 - Math.abs(M + m - 1)),
|
|
781
781
|
l: .5 * (M + m)
|
|
782
782
|
};
|
|
783
|
-
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;
|
|
783
|
+
if (M - m !== 0) res.h = (M === r$1$1 ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r$1$1) / (M - m) + 2 : (r$1$1 - g) / (M - m) + 4) * 60;
|
|
784
784
|
if (alpha !== void 0) res.alpha = alpha;
|
|
785
785
|
return res;
|
|
786
786
|
}
|
|
@@ -968,17 +968,17 @@ function convertHsvToRgb$1({ h, s, v, alpha }) {
|
|
|
968
968
|
if (alpha !== void 0) res.alpha = alpha;
|
|
969
969
|
return res;
|
|
970
970
|
}
|
|
971
|
-
function convertRgbToHsv$1({ r: r$1, g, b, alpha }) {
|
|
972
|
-
if (r$1 === void 0) r$1 = 0;
|
|
971
|
+
function convertRgbToHsv$1({ r: r$1$1, g, b, alpha }) {
|
|
972
|
+
if (r$1$1 === void 0) r$1$1 = 0;
|
|
973
973
|
if (g === void 0) g = 0;
|
|
974
974
|
if (b === void 0) b = 0;
|
|
975
|
-
let M = Math.max(r$1, g, b), m = Math.min(r$1, g, b);
|
|
975
|
+
let M = Math.max(r$1$1, g, b), m = Math.min(r$1$1, g, b);
|
|
976
976
|
let res = {
|
|
977
977
|
mode: "hsv",
|
|
978
978
|
s: M === 0 ? 0 : 1 - m / M,
|
|
979
979
|
v: M
|
|
980
980
|
};
|
|
981
|
-
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;
|
|
981
|
+
if (M - m !== 0) res.h = (M === r$1$1 ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r$1$1) / (M - m) + 2 : (r$1$1 - g) / (M - m) + 4) * 60;
|
|
982
982
|
if (alpha !== void 0) res.alpha = alpha;
|
|
983
983
|
return res;
|
|
984
984
|
}
|
|
@@ -1011,7 +1011,7 @@ const definition$12$1 = {
|
|
|
1011
1011
|
difference: { h: differenceHueSaturation$1 },
|
|
1012
1012
|
average: { h: averageAngle$1 }
|
|
1013
1013
|
};
|
|
1014
|
-
var definition_default$
|
|
1014
|
+
var definition_default$15$1 = definition$12$1;
|
|
1015
1015
|
function convertHwbToRgb$1({ h, w, b, alpha }) {
|
|
1016
1016
|
if (w === void 0) w = 0;
|
|
1017
1017
|
if (b === void 0) b = 0;
|
|
@@ -1090,7 +1090,7 @@ const definition$11$1 = {
|
|
|
1090
1090
|
difference: { h: differenceHueNaive$1 },
|
|
1091
1091
|
average: { h: averageAngle$1 }
|
|
1092
1092
|
};
|
|
1093
|
-
var definition_default$
|
|
1093
|
+
var definition_default$2$1 = definition$11$1;
|
|
1094
1094
|
const k$1$1 = Math.pow(29, 3) / Math.pow(3, 3);
|
|
1095
1095
|
const e$1$1 = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1096
1096
|
const D50$1 = {
|
|
@@ -1139,12 +1139,12 @@ var convertXyz50ToRgb_default$1 = convertXyz50ToRgb$1;
|
|
|
1139
1139
|
const convertLabToRgb$1 = (lab) => convertXyz50ToRgb_default$1(convertLabToXyz50_default$1(lab));
|
|
1140
1140
|
var convertLabToRgb_default$1 = convertLabToRgb$1;
|
|
1141
1141
|
const convertRgbToXyz50$1 = (rgb$2) => {
|
|
1142
|
-
let { r: r$1, g, b, alpha } = convertRgbToLrgb_default$1(rgb$2);
|
|
1142
|
+
let { r: r$1$1, g, b, alpha } = convertRgbToLrgb_default$1(rgb$2);
|
|
1143
1143
|
let res = {
|
|
1144
1144
|
mode: "xyz50",
|
|
1145
|
-
x: .436065742824811 * r$1 + .3851514688337912 * g + .14307845442264197 * b,
|
|
1146
|
-
y: .22249319175623702 * r$1 + .7168870538238823 * g + .06061979053616537 * b,
|
|
1147
|
-
z: .013923904500943465 * r$1 + .09708128566574634 * g + .7140993584005155 * b
|
|
1145
|
+
x: .436065742824811 * r$1$1 + .3851514688337912 * g + .14307845442264197 * b,
|
|
1146
|
+
y: .22249319175623702 * r$1$1 + .7168870538238823 * g + .06061979053616537 * b,
|
|
1147
|
+
z: .013923904500943465 * r$1$1 + .09708128566574634 * g + .7140993584005155 * b
|
|
1148
1148
|
};
|
|
1149
1149
|
if (alpha !== void 0) res.alpha = alpha;
|
|
1150
1150
|
return res;
|
|
@@ -1204,8 +1204,8 @@ const definition$10$1 = {
|
|
|
1204
1204
|
],
|
|
1205
1205
|
ranges: {
|
|
1206
1206
|
l: [0, 100],
|
|
1207
|
-
a: [-
|
|
1208
|
-
b: [-
|
|
1207
|
+
a: [-125, 125],
|
|
1208
|
+
b: [-125, 125]
|
|
1209
1209
|
},
|
|
1210
1210
|
parse: [parseLab_default$1],
|
|
1211
1211
|
serialize: (c$1$1) => `lab(${c$1$1.l !== void 0 ? c$1$1.l : "none"} ${c$1$1.a !== void 0 ? c$1$1.a : "none"} ${c$1$1.b !== void 0 ? c$1$1.b : "none"}${c$1$1.alpha < 1 ? ` / ${c$1$1.alpha}` : ""})`,
|
|
@@ -1219,7 +1219,7 @@ const definition$10$1 = {
|
|
|
1219
1219
|
}
|
|
1220
1220
|
}
|
|
1221
1221
|
};
|
|
1222
|
-
var definition_default$
|
|
1222
|
+
var definition_default$3$1 = definition$10$1;
|
|
1223
1223
|
const k$3 = Math.pow(29, 3) / Math.pow(3, 3);
|
|
1224
1224
|
const e$3 = Math.pow(6, 3) / Math.pow(29, 3);
|
|
1225
1225
|
let fn$4 = (v) => Math.pow(v, 3) > e$3 ? Math.pow(v, 3) : (116 * v - 16) / k$3;
|
|
@@ -1267,7 +1267,7 @@ const convertRgbToLab65$1 = (rgb$2) => {
|
|
|
1267
1267
|
};
|
|
1268
1268
|
var convertRgbToLab65_default$1 = convertRgbToLab65$1;
|
|
1269
1269
|
const definition$9$1 = {
|
|
1270
|
-
...definition_default$
|
|
1270
|
+
...definition_default$3$1,
|
|
1271
1271
|
mode: "lab65",
|
|
1272
1272
|
parse: ["--lab-d65"],
|
|
1273
1273
|
serialize: "--lab-d65",
|
|
@@ -1281,11 +1281,11 @@ const definition$9$1 = {
|
|
|
1281
1281
|
},
|
|
1282
1282
|
ranges: {
|
|
1283
1283
|
l: [0, 100],
|
|
1284
|
-
a: [-
|
|
1285
|
-
b: [-
|
|
1284
|
+
a: [-125, 125],
|
|
1285
|
+
b: [-125, 125]
|
|
1286
1286
|
}
|
|
1287
1287
|
};
|
|
1288
|
-
var definition_default$
|
|
1288
|
+
var definition_default$4$1 = definition$9$1;
|
|
1289
1289
|
const convertLabToLch$1 = ({ l, a, b, alpha }, mode = "lch") => {
|
|
1290
1290
|
if (a === void 0) a = 0;
|
|
1291
1291
|
if (b === void 0) b = 0;
|
|
@@ -1367,45 +1367,45 @@ const definition$8$1 = {
|
|
|
1367
1367
|
difference: { h: differenceHueChroma$1 },
|
|
1368
1368
|
average: { h: averageAngle$1 }
|
|
1369
1369
|
};
|
|
1370
|
-
var definition_default$
|
|
1370
|
+
var definition_default$5$1 = definition$8$1;
|
|
1371
1371
|
const definition$7$1 = {
|
|
1372
|
-
...definition_default$
|
|
1372
|
+
...definition_default$12$1,
|
|
1373
1373
|
mode: "lrgb",
|
|
1374
1374
|
toMode: { rgb: convertLrgbToRgb_default$1 },
|
|
1375
1375
|
fromMode: { rgb: convertRgbToLrgb_default$1 },
|
|
1376
1376
|
parse: ["srgb-linear"],
|
|
1377
1377
|
serialize: "srgb-linear"
|
|
1378
1378
|
};
|
|
1379
|
-
var definition_default$
|
|
1379
|
+
var definition_default$6$1 = definition$7$1;
|
|
1380
1380
|
const convertOklabToLrgb$1 = ({ l, a, b, alpha }) => {
|
|
1381
1381
|
if (l === void 0) l = 0;
|
|
1382
1382
|
if (a === void 0) a = 0;
|
|
1383
1383
|
if (b === void 0) b = 0;
|
|
1384
|
-
let L = Math.pow(l
|
|
1385
|
-
let M = Math.pow(l
|
|
1386
|
-
let S = Math.pow(l
|
|
1384
|
+
let L = Math.pow(l + .3963377773761749 * a + .2158037573099136 * b, 3);
|
|
1385
|
+
let M = Math.pow(l - .1055613458156586 * a - .0638541728258133 * b, 3);
|
|
1386
|
+
let S = Math.pow(l - .0894841775298119 * a - 1.2914855480194092 * b, 3);
|
|
1387
1387
|
let res = {
|
|
1388
1388
|
mode: "lrgb",
|
|
1389
|
-
r: 4.
|
|
1390
|
-
g: -1.
|
|
1391
|
-
b: -.
|
|
1389
|
+
r: 4.076741636075957 * L - 3.3077115392580616 * M + .2309699031821044 * S,
|
|
1390
|
+
g: -1.2684379732850317 * L + 2.6097573492876887 * M - .3413193760026573 * S,
|
|
1391
|
+
b: -.0041960761386756 * L - .7034186179359362 * M + 1.7076146940746117 * S
|
|
1392
1392
|
};
|
|
1393
1393
|
if (alpha !== void 0) res.alpha = alpha;
|
|
1394
1394
|
return res;
|
|
1395
1395
|
};
|
|
1396
1396
|
var convertOklabToLrgb_default$1 = convertOklabToLrgb$1;
|
|
1397
|
-
const convertLrgbToOklab$1 = ({ r: r$1, g, b, alpha }) => {
|
|
1398
|
-
if (r$1 === void 0) r$1 = 0;
|
|
1397
|
+
const convertLrgbToOklab$1 = ({ r: r$1$1, g, b, alpha }) => {
|
|
1398
|
+
if (r$1$1 === void 0) r$1$1 = 0;
|
|
1399
1399
|
if (g === void 0) g = 0;
|
|
1400
1400
|
if (b === void 0) b = 0;
|
|
1401
|
-
let L = Math.cbrt(.
|
|
1402
|
-
let M = Math.cbrt(.
|
|
1403
|
-
let S = Math.cbrt(.
|
|
1401
|
+
let L = Math.cbrt(.412221469470763 * r$1$1 + .5363325372617348 * g + .0514459932675022 * b);
|
|
1402
|
+
let M = Math.cbrt(.2119034958178252 * r$1$1 + .6806995506452344 * g + .1073969535369406 * b);
|
|
1403
|
+
let S = Math.cbrt(.0883024591900564 * r$1$1 + .2817188391361215 * g + .6299787016738222 * b);
|
|
1404
1404
|
let res = {
|
|
1405
1405
|
mode: "oklab",
|
|
1406
|
-
l: .
|
|
1407
|
-
a: 1.
|
|
1408
|
-
b: .
|
|
1406
|
+
l: .210454268309314 * L + .7936177747023054 * M - .0040720430116193 * S,
|
|
1407
|
+
a: 1.9779985324311684 * L - 2.42859224204858 * M + .450593709617411 * S,
|
|
1408
|
+
b: .0259040424655478 * L + .7827717124575296 * M - .8086757549230774 * S
|
|
1409
1409
|
};
|
|
1410
1410
|
if (alpha !== void 0) res.alpha = alpha;
|
|
1411
1411
|
return res;
|
|
@@ -1432,7 +1432,7 @@ function parseOklab$1(color, parsed) {
|
|
|
1432
1432
|
}
|
|
1433
1433
|
var parseOklab_default$1 = parseOklab$1;
|
|
1434
1434
|
const definition$6$1 = {
|
|
1435
|
-
...definition_default$
|
|
1435
|
+
...definition_default$3$1,
|
|
1436
1436
|
mode: "oklab",
|
|
1437
1437
|
toMode: {
|
|
1438
1438
|
lrgb: convertOklabToLrgb_default$1,
|
|
@@ -1450,7 +1450,7 @@ const definition$6$1 = {
|
|
|
1450
1450
|
parse: [parseOklab_default$1],
|
|
1451
1451
|
serialize: (c$1$1) => `oklab(${c$1$1.l !== void 0 ? c$1$1.l : "none"} ${c$1$1.a !== void 0 ? c$1$1.a : "none"} ${c$1$1.b !== void 0 ? c$1$1.b : "none"}${c$1$1.alpha < 1 ? ` / ${c$1$1.alpha}` : ""})`
|
|
1452
1452
|
};
|
|
1453
|
-
var definition_default$
|
|
1453
|
+
var definition_default$7$1 = definition$6$1;
|
|
1454
1454
|
function parseOklch$1(color, parsed) {
|
|
1455
1455
|
if (!parsed || parsed[0] !== "oklch") return void 0;
|
|
1456
1456
|
const res = { mode: "oklch" };
|
|
@@ -1469,7 +1469,7 @@ function parseOklch$1(color, parsed) {
|
|
|
1469
1469
|
}
|
|
1470
1470
|
var parseOklch_default$1 = parseOklch$1;
|
|
1471
1471
|
const definition$5$1 = {
|
|
1472
|
-
...definition_default$
|
|
1472
|
+
...definition_default$5$1,
|
|
1473
1473
|
mode: "oklch",
|
|
1474
1474
|
toMode: {
|
|
1475
1475
|
oklab: (c$1$1) => convertLchToLab_default$1(c$1$1, "oklab"),
|
|
@@ -1487,14 +1487,14 @@ const definition$5$1 = {
|
|
|
1487
1487
|
h: [0, 360]
|
|
1488
1488
|
}
|
|
1489
1489
|
};
|
|
1490
|
-
var definition_default$
|
|
1490
|
+
var definition_default$8$1 = definition$5$1;
|
|
1491
1491
|
const convertP3ToXyz65$1 = (rgb$2) => {
|
|
1492
|
-
let { r: r$1, g, b, alpha } = convertRgbToLrgb_default$1(rgb$2);
|
|
1492
|
+
let { r: r$1$1, g, b, alpha } = convertRgbToLrgb_default$1(rgb$2);
|
|
1493
1493
|
let res = {
|
|
1494
1494
|
mode: "xyz65",
|
|
1495
|
-
x: .486570948648216 * r$1 + .265667693169093 * g + .1982172852343625 * b,
|
|
1496
|
-
y: .2289745640697487 * r$1 + .6917385218365062 * g + .079286914093745 * b,
|
|
1497
|
-
z: 0 * r$1 + .0451133818589026 * g + 1.043944368900976 * b
|
|
1495
|
+
x: .486570948648216 * r$1$1 + .265667693169093 * g + .1982172852343625 * b,
|
|
1496
|
+
y: .2289745640697487 * r$1$1 + .6917385218365062 * g + .079286914093745 * b,
|
|
1497
|
+
z: 0 * r$1$1 + .0451133818589026 * g + 1.043944368900976 * b
|
|
1498
1498
|
};
|
|
1499
1499
|
if (alpha !== void 0) res.alpha = alpha;
|
|
1500
1500
|
return res;
|
|
@@ -1514,7 +1514,7 @@ const convertXyz65ToP3$1 = ({ x, y, z, alpha }) => {
|
|
|
1514
1514
|
};
|
|
1515
1515
|
var convertXyz65ToP3_default$1 = convertXyz65ToP3$1;
|
|
1516
1516
|
const definition$4$1 = {
|
|
1517
|
-
...definition_default$
|
|
1517
|
+
...definition_default$12$1,
|
|
1518
1518
|
mode: "p3",
|
|
1519
1519
|
parse: ["display-p3"],
|
|
1520
1520
|
serialize: "display-p3",
|
|
@@ -1527,7 +1527,7 @@ const definition$4$1 = {
|
|
|
1527
1527
|
xyz65: convertP3ToXyz65_default$1
|
|
1528
1528
|
}
|
|
1529
1529
|
};
|
|
1530
|
-
var definition_default$
|
|
1530
|
+
var definition_default$9$1 = definition$4$1;
|
|
1531
1531
|
const gamma$1$1 = (v) => {
|
|
1532
1532
|
let abs = Math.abs(v);
|
|
1533
1533
|
if (abs >= 1 / 512) return Math.sign(v) * Math.pow(abs, 1 / 1.8);
|
|
@@ -1553,21 +1553,21 @@ const linearize$1$1 = (v = 0) => {
|
|
|
1553
1553
|
return v / 16;
|
|
1554
1554
|
};
|
|
1555
1555
|
const convertProphotoToXyz50$1 = (prophoto) => {
|
|
1556
|
-
let r$1 = linearize$1$1(prophoto.r);
|
|
1556
|
+
let r$1$1 = linearize$1$1(prophoto.r);
|
|
1557
1557
|
let g = linearize$1$1(prophoto.g);
|
|
1558
1558
|
let b = linearize$1$1(prophoto.b);
|
|
1559
1559
|
let res = {
|
|
1560
1560
|
mode: "xyz50",
|
|
1561
|
-
x: .7977666449006423 * r$1 + .1351812974005331 * g + .0313477341283922 * b,
|
|
1562
|
-
y: .2880748288194013 * r$1 + .7118352342418731 * g + 899369387256e-16 * b,
|
|
1563
|
-
z: 0 * r$1 + 0 * g + .8251046025104602 * b
|
|
1561
|
+
x: .7977666449006423 * r$1$1 + .1351812974005331 * g + .0313477341283922 * b,
|
|
1562
|
+
y: .2880748288194013 * r$1$1 + .7118352342418731 * g + 899369387256e-16 * b,
|
|
1563
|
+
z: 0 * r$1$1 + 0 * g + .8251046025104602 * b
|
|
1564
1564
|
};
|
|
1565
1565
|
if (prophoto.alpha !== void 0) res.alpha = prophoto.alpha;
|
|
1566
1566
|
return res;
|
|
1567
1567
|
};
|
|
1568
1568
|
var convertProphotoToXyz50_default$1 = convertProphotoToXyz50$1;
|
|
1569
1569
|
const definition$3$1 = {
|
|
1570
|
-
...definition_default$
|
|
1570
|
+
...definition_default$12$1,
|
|
1571
1571
|
mode: "prophoto",
|
|
1572
1572
|
parse: ["prophoto-rgb"],
|
|
1573
1573
|
serialize: "prophoto-rgb",
|
|
@@ -1580,7 +1580,7 @@ const definition$3$1 = {
|
|
|
1580
1580
|
rgb: (color) => convertXyz50ToRgb_default$1(convertProphotoToXyz50_default$1(color))
|
|
1581
1581
|
}
|
|
1582
1582
|
};
|
|
1583
|
-
var definition_default$
|
|
1583
|
+
var definition_default$10$1 = definition$3$1;
|
|
1584
1584
|
const α$1$1 = 1.09929682680944;
|
|
1585
1585
|
const β$1$1 = .018053968510807;
|
|
1586
1586
|
const gamma$3 = (v) => {
|
|
@@ -1610,21 +1610,21 @@ const linearize$3 = (v = 0) => {
|
|
|
1610
1610
|
return (Math.sign(v) || 1) * Math.pow((abs + α$2 - 1) / α$2, 1 / .45);
|
|
1611
1611
|
};
|
|
1612
1612
|
const convertRec2020ToXyz65$1 = (rec2020) => {
|
|
1613
|
-
let r$1 = linearize$3(rec2020.r);
|
|
1613
|
+
let r$1$1 = linearize$3(rec2020.r);
|
|
1614
1614
|
let g = linearize$3(rec2020.g);
|
|
1615
1615
|
let b = linearize$3(rec2020.b);
|
|
1616
1616
|
let res = {
|
|
1617
1617
|
mode: "xyz65",
|
|
1618
|
-
x: .6369580483012911 * r$1 + .1446169035862083 * g + .1688809751641721 * b,
|
|
1619
|
-
y: .262700212011267 * r$1 + .6779980715188708 * g + .059301716469862 * b,
|
|
1620
|
-
z: 0 * r$1 + .0280726930490874 * g + 1.0609850577107909 * b
|
|
1618
|
+
x: .6369580483012911 * r$1$1 + .1446169035862083 * g + .1688809751641721 * b,
|
|
1619
|
+
y: .262700212011267 * r$1$1 + .6779980715188708 * g + .059301716469862 * b,
|
|
1620
|
+
z: 0 * r$1$1 + .0280726930490874 * g + 1.0609850577107909 * b
|
|
1621
1621
|
};
|
|
1622
1622
|
if (rec2020.alpha !== void 0) res.alpha = rec2020.alpha;
|
|
1623
1623
|
return res;
|
|
1624
1624
|
};
|
|
1625
1625
|
var convertRec2020ToXyz65_default$1 = convertRec2020ToXyz65$1;
|
|
1626
1626
|
const definition$2$1 = {
|
|
1627
|
-
...definition_default$
|
|
1627
|
+
...definition_default$12$1,
|
|
1628
1628
|
mode: "rec2020",
|
|
1629
1629
|
fromMode: {
|
|
1630
1630
|
xyz65: convertXyz65ToRec2020_default$1,
|
|
@@ -1637,7 +1637,7 @@ const definition$2$1 = {
|
|
|
1637
1637
|
parse: ["rec2020"],
|
|
1638
1638
|
serialize: "rec2020"
|
|
1639
1639
|
};
|
|
1640
|
-
var definition_default$
|
|
1640
|
+
var definition_default$11$1 = definition$2$1;
|
|
1641
1641
|
const definition$1$1 = {
|
|
1642
1642
|
mode: "xyz50",
|
|
1643
1643
|
parse: ["xyz-d50"],
|
|
@@ -1671,7 +1671,7 @@ const definition$1$1 = {
|
|
|
1671
1671
|
}
|
|
1672
1672
|
}
|
|
1673
1673
|
};
|
|
1674
|
-
var definition_default$
|
|
1674
|
+
var definition_default$13$1 = definition$1$1;
|
|
1675
1675
|
const convertXyz65ToXyz50$1 = (xyz65) => {
|
|
1676
1676
|
let { x, y, z, alpha } = xyz65;
|
|
1677
1677
|
if (x === void 0) x = 0;
|
|
@@ -1735,36 +1735,207 @@ const definition$16 = {
|
|
|
1735
1735
|
}
|
|
1736
1736
|
}
|
|
1737
1737
|
};
|
|
1738
|
-
var definition_default$
|
|
1739
|
-
|
|
1740
|
-
const
|
|
1741
|
-
|
|
1742
|
-
|
|
1738
|
+
var definition_default$14$1 = definition$16;
|
|
1739
|
+
function toe$1(x) {
|
|
1740
|
+
const k_1 = .206;
|
|
1741
|
+
const k_2 = .03;
|
|
1742
|
+
const k_3 = (1 + k_1) / (1 + k_2);
|
|
1743
|
+
return .5 * (k_3 * x - k_1 + Math.sqrt((k_3 * x - k_1) * (k_3 * x - k_1) + 4 * k_2 * k_3 * x));
|
|
1744
|
+
}
|
|
1745
|
+
function toe_inv$1(x) {
|
|
1746
|
+
const k_1 = .206;
|
|
1747
|
+
const k_2 = .03;
|
|
1748
|
+
const k_3 = (1 + k_1) / (1 + k_2);
|
|
1749
|
+
return (x * x + k_1 * x) / (k_3 * (x + k_2));
|
|
1750
|
+
}
|
|
1751
|
+
function compute_max_saturation$1(a, b) {
|
|
1752
|
+
let k0, k1, k2, k3, k4, wl, wm, ws;
|
|
1753
|
+
if (-1.88170328 * a - .80936493 * b > 1) {
|
|
1754
|
+
k0 = 1.19086277;
|
|
1755
|
+
k1 = 1.76576728;
|
|
1756
|
+
k2 = .59662641;
|
|
1757
|
+
k3 = .75515197;
|
|
1758
|
+
k4 = .56771245;
|
|
1759
|
+
wl = 4.0767416621;
|
|
1760
|
+
wm = -3.3077115913;
|
|
1761
|
+
ws = .2309699292;
|
|
1762
|
+
} else if (1.81444104 * a - 1.19445276 * b > 1) {
|
|
1763
|
+
k0 = .73956515;
|
|
1764
|
+
k1 = -.45954404;
|
|
1765
|
+
k2 = .08285427;
|
|
1766
|
+
k3 = .1254107;
|
|
1767
|
+
k4 = .14503204;
|
|
1768
|
+
wl = -1.2684380046;
|
|
1769
|
+
wm = 2.6097574011;
|
|
1770
|
+
ws = -.3413193965;
|
|
1771
|
+
} else {
|
|
1772
|
+
k0 = 1.35733652;
|
|
1773
|
+
k1 = -.00915799;
|
|
1774
|
+
k2 = -1.1513021;
|
|
1775
|
+
k3 = -.50559606;
|
|
1776
|
+
k4 = .00692167;
|
|
1777
|
+
wl = -.0041960863;
|
|
1778
|
+
wm = -.7034186147;
|
|
1779
|
+
ws = 1.707614701;
|
|
1780
|
+
}
|
|
1781
|
+
let S = k0 + k1 * a + k2 * b + k3 * a * a + k4 * a * b;
|
|
1782
|
+
let k_l = .3963377774 * a + .2158037573 * b;
|
|
1783
|
+
let k_m = -.1055613458 * a - .0638541728 * b;
|
|
1784
|
+
let k_s = -.0894841775 * a - 1.291485548 * b;
|
|
1785
|
+
{
|
|
1786
|
+
let l_ = 1 + S * k_l;
|
|
1787
|
+
let m_ = 1 + S * k_m;
|
|
1788
|
+
let s_ = 1 + S * k_s;
|
|
1789
|
+
let l = l_ * l_ * l_;
|
|
1790
|
+
let m = m_ * m_ * m_;
|
|
1791
|
+
let s = s_ * s_ * s_;
|
|
1792
|
+
let l_dS = 3 * k_l * l_ * l_;
|
|
1793
|
+
let m_dS = 3 * k_m * m_ * m_;
|
|
1794
|
+
let s_dS = 3 * k_s * s_ * s_;
|
|
1795
|
+
let l_dS2 = 6 * k_l * k_l * l_;
|
|
1796
|
+
let m_dS2 = 6 * k_m * k_m * m_;
|
|
1797
|
+
let s_dS2 = 6 * k_s * k_s * s_;
|
|
1798
|
+
let f$2$1 = wl * l + wm * m + ws * s;
|
|
1799
|
+
let f1 = wl * l_dS + wm * m_dS + ws * s_dS;
|
|
1800
|
+
let f2 = wl * l_dS2 + wm * m_dS2 + ws * s_dS2;
|
|
1801
|
+
S = S - f$2$1 * f1 / (f1 * f1 - .5 * f$2$1 * f2);
|
|
1802
|
+
}
|
|
1803
|
+
return S;
|
|
1804
|
+
}
|
|
1805
|
+
function find_cusp$1(a, b) {
|
|
1806
|
+
let S_cusp = compute_max_saturation$1(a, b);
|
|
1807
|
+
let rgb$2 = convertOklabToLrgb_default$1({
|
|
1808
|
+
l: 1,
|
|
1809
|
+
a: S_cusp * a,
|
|
1810
|
+
b: S_cusp * b
|
|
1811
|
+
});
|
|
1812
|
+
let L_cusp = Math.cbrt(1 / Math.max(rgb$2.r, rgb$2.g, rgb$2.b));
|
|
1813
|
+
let C_cusp = L_cusp * S_cusp;
|
|
1814
|
+
return [L_cusp, C_cusp];
|
|
1815
|
+
}
|
|
1816
|
+
function get_ST_max$1(a_, b_, cusp = null) {
|
|
1817
|
+
if (!cusp) cusp = find_cusp$1(a_, b_);
|
|
1818
|
+
let L = cusp[0];
|
|
1819
|
+
let C = cusp[1];
|
|
1820
|
+
return [C / L, C / (1 - L)];
|
|
1821
|
+
}
|
|
1822
|
+
function convertOklabToOkhsv$1(lab) {
|
|
1823
|
+
let l = lab.l !== void 0 ? lab.l : 0;
|
|
1824
|
+
let a = lab.a !== void 0 ? lab.a : 0;
|
|
1825
|
+
let b = lab.b !== void 0 ? lab.b : 0;
|
|
1826
|
+
let c$1$1 = Math.sqrt(a * a + b * b);
|
|
1827
|
+
let a_ = c$1$1 ? a / c$1$1 : 1;
|
|
1828
|
+
let b_ = c$1$1 ? b / c$1$1 : 1;
|
|
1829
|
+
let [S_max, T] = get_ST_max$1(a_, b_);
|
|
1830
|
+
let S_0 = .5;
|
|
1831
|
+
let k$3$1 = 1 - S_0 / S_max;
|
|
1832
|
+
let t = T / (c$1$1 + l * T);
|
|
1833
|
+
let L_v = t * l;
|
|
1834
|
+
let C_v = t * c$1$1;
|
|
1835
|
+
let L_vt = toe_inv$1(L_v);
|
|
1836
|
+
let C_vt = C_v * L_vt / L_v;
|
|
1837
|
+
let rgb_scale = convertOklabToLrgb_default$1({
|
|
1838
|
+
l: L_vt,
|
|
1839
|
+
a: a_ * C_vt,
|
|
1840
|
+
b: b_ * C_vt
|
|
1841
|
+
});
|
|
1842
|
+
let scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
|
|
1843
|
+
l = l / scale_L;
|
|
1844
|
+
c$1$1 = c$1$1 / scale_L * toe$1(l) / l;
|
|
1845
|
+
l = toe$1(l);
|
|
1846
|
+
const ret = {
|
|
1847
|
+
mode: "okhsv",
|
|
1848
|
+
s: c$1$1 ? (S_0 + T) * C_v / (T * S_0 + T * k$3$1 * C_v) : 0,
|
|
1849
|
+
v: l ? l / L_v : 0
|
|
1850
|
+
};
|
|
1851
|
+
if (ret.s) ret.h = normalizeHue_default$1(Math.atan2(b, a) * 180 / Math.PI);
|
|
1852
|
+
if (lab.alpha !== void 0) ret.alpha = lab.alpha;
|
|
1853
|
+
return ret;
|
|
1854
|
+
}
|
|
1855
|
+
function convertOkhsvToOklab$1(hsv) {
|
|
1856
|
+
const ret = { mode: "oklab" };
|
|
1857
|
+
if (hsv.alpha !== void 0) ret.alpha = hsv.alpha;
|
|
1858
|
+
const h = hsv.h !== void 0 ? hsv.h : 0;
|
|
1859
|
+
const s = hsv.s !== void 0 ? hsv.s : 0;
|
|
1860
|
+
const v = hsv.v !== void 0 ? hsv.v : 0;
|
|
1861
|
+
const a_ = Math.cos(h / 180 * Math.PI);
|
|
1862
|
+
const b_ = Math.sin(h / 180 * Math.PI);
|
|
1863
|
+
const [S_max, T] = get_ST_max$1(a_, b_);
|
|
1864
|
+
const S_0 = .5;
|
|
1865
|
+
const k$3$1 = 1 - S_0 / S_max;
|
|
1866
|
+
const L_v = 1 - s * S_0 / (S_0 + T - T * k$3$1 * s);
|
|
1867
|
+
const C_v = s * T * S_0 / (S_0 + T - T * k$3$1 * s);
|
|
1868
|
+
const L_vt = toe_inv$1(L_v);
|
|
1869
|
+
const C_vt = C_v * L_vt / L_v;
|
|
1870
|
+
const rgb_scale = convertOklabToLrgb_default$1({
|
|
1871
|
+
l: L_vt,
|
|
1872
|
+
a: a_ * C_vt,
|
|
1873
|
+
b: b_ * C_vt
|
|
1874
|
+
});
|
|
1875
|
+
const scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
|
|
1876
|
+
const L_new = toe_inv$1(v * L_v);
|
|
1877
|
+
const C = C_v * L_new / L_v;
|
|
1878
|
+
ret.l = L_new * scale_L;
|
|
1879
|
+
ret.a = C * a_ * scale_L;
|
|
1880
|
+
ret.b = C * b_ * scale_L;
|
|
1881
|
+
return ret;
|
|
1882
|
+
}
|
|
1883
|
+
const modeOkhsv$1 = {
|
|
1884
|
+
...definition_default$15$1,
|
|
1885
|
+
mode: "okhsv",
|
|
1886
|
+
channels: [
|
|
1887
|
+
"h",
|
|
1888
|
+
"s",
|
|
1889
|
+
"v",
|
|
1890
|
+
"alpha"
|
|
1891
|
+
],
|
|
1892
|
+
parse: ["--okhsv"],
|
|
1893
|
+
serialize: "--okhsv",
|
|
1894
|
+
fromMode: {
|
|
1895
|
+
oklab: convertOklabToOkhsv$1,
|
|
1896
|
+
rgb: (c$1$1) => convertOklabToOkhsv$1(convertRgbToOklab_default$1(c$1$1))
|
|
1897
|
+
},
|
|
1898
|
+
toMode: {
|
|
1899
|
+
oklab: convertOkhsvToOklab$1,
|
|
1900
|
+
rgb: (c$1$1) => convertOklabToRgb_default$1(convertOkhsvToOklab$1(c$1$1))
|
|
1901
|
+
}
|
|
1902
|
+
};
|
|
1903
|
+
var modeOkhsv_default$1 = modeOkhsv$1;
|
|
1904
|
+
const r$1 = (value, precision) => Math.round(value * (precision = Math.pow(10, precision))) / precision;
|
|
1905
|
+
const round$1 = (precision = 4) => (value) => typeof value === "number" ? r$1(value, precision) : value;
|
|
1906
|
+
var round_default$1 = round$1;
|
|
1907
|
+
let twoDecimals = round_default$1(2);
|
|
1743
1908
|
const rgb$1 = converter_default$1("rgb");
|
|
1744
1909
|
const hsl = converter_default$1("hsl");
|
|
1745
1910
|
const rgb = converter_default$1("rgb");
|
|
1746
1911
|
const converters$2 = {
|
|
1747
1912
|
a98: useMode$1(definition_default$16),
|
|
1748
1913
|
hsl: useMode$1(definition_default$1$1),
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
p3: useMode$1(definition_default$
|
|
1758
|
-
prophoto: useMode$1(definition_default$
|
|
1759
|
-
rec2020: useMode$1(definition_default$
|
|
1760
|
-
rgb: useMode$1(definition_default$
|
|
1761
|
-
xyz50: useMode$1(definition_default$
|
|
1762
|
-
xyz65: useMode$1(definition_default$
|
|
1914
|
+
hwb: useMode$1(definition_default$2$1),
|
|
1915
|
+
lab: useMode$1(definition_default$3$1),
|
|
1916
|
+
lab65: useMode$1(definition_default$4$1),
|
|
1917
|
+
lch: useMode$1(definition_default$5$1),
|
|
1918
|
+
lrgb: useMode$1(definition_default$6$1),
|
|
1919
|
+
oklab: useMode$1(definition_default$7$1),
|
|
1920
|
+
oklch: useMode$1(definition_default$8$1),
|
|
1921
|
+
okhsv: useMode$1(modeOkhsv_default$1),
|
|
1922
|
+
p3: useMode$1(definition_default$9$1),
|
|
1923
|
+
prophoto: useMode$1(definition_default$10$1),
|
|
1924
|
+
rec2020: useMode$1(definition_default$11$1),
|
|
1925
|
+
rgb: useMode$1(definition_default$12$1),
|
|
1926
|
+
xyz50: useMode$1(definition_default$13$1),
|
|
1927
|
+
xyz65: useMode$1(definition_default$14$1)
|
|
1928
|
+
};
|
|
1929
|
+
const DEPTH_ROUNDING$1 = {
|
|
1930
|
+
24: round_default$1(4),
|
|
1931
|
+
30: round_default$1(4),
|
|
1932
|
+
36: round_default$1(5),
|
|
1933
|
+
48: round_default$1(6)
|
|
1763
1934
|
};
|
|
1764
1935
|
const FORMAT_ID = "css";
|
|
1765
1936
|
|
|
1766
1937
|
//#endregion
|
|
1767
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1938
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseNumber.js
|
|
1768
1939
|
const parseNumber = (color, len) => {
|
|
1769
1940
|
if (typeof color !== "number") return;
|
|
1770
1941
|
if (len === 3) return {
|
|
@@ -1797,7 +1968,7 @@ const parseNumber = (color, len) => {
|
|
|
1797
1968
|
var parseNumber_default = parseNumber;
|
|
1798
1969
|
|
|
1799
1970
|
//#endregion
|
|
1800
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
1971
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/colors/named.js
|
|
1801
1972
|
const named = {
|
|
1802
1973
|
aliceblue: 15792383,
|
|
1803
1974
|
antiquewhite: 16444375,
|
|
@@ -1951,14 +2122,14 @@ const named = {
|
|
|
1951
2122
|
var named_default = named;
|
|
1952
2123
|
|
|
1953
2124
|
//#endregion
|
|
1954
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2125
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseNamed.js
|
|
1955
2126
|
const parseNamed = (color) => {
|
|
1956
2127
|
return parseNumber_default(named_default[color.toLowerCase()], 6);
|
|
1957
2128
|
};
|
|
1958
2129
|
var parseNamed_default = parseNamed;
|
|
1959
2130
|
|
|
1960
2131
|
//#endregion
|
|
1961
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2132
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseHex.js
|
|
1962
2133
|
const hex = /^#?([0-9a-f]{8}|[0-9a-f]{6}|[0-9a-f]{4}|[0-9a-f]{3})$/i;
|
|
1963
2134
|
const parseHex = (color) => {
|
|
1964
2135
|
let match;
|
|
@@ -1967,7 +2138,7 @@ const parseHex = (color) => {
|
|
|
1967
2138
|
var parseHex_default = parseHex;
|
|
1968
2139
|
|
|
1969
2140
|
//#endregion
|
|
1970
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2141
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/regex.js
|
|
1971
2142
|
const num$1 = "([+-]?\\d*\\.?\\d+(?:[eE][+-]?\\d+)?)";
|
|
1972
2143
|
const num_none = `(?:${num$1}|none)`;
|
|
1973
2144
|
const per = `${num$1}%`;
|
|
@@ -1980,7 +2151,7 @@ const c = `\\s*,\\s*`;
|
|
|
1980
2151
|
const rx_num_per_none = new RegExp("^" + num_per_none + "$");
|
|
1981
2152
|
|
|
1982
2153
|
//#endregion
|
|
1983
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2154
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseRgbLegacy.js
|
|
1984
2155
|
const rgb_num_old = new RegExp(`^rgba?\\(\\s*${num$1}${c}${num$1}${c}${num$1}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
|
|
1985
2156
|
const rgb_per_old = new RegExp(`^rgba?\\(\\s*${per}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
|
|
1986
2157
|
const parseRgbLegacy = (color) => {
|
|
@@ -2002,7 +2173,7 @@ const parseRgbLegacy = (color) => {
|
|
|
2002
2173
|
var parseRgbLegacy_default = parseRgbLegacy;
|
|
2003
2174
|
|
|
2004
2175
|
//#endregion
|
|
2005
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2176
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/_prepare.js
|
|
2006
2177
|
const prepare = (color, mode) => color === void 0 ? void 0 : typeof color !== "object" ? parse_default(color) : color.mode !== void 0 ? color : mode ? {
|
|
2007
2178
|
...color,
|
|
2008
2179
|
mode
|
|
@@ -2010,12 +2181,12 @@ const prepare = (color, mode) => color === void 0 ? void 0 : typeof color !== "o
|
|
|
2010
2181
|
var _prepare_default = prepare;
|
|
2011
2182
|
|
|
2012
2183
|
//#endregion
|
|
2013
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2184
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/converter.js
|
|
2014
2185
|
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;
|
|
2015
2186
|
var converter_default = converter;
|
|
2016
2187
|
|
|
2017
2188
|
//#endregion
|
|
2018
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2189
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/modes.js
|
|
2019
2190
|
const converters$1 = {};
|
|
2020
2191
|
const modes = {};
|
|
2021
2192
|
const parsers = [];
|
|
@@ -2055,7 +2226,7 @@ const useParser = (parser, mode) => {
|
|
|
2055
2226
|
};
|
|
2056
2227
|
|
|
2057
2228
|
//#endregion
|
|
2058
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2229
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/parse.js
|
|
2059
2230
|
const IdentStartCodePoint = /[^\x00-\x7F]|[a-zA-Z_]/;
|
|
2060
2231
|
const IdentCodePoint = /[^\x00-\x7F]|[-\w]/;
|
|
2061
2232
|
const Tok = {
|
|
@@ -2309,13 +2480,13 @@ const parse = (color) => {
|
|
|
2309
2480
|
var parse_default = parse;
|
|
2310
2481
|
|
|
2311
2482
|
//#endregion
|
|
2312
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2483
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseRgb.js
|
|
2313
2484
|
function parseRgb(color, parsed) {
|
|
2314
2485
|
if (!parsed || parsed[0] !== "rgb" && parsed[0] !== "rgba") return void 0;
|
|
2315
2486
|
const res = { mode: "rgb" };
|
|
2316
|
-
const [, r$
|
|
2317
|
-
if (r$
|
|
2318
|
-
if (r$
|
|
2487
|
+
const [, r$2, g, b, alpha] = parsed;
|
|
2488
|
+
if (r$2.type === Tok.Hue || g.type === Tok.Hue || b.type === Tok.Hue) return void 0;
|
|
2489
|
+
if (r$2.type !== Tok.None) res.r = r$2.type === Tok.Number ? r$2.value / 255 : r$2.value / 100;
|
|
2319
2490
|
if (g.type !== Tok.None) res.g = g.type === Tok.Number ? g.value / 255 : g.value / 100;
|
|
2320
2491
|
if (b.type !== Tok.None) res.b = b.type === Tok.Number ? b.value / 255 : b.value / 100;
|
|
2321
2492
|
if (alpha.type !== Tok.None) res.alpha = Math.min(1, Math.max(0, alpha.type === Tok.Number ? alpha.value : alpha.value / 100));
|
|
@@ -2324,7 +2495,7 @@ function parseRgb(color, parsed) {
|
|
|
2324
2495
|
var parseRgb_default = parseRgb;
|
|
2325
2496
|
|
|
2326
2497
|
//#endregion
|
|
2327
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2498
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/parseTransparent.js
|
|
2328
2499
|
const parseTransparent = (c$2) => c$2 === "transparent" ? {
|
|
2329
2500
|
mode: "rgb",
|
|
2330
2501
|
r: 0,
|
|
@@ -2335,11 +2506,11 @@ const parseTransparent = (c$2) => c$2 === "transparent" ? {
|
|
|
2335
2506
|
var parseTransparent_default = parseTransparent;
|
|
2336
2507
|
|
|
2337
2508
|
//#endregion
|
|
2338
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2509
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/lerp.js
|
|
2339
2510
|
const lerp = (a, b, t) => a + t * (b - a);
|
|
2340
2511
|
|
|
2341
2512
|
//#endregion
|
|
2342
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2513
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/piecewise.js
|
|
2343
2514
|
const get_classes = (arr) => {
|
|
2344
2515
|
let classes = [];
|
|
2345
2516
|
for (let i = 0; i < arr.length - 1; i++) {
|
|
@@ -2362,11 +2533,11 @@ const interpolatorPiecewise = (interpolator) => (arr) => {
|
|
|
2362
2533
|
};
|
|
2363
2534
|
|
|
2364
2535
|
//#endregion
|
|
2365
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2536
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/interpolate/linear.js
|
|
2366
2537
|
const interpolatorLinear = interpolatorPiecewise(lerp);
|
|
2367
2538
|
|
|
2368
2539
|
//#endregion
|
|
2369
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2540
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/fixup/alpha.js
|
|
2370
2541
|
const fixupAlpha = (arr) => {
|
|
2371
2542
|
let some_defined = false;
|
|
2372
2543
|
let res = arr.map((v) => {
|
|
@@ -2380,7 +2551,7 @@ const fixupAlpha = (arr) => {
|
|
|
2380
2551
|
};
|
|
2381
2552
|
|
|
2382
2553
|
//#endregion
|
|
2383
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2554
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rgb/definition.js
|
|
2384
2555
|
const definition$15 = {
|
|
2385
2556
|
mode: "rgb",
|
|
2386
2557
|
channels: [
|
|
@@ -2419,20 +2590,20 @@ const definition$15 = {
|
|
|
2419
2590
|
b: 0
|
|
2420
2591
|
}
|
|
2421
2592
|
};
|
|
2422
|
-
var definition_default$
|
|
2593
|
+
var definition_default$12 = definition$15;
|
|
2423
2594
|
|
|
2424
2595
|
//#endregion
|
|
2425
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2596
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/convertA98ToXyz65.js
|
|
2426
2597
|
const linearize$2 = (v = 0) => Math.pow(Math.abs(v), 563 / 256) * Math.sign(v);
|
|
2427
2598
|
const convertA98ToXyz65 = (a98) => {
|
|
2428
|
-
let r$
|
|
2599
|
+
let r$2 = linearize$2(a98.r);
|
|
2429
2600
|
let g = linearize$2(a98.g);
|
|
2430
2601
|
let b = linearize$2(a98.b);
|
|
2431
2602
|
let res = {
|
|
2432
2603
|
mode: "xyz65",
|
|
2433
|
-
x: .5766690429101305 * r$
|
|
2434
|
-
y: .297344975250536 * r$
|
|
2435
|
-
z: .0270313613864123 * r$
|
|
2604
|
+
x: .5766690429101305 * r$2 + .1855582379065463 * g + .1882286462349947 * b,
|
|
2605
|
+
y: .297344975250536 * r$2 + .6273635662554661 * g + .0752914584939979 * b,
|
|
2606
|
+
z: .0270313613864123 * r$2 + .0706888525358272 * g + .9913375368376386 * b
|
|
2436
2607
|
};
|
|
2437
2608
|
if (a98.alpha !== void 0) res.alpha = a98.alpha;
|
|
2438
2609
|
return res;
|
|
@@ -2440,7 +2611,7 @@ const convertA98ToXyz65 = (a98) => {
|
|
|
2440
2611
|
var convertA98ToXyz65_default = convertA98ToXyz65;
|
|
2441
2612
|
|
|
2442
2613
|
//#endregion
|
|
2443
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2614
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/convertXyz65ToA98.js
|
|
2444
2615
|
const gamma$2 = (v) => Math.pow(Math.abs(v), 256 / 563) * Math.sign(v);
|
|
2445
2616
|
const convertXyz65ToA98 = ({ x, y, z, alpha }) => {
|
|
2446
2617
|
if (x === void 0) x = 0;
|
|
@@ -2458,16 +2629,16 @@ const convertXyz65ToA98 = ({ x, y, z, alpha }) => {
|
|
|
2458
2629
|
var convertXyz65ToA98_default = convertXyz65ToA98;
|
|
2459
2630
|
|
|
2460
2631
|
//#endregion
|
|
2461
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2632
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/convertRgbToLrgb.js
|
|
2462
2633
|
const fn$3 = (c$2 = 0) => {
|
|
2463
2634
|
const abs = Math.abs(c$2);
|
|
2464
2635
|
if (abs <= .04045) return c$2 / 12.92;
|
|
2465
2636
|
return (Math.sign(c$2) || 1) * Math.pow((abs + .055) / 1.055, 2.4);
|
|
2466
2637
|
};
|
|
2467
|
-
const convertRgbToLrgb = ({ r: r$
|
|
2638
|
+
const convertRgbToLrgb = ({ r: r$2, g, b, alpha }) => {
|
|
2468
2639
|
let res = {
|
|
2469
2640
|
mode: "lrgb",
|
|
2470
|
-
r: fn$3(r$
|
|
2641
|
+
r: fn$3(r$2),
|
|
2471
2642
|
g: fn$3(g),
|
|
2472
2643
|
b: fn$3(b)
|
|
2473
2644
|
};
|
|
@@ -2477,14 +2648,14 @@ const convertRgbToLrgb = ({ r: r$1, g, b, alpha }) => {
|
|
|
2477
2648
|
var convertRgbToLrgb_default = convertRgbToLrgb;
|
|
2478
2649
|
|
|
2479
2650
|
//#endregion
|
|
2480
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2651
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertRgbToXyz65.js
|
|
2481
2652
|
const convertRgbToXyz65 = (rgb$2) => {
|
|
2482
|
-
let { r: r$
|
|
2653
|
+
let { r: r$2, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
|
|
2483
2654
|
let res = {
|
|
2484
2655
|
mode: "xyz65",
|
|
2485
|
-
x: .4123907992659593 * r$
|
|
2486
|
-
y: .2126390058715102 * r$
|
|
2487
|
-
z: .0193308187155918 * r$
|
|
2656
|
+
x: .4123907992659593 * r$2 + .357584339383878 * g + .1804807884018343 * b,
|
|
2657
|
+
y: .2126390058715102 * r$2 + .715168678767756 * g + .0721923153607337 * b,
|
|
2658
|
+
z: .0193308187155918 * r$2 + .119194779794626 * g + .9505321522496607 * b
|
|
2488
2659
|
};
|
|
2489
2660
|
if (alpha !== void 0) res.alpha = alpha;
|
|
2490
2661
|
return res;
|
|
@@ -2492,16 +2663,16 @@ const convertRgbToXyz65 = (rgb$2) => {
|
|
|
2492
2663
|
var convertRgbToXyz65_default = convertRgbToXyz65;
|
|
2493
2664
|
|
|
2494
2665
|
//#endregion
|
|
2495
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2666
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/convertLrgbToRgb.js
|
|
2496
2667
|
const fn$2 = (c$2 = 0) => {
|
|
2497
2668
|
const abs = Math.abs(c$2);
|
|
2498
2669
|
if (abs > .0031308) return (Math.sign(c$2) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - .055);
|
|
2499
2670
|
return c$2 * 12.92;
|
|
2500
2671
|
};
|
|
2501
|
-
const convertLrgbToRgb = ({ r: r$
|
|
2672
|
+
const convertLrgbToRgb = ({ r: r$2, g, b, alpha }, mode = "rgb") => {
|
|
2502
2673
|
let res = {
|
|
2503
2674
|
mode,
|
|
2504
|
-
r: fn$2(r$
|
|
2675
|
+
r: fn$2(r$2),
|
|
2505
2676
|
g: fn$2(g),
|
|
2506
2677
|
b: fn$2(b)
|
|
2507
2678
|
};
|
|
@@ -2511,7 +2682,7 @@ const convertLrgbToRgb = ({ r: r$1, g, b, alpha }, mode = "rgb") => {
|
|
|
2511
2682
|
var convertLrgbToRgb_default = convertLrgbToRgb;
|
|
2512
2683
|
|
|
2513
2684
|
//#endregion
|
|
2514
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2685
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz65ToRgb.js
|
|
2515
2686
|
const convertXyz65ToRgb = ({ x, y, z, alpha }) => {
|
|
2516
2687
|
if (x === void 0) x = 0;
|
|
2517
2688
|
if (y === void 0) y = 0;
|
|
@@ -2527,9 +2698,9 @@ const convertXyz65ToRgb = ({ x, y, z, alpha }) => {
|
|
|
2527
2698
|
var convertXyz65ToRgb_default = convertXyz65ToRgb;
|
|
2528
2699
|
|
|
2529
2700
|
//#endregion
|
|
2530
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2701
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/a98/definition.js
|
|
2531
2702
|
const definition$14 = {
|
|
2532
|
-
...definition_default$
|
|
2703
|
+
...definition_default$12,
|
|
2533
2704
|
mode: "a98",
|
|
2534
2705
|
parse: ["a98-rgb"],
|
|
2535
2706
|
serialize: "a98-rgb",
|
|
@@ -2545,12 +2716,12 @@ const definition$14 = {
|
|
|
2545
2716
|
var definition_default = definition$14;
|
|
2546
2717
|
|
|
2547
2718
|
//#endregion
|
|
2548
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2719
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/normalizeHue.js
|
|
2549
2720
|
const normalizeHue = (hue$3) => (hue$3 = hue$3 % 360) < 0 ? hue$3 + 360 : hue$3;
|
|
2550
2721
|
var normalizeHue_default = normalizeHue;
|
|
2551
2722
|
|
|
2552
2723
|
//#endregion
|
|
2553
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2724
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/convertHslToRgb.js
|
|
2554
2725
|
function convertHslToRgb({ h, s, l, alpha }) {
|
|
2555
2726
|
h = normalizeHue_default(h !== void 0 ? h : 0);
|
|
2556
2727
|
if (s === void 0) s = 0;
|
|
@@ -2613,24 +2784,24 @@ function convertHslToRgb({ h, s, l, alpha }) {
|
|
|
2613
2784
|
}
|
|
2614
2785
|
|
|
2615
2786
|
//#endregion
|
|
2616
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2617
|
-
function convertRgbToHsl({ r: r$
|
|
2618
|
-
if (r$
|
|
2787
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/convertRgbToHsl.js
|
|
2788
|
+
function convertRgbToHsl({ r: r$2, g, b, alpha }) {
|
|
2789
|
+
if (r$2 === void 0) r$2 = 0;
|
|
2619
2790
|
if (g === void 0) g = 0;
|
|
2620
2791
|
if (b === void 0) b = 0;
|
|
2621
|
-
let M = Math.max(r$
|
|
2792
|
+
let M = Math.max(r$2, g, b), m = Math.min(r$2, g, b);
|
|
2622
2793
|
let res = {
|
|
2623
2794
|
mode: "hsl",
|
|
2624
2795
|
s: M === m ? 0 : (M - m) / (1 - Math.abs(M + m - 1)),
|
|
2625
2796
|
l: .5 * (M + m)
|
|
2626
2797
|
};
|
|
2627
|
-
if (M - m !== 0) res.h = (M === r$
|
|
2798
|
+
if (M - m !== 0) res.h = (M === r$2 ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r$2) / (M - m) + 2 : (r$2 - g) / (M - m) + 4) * 60;
|
|
2628
2799
|
if (alpha !== void 0) res.alpha = alpha;
|
|
2629
2800
|
return res;
|
|
2630
2801
|
}
|
|
2631
2802
|
|
|
2632
2803
|
//#endregion
|
|
2633
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2804
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/util/hue.js
|
|
2634
2805
|
const hueToDeg = (val, unit) => {
|
|
2635
2806
|
switch (unit) {
|
|
2636
2807
|
case "deg": return +val;
|
|
@@ -2642,7 +2813,7 @@ const hueToDeg = (val, unit) => {
|
|
|
2642
2813
|
var hue_default = hueToDeg;
|
|
2643
2814
|
|
|
2644
2815
|
//#endregion
|
|
2645
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2816
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/parseHslLegacy.js
|
|
2646
2817
|
const hsl_old = new RegExp(`^hsla?\\(\\s*${hue$1}${c}${per}${c}${per}\\s*(?:,\\s*${num_per}\\s*)?\\)$`);
|
|
2647
2818
|
const parseHslLegacy = (color) => {
|
|
2648
2819
|
let match = color.match(hsl_old);
|
|
@@ -2659,7 +2830,7 @@ const parseHslLegacy = (color) => {
|
|
|
2659
2830
|
var parseHslLegacy_default = parseHslLegacy;
|
|
2660
2831
|
|
|
2661
2832
|
//#endregion
|
|
2662
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2833
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/parseHsl.js
|
|
2663
2834
|
function parseHsl(color, parsed) {
|
|
2664
2835
|
if (!parsed || parsed[0] !== "hsl" && parsed[0] !== "hsla") return void 0;
|
|
2665
2836
|
const res = { mode: "hsl" };
|
|
@@ -2682,7 +2853,7 @@ function parseHsl(color, parsed) {
|
|
|
2682
2853
|
var parseHsl_default = parseHsl;
|
|
2683
2854
|
|
|
2684
2855
|
//#endregion
|
|
2685
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2856
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/fixup/hue.js
|
|
2686
2857
|
const hue = (hues, fn$5) => {
|
|
2687
2858
|
return hues.map((hue$3, idx, arr) => {
|
|
2688
2859
|
if (hue$3 === void 0) return hue$3;
|
|
@@ -2701,7 +2872,7 @@ const hue = (hues, fn$5) => {
|
|
|
2701
2872
|
const fixupHueShorter = (arr) => hue(arr, (d) => Math.abs(d) <= 180 ? d : d - 360 * Math.sign(d));
|
|
2702
2873
|
|
|
2703
2874
|
//#endregion
|
|
2704
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2875
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/difference.js
|
|
2705
2876
|
const differenceHueSaturation = (std, smp) => {
|
|
2706
2877
|
if (std.h === void 0 || smp.h === void 0 || !std.s || !smp.s) return 0;
|
|
2707
2878
|
let std_h = normalizeHue_default(std.h);
|
|
@@ -2725,7 +2896,7 @@ const differenceHueChroma = (std, smp) => {
|
|
|
2725
2896
|
};
|
|
2726
2897
|
|
|
2727
2898
|
//#endregion
|
|
2728
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2899
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/average.js
|
|
2729
2900
|
const averageAngle = (val) => {
|
|
2730
2901
|
let sum = val.reduce((sum$1, val$1) => {
|
|
2731
2902
|
if (val$1 !== void 0) {
|
|
@@ -2743,7 +2914,7 @@ const averageAngle = (val) => {
|
|
|
2743
2914
|
};
|
|
2744
2915
|
|
|
2745
2916
|
//#endregion
|
|
2746
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2917
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsl/definition.js
|
|
2747
2918
|
const definition$13 = {
|
|
2748
2919
|
mode: "hsl",
|
|
2749
2920
|
toMode: { rgb: convertHslToRgb },
|
|
@@ -2776,7 +2947,7 @@ const definition$13 = {
|
|
|
2776
2947
|
var definition_default$1 = definition$13;
|
|
2777
2948
|
|
|
2778
2949
|
//#endregion
|
|
2779
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2950
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/convertHsvToRgb.js
|
|
2780
2951
|
function convertHsvToRgb({ h, s, v, alpha }) {
|
|
2781
2952
|
h = normalizeHue_default(h !== void 0 ? h : 0);
|
|
2782
2953
|
if (s === void 0) s = 0;
|
|
@@ -2838,24 +3009,24 @@ function convertHsvToRgb({ h, s, v, alpha }) {
|
|
|
2838
3009
|
}
|
|
2839
3010
|
|
|
2840
3011
|
//#endregion
|
|
2841
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
2842
|
-
function convertRgbToHsv({ r: r$
|
|
2843
|
-
if (r$
|
|
3012
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/convertRgbToHsv.js
|
|
3013
|
+
function convertRgbToHsv({ r: r$2, g, b, alpha }) {
|
|
3014
|
+
if (r$2 === void 0) r$2 = 0;
|
|
2844
3015
|
if (g === void 0) g = 0;
|
|
2845
3016
|
if (b === void 0) b = 0;
|
|
2846
|
-
let M = Math.max(r$
|
|
3017
|
+
let M = Math.max(r$2, g, b), m = Math.min(r$2, g, b);
|
|
2847
3018
|
let res = {
|
|
2848
3019
|
mode: "hsv",
|
|
2849
3020
|
s: M === 0 ? 0 : 1 - m / M,
|
|
2850
3021
|
v: M
|
|
2851
3022
|
};
|
|
2852
|
-
if (M - m !== 0) res.h = (M === r$
|
|
3023
|
+
if (M - m !== 0) res.h = (M === r$2 ? (g - b) / (M - m) + (g < b) * 6 : M === g ? (b - r$2) / (M - m) + 2 : (r$2 - g) / (M - m) + 4) * 60;
|
|
2853
3024
|
if (alpha !== void 0) res.alpha = alpha;
|
|
2854
3025
|
return res;
|
|
2855
3026
|
}
|
|
2856
3027
|
|
|
2857
3028
|
//#endregion
|
|
2858
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3029
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hsv/definition.js
|
|
2859
3030
|
const definition$12 = {
|
|
2860
3031
|
mode: "hsv",
|
|
2861
3032
|
toMode: { rgb: convertHsvToRgb },
|
|
@@ -2885,10 +3056,10 @@ const definition$12 = {
|
|
|
2885
3056
|
difference: { h: differenceHueSaturation },
|
|
2886
3057
|
average: { h: averageAngle }
|
|
2887
3058
|
};
|
|
2888
|
-
var definition_default$
|
|
3059
|
+
var definition_default$15 = definition$12;
|
|
2889
3060
|
|
|
2890
3061
|
//#endregion
|
|
2891
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3062
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/convertHwbToRgb.js
|
|
2892
3063
|
function convertHwbToRgb({ h, w, b, alpha }) {
|
|
2893
3064
|
if (w === void 0) w = 0;
|
|
2894
3065
|
if (b === void 0) b = 0;
|
|
@@ -2906,7 +3077,7 @@ function convertHwbToRgb({ h, w, b, alpha }) {
|
|
|
2906
3077
|
}
|
|
2907
3078
|
|
|
2908
3079
|
//#endregion
|
|
2909
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3080
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/convertRgbToHwb.js
|
|
2910
3081
|
function convertRgbToHwb(rgba) {
|
|
2911
3082
|
let hsv = convertRgbToHsv(rgba);
|
|
2912
3083
|
if (hsv === void 0) return void 0;
|
|
@@ -2923,7 +3094,7 @@ function convertRgbToHwb(rgba) {
|
|
|
2923
3094
|
}
|
|
2924
3095
|
|
|
2925
3096
|
//#endregion
|
|
2926
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3097
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/parseHwb.js
|
|
2927
3098
|
function ParseHwb(color, parsed) {
|
|
2928
3099
|
if (!parsed || parsed[0] !== "hwb") return void 0;
|
|
2929
3100
|
const res = { mode: "hwb" };
|
|
@@ -2946,7 +3117,7 @@ function ParseHwb(color, parsed) {
|
|
|
2946
3117
|
var parseHwb_default = ParseHwb;
|
|
2947
3118
|
|
|
2948
3119
|
//#endregion
|
|
2949
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3120
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/hwb/definition.js
|
|
2950
3121
|
const definition$11 = {
|
|
2951
3122
|
mode: "hwb",
|
|
2952
3123
|
toMode: { rgb: convertHwbToRgb },
|
|
@@ -2976,15 +3147,15 @@ const definition$11 = {
|
|
|
2976
3147
|
difference: { h: differenceHueNaive },
|
|
2977
3148
|
average: { h: averageAngle }
|
|
2978
3149
|
};
|
|
2979
|
-
var definition_default$
|
|
3150
|
+
var definition_default$2 = definition$11;
|
|
2980
3151
|
|
|
2981
3152
|
//#endregion
|
|
2982
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3153
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/constants.js
|
|
2983
3154
|
const k$1 = Math.pow(29, 3) / Math.pow(3, 3);
|
|
2984
3155
|
const e$1 = Math.pow(6, 3) / Math.pow(29, 3);
|
|
2985
3156
|
|
|
2986
3157
|
//#endregion
|
|
2987
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3158
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/constants.js
|
|
2988
3159
|
const D50 = {
|
|
2989
3160
|
X: .3457 / .3585,
|
|
2990
3161
|
Y: 1,
|
|
@@ -2999,7 +3170,7 @@ const k$2 = Math.pow(29, 3) / Math.pow(3, 3);
|
|
|
2999
3170
|
const e$2 = Math.pow(6, 3) / Math.pow(29, 3);
|
|
3000
3171
|
|
|
3001
3172
|
//#endregion
|
|
3002
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3173
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertLabToXyz50.js
|
|
3003
3174
|
let fn$1 = (v) => Math.pow(v, 3) > e$1 ? Math.pow(v, 3) : (116 * v - 16) / k$1;
|
|
3004
3175
|
const convertLabToXyz50 = ({ l, a, b, alpha }) => {
|
|
3005
3176
|
if (l === void 0) l = 0;
|
|
@@ -3020,7 +3191,7 @@ const convertLabToXyz50 = ({ l, a, b, alpha }) => {
|
|
|
3020
3191
|
var convertLabToXyz50_default = convertLabToXyz50;
|
|
3021
3192
|
|
|
3022
3193
|
//#endregion
|
|
3023
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3194
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/convertXyz50ToRgb.js
|
|
3024
3195
|
const convertXyz50ToRgb = ({ x, y, z, alpha }) => {
|
|
3025
3196
|
if (x === void 0) x = 0;
|
|
3026
3197
|
if (y === void 0) y = 0;
|
|
@@ -3036,19 +3207,19 @@ const convertXyz50ToRgb = ({ x, y, z, alpha }) => {
|
|
|
3036
3207
|
var convertXyz50ToRgb_default = convertXyz50ToRgb;
|
|
3037
3208
|
|
|
3038
3209
|
//#endregion
|
|
3039
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3210
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertLabToRgb.js
|
|
3040
3211
|
const convertLabToRgb = (lab) => convertXyz50ToRgb_default(convertLabToXyz50_default(lab));
|
|
3041
3212
|
var convertLabToRgb_default = convertLabToRgb;
|
|
3042
3213
|
|
|
3043
3214
|
//#endregion
|
|
3044
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3215
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/convertRgbToXyz50.js
|
|
3045
3216
|
const convertRgbToXyz50 = (rgb$2) => {
|
|
3046
|
-
let { r: r$
|
|
3217
|
+
let { r: r$2, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
|
|
3047
3218
|
let res = {
|
|
3048
3219
|
mode: "xyz50",
|
|
3049
|
-
x: .436065742824811 * r$
|
|
3050
|
-
y: .22249319175623702 * r$
|
|
3051
|
-
z: .013923904500943465 * r$
|
|
3220
|
+
x: .436065742824811 * r$2 + .3851514688337912 * g + .14307845442264197 * b,
|
|
3221
|
+
y: .22249319175623702 * r$2 + .7168870538238823 * g + .06061979053616537 * b,
|
|
3222
|
+
z: .013923904500943465 * r$2 + .09708128566574634 * g + .7140993584005155 * b
|
|
3052
3223
|
};
|
|
3053
3224
|
if (alpha !== void 0) res.alpha = alpha;
|
|
3054
3225
|
return res;
|
|
@@ -3056,7 +3227,7 @@ const convertRgbToXyz50 = (rgb$2) => {
|
|
|
3056
3227
|
var convertRgbToXyz50_default = convertRgbToXyz50;
|
|
3057
3228
|
|
|
3058
3229
|
//#endregion
|
|
3059
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3230
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertXyz50ToLab.js
|
|
3060
3231
|
const f$1 = (value) => value > e$1 ? Math.cbrt(value) : (k$1 * value + 16) / 116;
|
|
3061
3232
|
const convertXyz50ToLab = ({ x, y, z, alpha }) => {
|
|
3062
3233
|
if (x === void 0) x = 0;
|
|
@@ -3077,7 +3248,7 @@ const convertXyz50ToLab = ({ x, y, z, alpha }) => {
|
|
|
3077
3248
|
var convertXyz50ToLab_default = convertXyz50ToLab;
|
|
3078
3249
|
|
|
3079
3250
|
//#endregion
|
|
3080
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3251
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/convertRgbToLab.js
|
|
3081
3252
|
const convertRgbToLab = (rgb$2) => {
|
|
3082
3253
|
let res = convertXyz50ToLab_default(convertRgbToXyz50_default(rgb$2));
|
|
3083
3254
|
if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
|
|
@@ -3086,7 +3257,7 @@ const convertRgbToLab = (rgb$2) => {
|
|
|
3086
3257
|
var convertRgbToLab_default = convertRgbToLab;
|
|
3087
3258
|
|
|
3088
3259
|
//#endregion
|
|
3089
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3260
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/parseLab.js
|
|
3090
3261
|
function parseLab(color, parsed) {
|
|
3091
3262
|
if (!parsed || parsed[0] !== "lab") return void 0;
|
|
3092
3263
|
const res = { mode: "lab" };
|
|
@@ -3101,7 +3272,7 @@ function parseLab(color, parsed) {
|
|
|
3101
3272
|
var parseLab_default = parseLab;
|
|
3102
3273
|
|
|
3103
3274
|
//#endregion
|
|
3104
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3275
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab/definition.js
|
|
3105
3276
|
const definition$10 = {
|
|
3106
3277
|
mode: "lab",
|
|
3107
3278
|
toMode: {
|
|
@@ -3120,8 +3291,8 @@ const definition$10 = {
|
|
|
3120
3291
|
],
|
|
3121
3292
|
ranges: {
|
|
3122
3293
|
l: [0, 100],
|
|
3123
|
-
a: [-
|
|
3124
|
-
b: [-
|
|
3294
|
+
a: [-125, 125],
|
|
3295
|
+
b: [-125, 125]
|
|
3125
3296
|
},
|
|
3126
3297
|
parse: [parseLab_default],
|
|
3127
3298
|
serialize: (c$2) => `lab(${c$2.l !== void 0 ? c$2.l : "none"} ${c$2.a !== void 0 ? c$2.a : "none"} ${c$2.b !== void 0 ? c$2.b : "none"}${c$2.alpha < 1 ? ` / ${c$2.alpha}` : ""})`,
|
|
@@ -3135,15 +3306,15 @@ const definition$10 = {
|
|
|
3135
3306
|
}
|
|
3136
3307
|
}
|
|
3137
3308
|
};
|
|
3138
|
-
var definition_default$
|
|
3309
|
+
var definition_default$3 = definition$10;
|
|
3139
3310
|
|
|
3140
3311
|
//#endregion
|
|
3141
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3312
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/constants.js
|
|
3142
3313
|
const k = Math.pow(29, 3) / Math.pow(3, 3);
|
|
3143
3314
|
const e = Math.pow(6, 3) / Math.pow(29, 3);
|
|
3144
3315
|
|
|
3145
3316
|
//#endregion
|
|
3146
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3317
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToXyz65.js
|
|
3147
3318
|
let fn = (v) => Math.pow(v, 3) > e ? Math.pow(v, 3) : (116 * v - 16) / k;
|
|
3148
3319
|
const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
|
|
3149
3320
|
if (l === void 0) l = 0;
|
|
@@ -3164,12 +3335,12 @@ const convertLab65ToXyz65 = ({ l, a, b, alpha }) => {
|
|
|
3164
3335
|
var convertLab65ToXyz65_default = convertLab65ToXyz65;
|
|
3165
3336
|
|
|
3166
3337
|
//#endregion
|
|
3167
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3338
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertLab65ToRgb.js
|
|
3168
3339
|
const convertLab65ToRgb = (lab) => convertXyz65ToRgb_default(convertLab65ToXyz65_default(lab));
|
|
3169
3340
|
var convertLab65ToRgb_default = convertLab65ToRgb;
|
|
3170
3341
|
|
|
3171
3342
|
//#endregion
|
|
3172
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3343
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertXyz65ToLab65.js
|
|
3173
3344
|
const f = (value) => value > e ? Math.cbrt(value) : (k * value + 16) / 116;
|
|
3174
3345
|
const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
|
|
3175
3346
|
if (x === void 0) x = 0;
|
|
@@ -3190,7 +3361,7 @@ const convertXyz65ToLab65 = ({ x, y, z, alpha }) => {
|
|
|
3190
3361
|
var convertXyz65ToLab65_default = convertXyz65ToLab65;
|
|
3191
3362
|
|
|
3192
3363
|
//#endregion
|
|
3193
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3364
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/convertRgbToLab65.js
|
|
3194
3365
|
const convertRgbToLab65 = (rgb$2) => {
|
|
3195
3366
|
let res = convertXyz65ToLab65_default(convertRgbToXyz65_default(rgb$2));
|
|
3196
3367
|
if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
|
|
@@ -3199,9 +3370,9 @@ const convertRgbToLab65 = (rgb$2) => {
|
|
|
3199
3370
|
var convertRgbToLab65_default = convertRgbToLab65;
|
|
3200
3371
|
|
|
3201
3372
|
//#endregion
|
|
3202
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3373
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lab65/definition.js
|
|
3203
3374
|
const definition$9 = {
|
|
3204
|
-
...definition_default$
|
|
3375
|
+
...definition_default$3,
|
|
3205
3376
|
mode: "lab65",
|
|
3206
3377
|
parse: ["--lab-d65"],
|
|
3207
3378
|
serialize: "--lab-d65",
|
|
@@ -3215,14 +3386,14 @@ const definition$9 = {
|
|
|
3215
3386
|
},
|
|
3216
3387
|
ranges: {
|
|
3217
3388
|
l: [0, 100],
|
|
3218
|
-
a: [-
|
|
3219
|
-
b: [-
|
|
3389
|
+
a: [-125, 125],
|
|
3390
|
+
b: [-125, 125]
|
|
3220
3391
|
}
|
|
3221
3392
|
};
|
|
3222
|
-
var definition_default$
|
|
3393
|
+
var definition_default$4 = definition$9;
|
|
3223
3394
|
|
|
3224
3395
|
//#endregion
|
|
3225
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3396
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/convertLabToLch.js
|
|
3226
3397
|
const convertLabToLch = ({ l, a, b, alpha }, mode = "lch") => {
|
|
3227
3398
|
if (a === void 0) a = 0;
|
|
3228
3399
|
if (b === void 0) b = 0;
|
|
@@ -3239,7 +3410,7 @@ const convertLabToLch = ({ l, a, b, alpha }, mode = "lch") => {
|
|
|
3239
3410
|
var convertLabToLch_default = convertLabToLch;
|
|
3240
3411
|
|
|
3241
3412
|
//#endregion
|
|
3242
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3413
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/convertLchToLab.js
|
|
3243
3414
|
const convertLchToLab = ({ l, c: c$2, h, alpha }, mode = "lab") => {
|
|
3244
3415
|
if (h === void 0) h = 0;
|
|
3245
3416
|
let res = {
|
|
@@ -3254,7 +3425,7 @@ const convertLchToLab = ({ l, c: c$2, h, alpha }, mode = "lab") => {
|
|
|
3254
3425
|
var convertLchToLab_default = convertLchToLab;
|
|
3255
3426
|
|
|
3256
3427
|
//#endregion
|
|
3257
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3428
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/parseLch.js
|
|
3258
3429
|
function parseLch(color, parsed) {
|
|
3259
3430
|
if (!parsed || parsed[0] !== "lch") return void 0;
|
|
3260
3431
|
const res = { mode: "lch" };
|
|
@@ -3274,7 +3445,7 @@ function parseLch(color, parsed) {
|
|
|
3274
3445
|
var parseLch_default = parseLch;
|
|
3275
3446
|
|
|
3276
3447
|
//#endregion
|
|
3277
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3448
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lch/definition.js
|
|
3278
3449
|
const definition$8 = {
|
|
3279
3450
|
mode: "lch",
|
|
3280
3451
|
toMode: {
|
|
@@ -3313,34 +3484,34 @@ const definition$8 = {
|
|
|
3313
3484
|
difference: { h: differenceHueChroma },
|
|
3314
3485
|
average: { h: averageAngle }
|
|
3315
3486
|
};
|
|
3316
|
-
var definition_default$
|
|
3487
|
+
var definition_default$5 = definition$8;
|
|
3317
3488
|
|
|
3318
3489
|
//#endregion
|
|
3319
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3490
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/lrgb/definition.js
|
|
3320
3491
|
const definition$7 = {
|
|
3321
|
-
...definition_default$
|
|
3492
|
+
...definition_default$12,
|
|
3322
3493
|
mode: "lrgb",
|
|
3323
3494
|
toMode: { rgb: convertLrgbToRgb_default },
|
|
3324
3495
|
fromMode: { rgb: convertRgbToLrgb_default },
|
|
3325
3496
|
parse: ["srgb-linear"],
|
|
3326
3497
|
serialize: "srgb-linear"
|
|
3327
3498
|
};
|
|
3328
|
-
var definition_default$
|
|
3499
|
+
var definition_default$6 = definition$7;
|
|
3329
3500
|
|
|
3330
3501
|
//#endregion
|
|
3331
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3502
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToLrgb.js
|
|
3332
3503
|
const convertOklabToLrgb = ({ l, a, b, alpha }) => {
|
|
3333
3504
|
if (l === void 0) l = 0;
|
|
3334
3505
|
if (a === void 0) a = 0;
|
|
3335
3506
|
if (b === void 0) b = 0;
|
|
3336
|
-
let L = Math.pow(l
|
|
3337
|
-
let M = Math.pow(l
|
|
3338
|
-
let S = Math.pow(l
|
|
3507
|
+
let L = Math.pow(l + .3963377773761749 * a + .2158037573099136 * b, 3);
|
|
3508
|
+
let M = Math.pow(l - .1055613458156586 * a - .0638541728258133 * b, 3);
|
|
3509
|
+
let S = Math.pow(l - .0894841775298119 * a - 1.2914855480194092 * b, 3);
|
|
3339
3510
|
let res = {
|
|
3340
3511
|
mode: "lrgb",
|
|
3341
|
-
r: 4.
|
|
3342
|
-
g: -1.
|
|
3343
|
-
b: -.
|
|
3512
|
+
r: 4.076741636075957 * L - 3.3077115392580616 * M + .2309699031821044 * S,
|
|
3513
|
+
g: -1.2684379732850317 * L + 2.6097573492876887 * M - .3413193760026573 * S,
|
|
3514
|
+
b: -.0041960761386756 * L - .7034186179359362 * M + 1.7076146940746117 * S
|
|
3344
3515
|
};
|
|
3345
3516
|
if (alpha !== void 0) res.alpha = alpha;
|
|
3346
3517
|
return res;
|
|
@@ -3348,19 +3519,19 @@ const convertOklabToLrgb = ({ l, a, b, alpha }) => {
|
|
|
3348
3519
|
var convertOklabToLrgb_default = convertOklabToLrgb;
|
|
3349
3520
|
|
|
3350
3521
|
//#endregion
|
|
3351
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3352
|
-
const convertLrgbToOklab = ({ r: r$
|
|
3353
|
-
if (r$
|
|
3522
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertLrgbToOklab.js
|
|
3523
|
+
const convertLrgbToOklab = ({ r: r$2, g, b, alpha }) => {
|
|
3524
|
+
if (r$2 === void 0) r$2 = 0;
|
|
3354
3525
|
if (g === void 0) g = 0;
|
|
3355
3526
|
if (b === void 0) b = 0;
|
|
3356
|
-
let L = Math.cbrt(.
|
|
3357
|
-
let M = Math.cbrt(.
|
|
3358
|
-
let S = Math.cbrt(.
|
|
3527
|
+
let L = Math.cbrt(.412221469470763 * r$2 + .5363325372617348 * g + .0514459932675022 * b);
|
|
3528
|
+
let M = Math.cbrt(.2119034958178252 * r$2 + .6806995506452344 * g + .1073969535369406 * b);
|
|
3529
|
+
let S = Math.cbrt(.0883024591900564 * r$2 + .2817188391361215 * g + .6299787016738222 * b);
|
|
3359
3530
|
let res = {
|
|
3360
3531
|
mode: "oklab",
|
|
3361
|
-
l: .
|
|
3362
|
-
a: 1.
|
|
3363
|
-
b: .
|
|
3532
|
+
l: .210454268309314 * L + .7936177747023054 * M - .0040720430116193 * S,
|
|
3533
|
+
a: 1.9779985324311684 * L - 2.42859224204858 * M + .450593709617411 * S,
|
|
3534
|
+
b: .0259040424655478 * L + .7827717124575296 * M - .8086757549230774 * S
|
|
3364
3535
|
};
|
|
3365
3536
|
if (alpha !== void 0) res.alpha = alpha;
|
|
3366
3537
|
return res;
|
|
@@ -3368,7 +3539,7 @@ const convertLrgbToOklab = ({ r: r$1, g, b, alpha }) => {
|
|
|
3368
3539
|
var convertLrgbToOklab_default = convertLrgbToOklab;
|
|
3369
3540
|
|
|
3370
3541
|
//#endregion
|
|
3371
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3542
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertRgbToOklab.js
|
|
3372
3543
|
const convertRgbToOklab = (rgb$2) => {
|
|
3373
3544
|
let res = convertLrgbToOklab_default(convertRgbToLrgb_default(rgb$2));
|
|
3374
3545
|
if (rgb$2.r === rgb$2.b && rgb$2.b === rgb$2.g) res.a = res.b = 0;
|
|
@@ -3377,12 +3548,12 @@ const convertRgbToOklab = (rgb$2) => {
|
|
|
3377
3548
|
var convertRgbToOklab_default = convertRgbToOklab;
|
|
3378
3549
|
|
|
3379
3550
|
//#endregion
|
|
3380
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3551
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/convertOklabToRgb.js
|
|
3381
3552
|
const convertOklabToRgb = (c$2) => convertLrgbToRgb_default(convertOklabToLrgb_default(c$2));
|
|
3382
3553
|
var convertOklabToRgb_default = convertOklabToRgb;
|
|
3383
3554
|
|
|
3384
3555
|
//#endregion
|
|
3385
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3556
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/parseOklab.js
|
|
3386
3557
|
function parseOklab(color, parsed) {
|
|
3387
3558
|
if (!parsed || parsed[0] !== "oklab") return void 0;
|
|
3388
3559
|
const res = { mode: "oklab" };
|
|
@@ -3397,9 +3568,9 @@ function parseOklab(color, parsed) {
|
|
|
3397
3568
|
var parseOklab_default = parseOklab;
|
|
3398
3569
|
|
|
3399
3570
|
//#endregion
|
|
3400
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3571
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklab/definition.js
|
|
3401
3572
|
const definition$6 = {
|
|
3402
|
-
...definition_default$
|
|
3573
|
+
...definition_default$3,
|
|
3403
3574
|
mode: "oklab",
|
|
3404
3575
|
toMode: {
|
|
3405
3576
|
lrgb: convertOklabToLrgb_default,
|
|
@@ -3417,10 +3588,10 @@ const definition$6 = {
|
|
|
3417
3588
|
parse: [parseOklab_default],
|
|
3418
3589
|
serialize: (c$2) => `oklab(${c$2.l !== void 0 ? c$2.l : "none"} ${c$2.a !== void 0 ? c$2.a : "none"} ${c$2.b !== void 0 ? c$2.b : "none"}${c$2.alpha < 1 ? ` / ${c$2.alpha}` : ""})`
|
|
3419
3590
|
};
|
|
3420
|
-
var definition_default$
|
|
3591
|
+
var definition_default$7 = definition$6;
|
|
3421
3592
|
|
|
3422
3593
|
//#endregion
|
|
3423
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3594
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklch/parseOklch.js
|
|
3424
3595
|
function parseOklch(color, parsed) {
|
|
3425
3596
|
if (!parsed || parsed[0] !== "oklch") return void 0;
|
|
3426
3597
|
const res = { mode: "oklch" };
|
|
@@ -3440,9 +3611,9 @@ function parseOklch(color, parsed) {
|
|
|
3440
3611
|
var parseOklch_default = parseOklch;
|
|
3441
3612
|
|
|
3442
3613
|
//#endregion
|
|
3443
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3614
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/oklch/definition.js
|
|
3444
3615
|
const definition$5 = {
|
|
3445
|
-
...definition_default$
|
|
3616
|
+
...definition_default$5,
|
|
3446
3617
|
mode: "oklch",
|
|
3447
3618
|
toMode: {
|
|
3448
3619
|
oklab: (c$2) => convertLchToLab_default(c$2, "oklab"),
|
|
@@ -3460,17 +3631,17 @@ const definition$5 = {
|
|
|
3460
3631
|
h: [0, 360]
|
|
3461
3632
|
}
|
|
3462
3633
|
};
|
|
3463
|
-
var definition_default$
|
|
3634
|
+
var definition_default$8 = definition$5;
|
|
3464
3635
|
|
|
3465
3636
|
//#endregion
|
|
3466
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3637
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/convertP3ToXyz65.js
|
|
3467
3638
|
const convertP3ToXyz65 = (rgb$2) => {
|
|
3468
|
-
let { r: r$
|
|
3639
|
+
let { r: r$2, g, b, alpha } = convertRgbToLrgb_default(rgb$2);
|
|
3469
3640
|
let res = {
|
|
3470
3641
|
mode: "xyz65",
|
|
3471
|
-
x: .486570948648216 * r$
|
|
3472
|
-
y: .2289745640697487 * r$
|
|
3473
|
-
z: 0 * r$
|
|
3642
|
+
x: .486570948648216 * r$2 + .265667693169093 * g + .1982172852343625 * b,
|
|
3643
|
+
y: .2289745640697487 * r$2 + .6917385218365062 * g + .079286914093745 * b,
|
|
3644
|
+
z: 0 * r$2 + .0451133818589026 * g + 1.043944368900976 * b
|
|
3474
3645
|
};
|
|
3475
3646
|
if (alpha !== void 0) res.alpha = alpha;
|
|
3476
3647
|
return res;
|
|
@@ -3478,7 +3649,7 @@ const convertP3ToXyz65 = (rgb$2) => {
|
|
|
3478
3649
|
var convertP3ToXyz65_default = convertP3ToXyz65;
|
|
3479
3650
|
|
|
3480
3651
|
//#endregion
|
|
3481
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3652
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/convertXyz65ToP3.js
|
|
3482
3653
|
const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
|
|
3483
3654
|
if (x === void 0) x = 0;
|
|
3484
3655
|
if (y === void 0) y = 0;
|
|
@@ -3494,9 +3665,9 @@ const convertXyz65ToP3 = ({ x, y, z, alpha }) => {
|
|
|
3494
3665
|
var convertXyz65ToP3_default = convertXyz65ToP3;
|
|
3495
3666
|
|
|
3496
3667
|
//#endregion
|
|
3497
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3668
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/p3/definition.js
|
|
3498
3669
|
const definition$4 = {
|
|
3499
|
-
...definition_default$
|
|
3670
|
+
...definition_default$12,
|
|
3500
3671
|
mode: "p3",
|
|
3501
3672
|
parse: ["display-p3"],
|
|
3502
3673
|
serialize: "display-p3",
|
|
@@ -3509,10 +3680,10 @@ const definition$4 = {
|
|
|
3509
3680
|
xyz65: convertP3ToXyz65_default
|
|
3510
3681
|
}
|
|
3511
3682
|
};
|
|
3512
|
-
var definition_default$
|
|
3683
|
+
var definition_default$9 = definition$4;
|
|
3513
3684
|
|
|
3514
3685
|
//#endregion
|
|
3515
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3686
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/convertXyz50ToProphoto.js
|
|
3516
3687
|
const gamma$1 = (v) => {
|
|
3517
3688
|
let abs = Math.abs(v);
|
|
3518
3689
|
if (abs >= 1 / 512) return Math.sign(v) * Math.pow(abs, 1 / 1.8);
|
|
@@ -3534,21 +3705,21 @@ const convertXyz50ToProphoto = ({ x, y, z, alpha }) => {
|
|
|
3534
3705
|
var convertXyz50ToProphoto_default = convertXyz50ToProphoto;
|
|
3535
3706
|
|
|
3536
3707
|
//#endregion
|
|
3537
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3708
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/convertProphotoToXyz50.js
|
|
3538
3709
|
const linearize$1 = (v = 0) => {
|
|
3539
3710
|
let abs = Math.abs(v);
|
|
3540
3711
|
if (abs >= 16 / 512) return Math.sign(v) * Math.pow(abs, 1.8);
|
|
3541
3712
|
return v / 16;
|
|
3542
3713
|
};
|
|
3543
3714
|
const convertProphotoToXyz50 = (prophoto) => {
|
|
3544
|
-
let r$
|
|
3715
|
+
let r$2 = linearize$1(prophoto.r);
|
|
3545
3716
|
let g = linearize$1(prophoto.g);
|
|
3546
3717
|
let b = linearize$1(prophoto.b);
|
|
3547
3718
|
let res = {
|
|
3548
3719
|
mode: "xyz50",
|
|
3549
|
-
x: .7977666449006423 * r$
|
|
3550
|
-
y: .2880748288194013 * r$
|
|
3551
|
-
z: 0 * r$
|
|
3720
|
+
x: .7977666449006423 * r$2 + .1351812974005331 * g + .0313477341283922 * b,
|
|
3721
|
+
y: .2880748288194013 * r$2 + .7118352342418731 * g + 899369387256e-16 * b,
|
|
3722
|
+
z: 0 * r$2 + 0 * g + .8251046025104602 * b
|
|
3552
3723
|
};
|
|
3553
3724
|
if (prophoto.alpha !== void 0) res.alpha = prophoto.alpha;
|
|
3554
3725
|
return res;
|
|
@@ -3556,9 +3727,9 @@ const convertProphotoToXyz50 = (prophoto) => {
|
|
|
3556
3727
|
var convertProphotoToXyz50_default = convertProphotoToXyz50;
|
|
3557
3728
|
|
|
3558
3729
|
//#endregion
|
|
3559
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3730
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/prophoto/definition.js
|
|
3560
3731
|
const definition$3 = {
|
|
3561
|
-
...definition_default$
|
|
3732
|
+
...definition_default$12,
|
|
3562
3733
|
mode: "prophoto",
|
|
3563
3734
|
parse: ["prophoto-rgb"],
|
|
3564
3735
|
serialize: "prophoto-rgb",
|
|
@@ -3571,10 +3742,10 @@ const definition$3 = {
|
|
|
3571
3742
|
rgb: (color) => convertXyz50ToRgb_default(convertProphotoToXyz50_default(color))
|
|
3572
3743
|
}
|
|
3573
3744
|
};
|
|
3574
|
-
var definition_default$
|
|
3745
|
+
var definition_default$10 = definition$3;
|
|
3575
3746
|
|
|
3576
3747
|
//#endregion
|
|
3577
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3748
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/convertXyz65ToRec2020.js
|
|
3578
3749
|
const α$1 = 1.09929682680944;
|
|
3579
3750
|
const β$1 = .018053968510807;
|
|
3580
3751
|
const gamma = (v) => {
|
|
@@ -3598,7 +3769,7 @@ const convertXyz65ToRec2020 = ({ x, y, z, alpha }) => {
|
|
|
3598
3769
|
var convertXyz65ToRec2020_default = convertXyz65ToRec2020;
|
|
3599
3770
|
|
|
3600
3771
|
//#endregion
|
|
3601
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3772
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/convertRec2020ToXyz65.js
|
|
3602
3773
|
const α = 1.09929682680944;
|
|
3603
3774
|
const β = .018053968510807;
|
|
3604
3775
|
const linearize = (v = 0) => {
|
|
@@ -3607,14 +3778,14 @@ const linearize = (v = 0) => {
|
|
|
3607
3778
|
return (Math.sign(v) || 1) * Math.pow((abs + α - 1) / α, 1 / .45);
|
|
3608
3779
|
};
|
|
3609
3780
|
const convertRec2020ToXyz65 = (rec2020) => {
|
|
3610
|
-
let r$
|
|
3781
|
+
let r$2 = linearize(rec2020.r);
|
|
3611
3782
|
let g = linearize(rec2020.g);
|
|
3612
3783
|
let b = linearize(rec2020.b);
|
|
3613
3784
|
let res = {
|
|
3614
3785
|
mode: "xyz65",
|
|
3615
|
-
x: .6369580483012911 * r$
|
|
3616
|
-
y: .262700212011267 * r$
|
|
3617
|
-
z: 0 * r$
|
|
3786
|
+
x: .6369580483012911 * r$2 + .1446169035862083 * g + .1688809751641721 * b,
|
|
3787
|
+
y: .262700212011267 * r$2 + .6779980715188708 * g + .059301716469862 * b,
|
|
3788
|
+
z: 0 * r$2 + .0280726930490874 * g + 1.0609850577107909 * b
|
|
3618
3789
|
};
|
|
3619
3790
|
if (rec2020.alpha !== void 0) res.alpha = rec2020.alpha;
|
|
3620
3791
|
return res;
|
|
@@ -3622,9 +3793,9 @@ const convertRec2020ToXyz65 = (rec2020) => {
|
|
|
3622
3793
|
var convertRec2020ToXyz65_default = convertRec2020ToXyz65;
|
|
3623
3794
|
|
|
3624
3795
|
//#endregion
|
|
3625
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3796
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/rec2020/definition.js
|
|
3626
3797
|
const definition$2 = {
|
|
3627
|
-
...definition_default$
|
|
3798
|
+
...definition_default$12,
|
|
3628
3799
|
mode: "rec2020",
|
|
3629
3800
|
fromMode: {
|
|
3630
3801
|
xyz65: convertXyz65ToRec2020_default,
|
|
@@ -3637,10 +3808,10 @@ const definition$2 = {
|
|
|
3637
3808
|
parse: ["rec2020"],
|
|
3638
3809
|
serialize: "rec2020"
|
|
3639
3810
|
};
|
|
3640
|
-
var definition_default$
|
|
3811
|
+
var definition_default$11 = definition$2;
|
|
3641
3812
|
|
|
3642
3813
|
//#endregion
|
|
3643
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3814
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz50/definition.js
|
|
3644
3815
|
const definition$1 = {
|
|
3645
3816
|
mode: "xyz50",
|
|
3646
3817
|
parse: ["xyz-d50"],
|
|
@@ -3674,10 +3845,10 @@ const definition$1 = {
|
|
|
3674
3845
|
}
|
|
3675
3846
|
}
|
|
3676
3847
|
};
|
|
3677
|
-
var definition_default$
|
|
3848
|
+
var definition_default$13 = definition$1;
|
|
3678
3849
|
|
|
3679
3850
|
//#endregion
|
|
3680
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3851
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz65ToXyz50.js
|
|
3681
3852
|
const convertXyz65ToXyz50 = (xyz65) => {
|
|
3682
3853
|
let { x, y, z, alpha } = xyz65;
|
|
3683
3854
|
if (x === void 0) x = 0;
|
|
@@ -3695,7 +3866,7 @@ const convertXyz65ToXyz50 = (xyz65) => {
|
|
|
3695
3866
|
var convertXyz65ToXyz50_default = convertXyz65ToXyz50;
|
|
3696
3867
|
|
|
3697
3868
|
//#endregion
|
|
3698
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3869
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/convertXyz50ToXyz65.js
|
|
3699
3870
|
const convertXyz50ToXyz65 = (xyz50) => {
|
|
3700
3871
|
let { x, y, z, alpha } = xyz50;
|
|
3701
3872
|
if (x === void 0) x = 0;
|
|
@@ -3713,7 +3884,7 @@ const convertXyz50ToXyz65 = (xyz50) => {
|
|
|
3713
3884
|
var convertXyz50ToXyz65_default = convertXyz50ToXyz65;
|
|
3714
3885
|
|
|
3715
3886
|
//#endregion
|
|
3716
|
-
//#region ../../node_modules/.pnpm/culori@4.0.
|
|
3887
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/xyz65/definition.js
|
|
3717
3888
|
const definition = {
|
|
3718
3889
|
mode: "xyz65",
|
|
3719
3890
|
toMode: {
|
|
@@ -3747,7 +3918,190 @@ const definition = {
|
|
|
3747
3918
|
}
|
|
3748
3919
|
}
|
|
3749
3920
|
};
|
|
3750
|
-
var definition_default$
|
|
3921
|
+
var definition_default$14 = definition;
|
|
3922
|
+
|
|
3923
|
+
//#endregion
|
|
3924
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsl/helpers.js
|
|
3925
|
+
function toe(x) {
|
|
3926
|
+
const k_1 = .206;
|
|
3927
|
+
const k_2 = .03;
|
|
3928
|
+
const k_3 = (1 + k_1) / (1 + k_2);
|
|
3929
|
+
return .5 * (k_3 * x - k_1 + Math.sqrt((k_3 * x - k_1) * (k_3 * x - k_1) + 4 * k_2 * k_3 * x));
|
|
3930
|
+
}
|
|
3931
|
+
function toe_inv(x) {
|
|
3932
|
+
const k_1 = .206;
|
|
3933
|
+
const k_2 = .03;
|
|
3934
|
+
const k_3 = (1 + k_1) / (1 + k_2);
|
|
3935
|
+
return (x * x + k_1 * x) / (k_3 * (x + k_2));
|
|
3936
|
+
}
|
|
3937
|
+
function compute_max_saturation(a, b) {
|
|
3938
|
+
let k0, k1, k2, k3, k4, wl, wm, ws;
|
|
3939
|
+
if (-1.88170328 * a - .80936493 * b > 1) {
|
|
3940
|
+
k0 = 1.19086277;
|
|
3941
|
+
k1 = 1.76576728;
|
|
3942
|
+
k2 = .59662641;
|
|
3943
|
+
k3 = .75515197;
|
|
3944
|
+
k4 = .56771245;
|
|
3945
|
+
wl = 4.0767416621;
|
|
3946
|
+
wm = -3.3077115913;
|
|
3947
|
+
ws = .2309699292;
|
|
3948
|
+
} else if (1.81444104 * a - 1.19445276 * b > 1) {
|
|
3949
|
+
k0 = .73956515;
|
|
3950
|
+
k1 = -.45954404;
|
|
3951
|
+
k2 = .08285427;
|
|
3952
|
+
k3 = .1254107;
|
|
3953
|
+
k4 = .14503204;
|
|
3954
|
+
wl = -1.2684380046;
|
|
3955
|
+
wm = 2.6097574011;
|
|
3956
|
+
ws = -.3413193965;
|
|
3957
|
+
} else {
|
|
3958
|
+
k0 = 1.35733652;
|
|
3959
|
+
k1 = -.00915799;
|
|
3960
|
+
k2 = -1.1513021;
|
|
3961
|
+
k3 = -.50559606;
|
|
3962
|
+
k4 = .00692167;
|
|
3963
|
+
wl = -.0041960863;
|
|
3964
|
+
wm = -.7034186147;
|
|
3965
|
+
ws = 1.707614701;
|
|
3966
|
+
}
|
|
3967
|
+
let S = k0 + k1 * a + k2 * b + k3 * a * a + k4 * a * b;
|
|
3968
|
+
let k_l = .3963377774 * a + .2158037573 * b;
|
|
3969
|
+
let k_m = -.1055613458 * a - .0638541728 * b;
|
|
3970
|
+
let k_s = -.0894841775 * a - 1.291485548 * b;
|
|
3971
|
+
{
|
|
3972
|
+
let l_ = 1 + S * k_l;
|
|
3973
|
+
let m_ = 1 + S * k_m;
|
|
3974
|
+
let s_ = 1 + S * k_s;
|
|
3975
|
+
let l = l_ * l_ * l_;
|
|
3976
|
+
let m = m_ * m_ * m_;
|
|
3977
|
+
let s = s_ * s_ * s_;
|
|
3978
|
+
let l_dS = 3 * k_l * l_ * l_;
|
|
3979
|
+
let m_dS = 3 * k_m * m_ * m_;
|
|
3980
|
+
let s_dS = 3 * k_s * s_ * s_;
|
|
3981
|
+
let l_dS2 = 6 * k_l * k_l * l_;
|
|
3982
|
+
let m_dS2 = 6 * k_m * k_m * m_;
|
|
3983
|
+
let s_dS2 = 6 * k_s * k_s * s_;
|
|
3984
|
+
let f$3 = wl * l + wm * m + ws * s;
|
|
3985
|
+
let f1 = wl * l_dS + wm * m_dS + ws * s_dS;
|
|
3986
|
+
let f2 = wl * l_dS2 + wm * m_dS2 + ws * s_dS2;
|
|
3987
|
+
S = S - f$3 * f1 / (f1 * f1 - .5 * f$3 * f2);
|
|
3988
|
+
}
|
|
3989
|
+
return S;
|
|
3990
|
+
}
|
|
3991
|
+
function find_cusp(a, b) {
|
|
3992
|
+
let S_cusp = compute_max_saturation(a, b);
|
|
3993
|
+
let rgb$2 = convertOklabToLrgb_default({
|
|
3994
|
+
l: 1,
|
|
3995
|
+
a: S_cusp * a,
|
|
3996
|
+
b: S_cusp * b
|
|
3997
|
+
});
|
|
3998
|
+
let L_cusp = Math.cbrt(1 / Math.max(rgb$2.r, rgb$2.g, rgb$2.b));
|
|
3999
|
+
let C_cusp = L_cusp * S_cusp;
|
|
4000
|
+
return [L_cusp, C_cusp];
|
|
4001
|
+
}
|
|
4002
|
+
function get_ST_max(a_, b_, cusp = null) {
|
|
4003
|
+
if (!cusp) cusp = find_cusp(a_, b_);
|
|
4004
|
+
let L = cusp[0];
|
|
4005
|
+
let C = cusp[1];
|
|
4006
|
+
return [C / L, C / (1 - L)];
|
|
4007
|
+
}
|
|
4008
|
+
|
|
4009
|
+
//#endregion
|
|
4010
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/convertOklabToOkhsv.js
|
|
4011
|
+
function convertOklabToOkhsv(lab) {
|
|
4012
|
+
let l = lab.l !== void 0 ? lab.l : 0;
|
|
4013
|
+
let a = lab.a !== void 0 ? lab.a : 0;
|
|
4014
|
+
let b = lab.b !== void 0 ? lab.b : 0;
|
|
4015
|
+
let c$2 = Math.sqrt(a * a + b * b);
|
|
4016
|
+
let a_ = c$2 ? a / c$2 : 1;
|
|
4017
|
+
let b_ = c$2 ? b / c$2 : 1;
|
|
4018
|
+
let [S_max, T] = get_ST_max(a_, b_);
|
|
4019
|
+
let S_0 = .5;
|
|
4020
|
+
let k$4 = 1 - S_0 / S_max;
|
|
4021
|
+
let t = T / (c$2 + l * T);
|
|
4022
|
+
let L_v = t * l;
|
|
4023
|
+
let C_v = t * c$2;
|
|
4024
|
+
let L_vt = toe_inv(L_v);
|
|
4025
|
+
let C_vt = C_v * L_vt / L_v;
|
|
4026
|
+
let rgb_scale = convertOklabToLrgb_default({
|
|
4027
|
+
l: L_vt,
|
|
4028
|
+
a: a_ * C_vt,
|
|
4029
|
+
b: b_ * C_vt
|
|
4030
|
+
});
|
|
4031
|
+
let scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
|
|
4032
|
+
l = l / scale_L;
|
|
4033
|
+
c$2 = c$2 / scale_L * toe(l) / l;
|
|
4034
|
+
l = toe(l);
|
|
4035
|
+
const ret = {
|
|
4036
|
+
mode: "okhsv",
|
|
4037
|
+
s: c$2 ? (S_0 + T) * C_v / (T * S_0 + T * k$4 * C_v) : 0,
|
|
4038
|
+
v: l ? l / L_v : 0
|
|
4039
|
+
};
|
|
4040
|
+
if (ret.s) ret.h = normalizeHue_default(Math.atan2(b, a) * 180 / Math.PI);
|
|
4041
|
+
if (lab.alpha !== void 0) ret.alpha = lab.alpha;
|
|
4042
|
+
return ret;
|
|
4043
|
+
}
|
|
4044
|
+
|
|
4045
|
+
//#endregion
|
|
4046
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/convertOkhsvToOklab.js
|
|
4047
|
+
function convertOkhsvToOklab(hsv) {
|
|
4048
|
+
const ret = { mode: "oklab" };
|
|
4049
|
+
if (hsv.alpha !== void 0) ret.alpha = hsv.alpha;
|
|
4050
|
+
const h = hsv.h !== void 0 ? hsv.h : 0;
|
|
4051
|
+
const s = hsv.s !== void 0 ? hsv.s : 0;
|
|
4052
|
+
const v = hsv.v !== void 0 ? hsv.v : 0;
|
|
4053
|
+
const a_ = Math.cos(h / 180 * Math.PI);
|
|
4054
|
+
const b_ = Math.sin(h / 180 * Math.PI);
|
|
4055
|
+
const [S_max, T] = get_ST_max(a_, b_);
|
|
4056
|
+
const S_0 = .5;
|
|
4057
|
+
const k$4 = 1 - S_0 / S_max;
|
|
4058
|
+
const L_v = 1 - s * S_0 / (S_0 + T - T * k$4 * s);
|
|
4059
|
+
const C_v = s * T * S_0 / (S_0 + T - T * k$4 * s);
|
|
4060
|
+
const L_vt = toe_inv(L_v);
|
|
4061
|
+
const C_vt = C_v * L_vt / L_v;
|
|
4062
|
+
const rgb_scale = convertOklabToLrgb_default({
|
|
4063
|
+
l: L_vt,
|
|
4064
|
+
a: a_ * C_vt,
|
|
4065
|
+
b: b_ * C_vt
|
|
4066
|
+
});
|
|
4067
|
+
const scale_L = Math.cbrt(1 / Math.max(rgb_scale.r, rgb_scale.g, rgb_scale.b, 0));
|
|
4068
|
+
const L_new = toe_inv(v * L_v);
|
|
4069
|
+
const C = C_v * L_new / L_v;
|
|
4070
|
+
ret.l = L_new * scale_L;
|
|
4071
|
+
ret.a = C * a_ * scale_L;
|
|
4072
|
+
ret.b = C * b_ * scale_L;
|
|
4073
|
+
return ret;
|
|
4074
|
+
}
|
|
4075
|
+
|
|
4076
|
+
//#endregion
|
|
4077
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/okhsv/modeOkhsv.js
|
|
4078
|
+
const modeOkhsv = {
|
|
4079
|
+
...definition_default$15,
|
|
4080
|
+
mode: "okhsv",
|
|
4081
|
+
channels: [
|
|
4082
|
+
"h",
|
|
4083
|
+
"s",
|
|
4084
|
+
"v",
|
|
4085
|
+
"alpha"
|
|
4086
|
+
],
|
|
4087
|
+
parse: ["--okhsv"],
|
|
4088
|
+
serialize: "--okhsv",
|
|
4089
|
+
fromMode: {
|
|
4090
|
+
oklab: convertOklabToOkhsv,
|
|
4091
|
+
rgb: (c$2) => convertOklabToOkhsv(convertRgbToOklab_default(c$2))
|
|
4092
|
+
},
|
|
4093
|
+
toMode: {
|
|
4094
|
+
oklab: convertOkhsvToOklab,
|
|
4095
|
+
rgb: (c$2) => convertOklabToRgb_default(convertOkhsvToOklab(c$2))
|
|
4096
|
+
}
|
|
4097
|
+
};
|
|
4098
|
+
var modeOkhsv_default = modeOkhsv;
|
|
4099
|
+
|
|
4100
|
+
//#endregion
|
|
4101
|
+
//#region ../../node_modules/.pnpm/culori@4.0.2/node_modules/culori/src/round.js
|
|
4102
|
+
const r = (value, precision) => Math.round(value * (precision = Math.pow(10, precision))) / precision;
|
|
4103
|
+
const round = (precision = 4) => (value) => typeof value === "number" ? r(value, precision) : value;
|
|
4104
|
+
var round_default = round;
|
|
3751
4105
|
|
|
3752
4106
|
//#endregion
|
|
3753
4107
|
//#region ../token-tools/dist/css.js
|
|
@@ -3766,20 +4120,26 @@ function makeCSSVar(name, { prefix, wrapVar = false } = {}) {
|
|
|
3766
4120
|
const converters = {
|
|
3767
4121
|
a98: useMode(definition_default),
|
|
3768
4122
|
hsl: useMode(definition_default$1),
|
|
3769
|
-
|
|
3770
|
-
|
|
3771
|
-
|
|
3772
|
-
|
|
3773
|
-
|
|
3774
|
-
|
|
3775
|
-
|
|
3776
|
-
|
|
3777
|
-
p3: useMode(definition_default$
|
|
3778
|
-
prophoto: useMode(definition_default$
|
|
3779
|
-
rec2020: useMode(definition_default$
|
|
3780
|
-
rgb: useMode(definition_default$
|
|
3781
|
-
xyz50: useMode(definition_default$
|
|
3782
|
-
xyz65: useMode(definition_default$
|
|
4123
|
+
hwb: useMode(definition_default$2),
|
|
4124
|
+
lab: useMode(definition_default$3),
|
|
4125
|
+
lab65: useMode(definition_default$4),
|
|
4126
|
+
lch: useMode(definition_default$5),
|
|
4127
|
+
lrgb: useMode(definition_default$6),
|
|
4128
|
+
oklab: useMode(definition_default$7),
|
|
4129
|
+
oklch: useMode(definition_default$8),
|
|
4130
|
+
okhsv: useMode(modeOkhsv_default),
|
|
4131
|
+
p3: useMode(definition_default$9),
|
|
4132
|
+
prophoto: useMode(definition_default$10),
|
|
4133
|
+
rec2020: useMode(definition_default$11),
|
|
4134
|
+
rgb: useMode(definition_default$12),
|
|
4135
|
+
xyz50: useMode(definition_default$13),
|
|
4136
|
+
xyz65: useMode(definition_default$14)
|
|
4137
|
+
};
|
|
4138
|
+
const DEPTH_ROUNDING = {
|
|
4139
|
+
24: round_default(4),
|
|
4140
|
+
30: round_default(4),
|
|
4141
|
+
36: round_default(5),
|
|
4142
|
+
48: round_default(6)
|
|
3783
4143
|
};
|
|
3784
4144
|
|
|
3785
4145
|
//#endregion
|