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