@pixerate/editor 0.236.0 → 0.238.0
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/README.md +1 -1
- package/dist/agent/index.cjs +40 -39
- package/dist/agent/index.js +9 -8
- package/dist/animation/index.cjs +7 -6
- package/dist/animation/index.js +6 -5
- package/dist/animation-editor/index.cjs +66 -65
- package/dist/animation-editor/index.js +9 -8
- package/dist/{brushstrokeRender-WDTKD54B.cjs → brushstrokeRender-MPOM7BFW.cjs} +7 -5
- package/dist/{brushstrokeRender-MAHOXL7K.js → brushstrokeRender-WB67GMUP.js} +4 -2
- package/dist/canvas/index.cjs +55 -54
- package/dist/canvas/index.js +10 -9
- package/dist/chart/index.cjs +159 -158
- package/dist/chart/index.js +9 -8
- package/dist/{chunk-L6Y7TSQ4.js → chunk-36ZTV7WO.js} +1 -1
- package/dist/{chunk-JVNGCS26.js → chunk-3E36VDMJ.js} +1 -1
- package/dist/{chunk-WRZ6C4TU.cjs → chunk-3R5P3DVY.cjs} +6 -6
- package/dist/{chunk-RUONPPMC.cjs → chunk-44BMJJVA.cjs} +8 -8
- package/dist/{chunk-YBAPT7NL.js → chunk-6ADHGQ73.js} +4 -2
- package/dist/chunk-7AHBW2CQ.cjs +200 -0
- package/dist/{chunk-EUIDTZNQ.cjs → chunk-7PT4RJL5.cjs} +113 -111
- package/dist/{chunk-CU6ANS5L.js → chunk-7YGBSFC6.js} +2 -2
- package/dist/{chunk-ATKKG76G.cjs → chunk-AD7GA3TL.cjs} +23 -23
- package/dist/{chunk-FSLKBQU7.js → chunk-AIS56JOO.js} +3 -3
- package/dist/{chunk-5VQXSS2S.cjs → chunk-BBUE3UJL.cjs} +86 -86
- package/dist/{chunk-7272D3K2.js → chunk-BP6KSGVD.js} +6 -4
- package/dist/{chunk-F6R67I3A.js → chunk-CXXXAZ7H.js} +1 -1
- package/dist/{chunk-5DQPDXOM.cjs → chunk-D2SGV525.cjs} +76 -76
- package/dist/chunk-F67XMVDI.js +200 -0
- package/dist/{chunk-PHYOZK3B.js → chunk-FQVVO5YA.js} +85 -8
- package/dist/{chunk-UXETV2NC.cjs → chunk-GA4EU4P3.cjs} +4 -4
- package/dist/{chunk-UFEDHACQ.js → chunk-GXAK6Q5J.js} +2 -2
- package/dist/{chunk-MHLU6GRJ.js → chunk-JEGJP4OW.js} +7 -196
- package/dist/{chunk-GOBOCZZI.js → chunk-LEQKZGQI.js} +1 -1
- package/dist/{chunk-M5GLQQWG.cjs → chunk-LJZRHVZV.cjs} +2 -2
- package/dist/{chunk-N76AMOKE.cjs → chunk-MOW3JMNG.cjs} +42 -42
- package/dist/{chunk-WKMUBATU.js → chunk-N4DFDI73.js} +1 -1
- package/dist/{chunk-GNZI3KYK.cjs → chunk-NKTNLJUJ.cjs} +49 -9
- package/dist/{chunk-TQOL6CF7.js → chunk-PJYG6FCF.js} +49 -9
- package/dist/{chunk-V3L7U63N.cjs → chunk-PP6BXVRL.cjs} +1 -1
- package/dist/{chunk-TFF2GTGN.cjs → chunk-PPFJHTW5.cjs} +24 -22
- package/dist/{chunk-6ZZKRH7R.js → chunk-QARCM66V.js} +3 -3
- package/dist/{chunk-5UEFBM2M.cjs → chunk-RD7RX52G.cjs} +18 -207
- package/dist/{chunk-CDP2AKMA.js → chunk-RV5DKZHU.js} +1 -1
- package/dist/{chunk-HUAISCUX.cjs → chunk-T7KQEMAE.cjs} +18 -18
- package/dist/{chunk-BQE3Y6ZO.cjs → chunk-THXFU3JB.cjs} +5 -5
- package/dist/{chunk-4ZC5QJE2.cjs → chunk-UTI5IITZ.cjs} +3 -3
- package/dist/{chunk-XSVUNSDJ.js → chunk-UUBO6RB5.js} +1 -1
- package/dist/{chunk-WPWHT4Z6.cjs → chunk-UZU6DIZA.cjs} +221 -144
- package/dist/{chunk-M2TPMYJE.js → chunk-V6DT2CDH.js} +1 -1
- package/dist/{chunk-WV5WTOC6.cjs → chunk-W7GRGGBH.cjs} +16 -16
- package/dist/{chunk-23E5GI2U.js → chunk-WGN7AUKB.js} +2 -2
- package/dist/{chunk-YMREOA67.js → chunk-XK4SST43.js} +2 -2
- package/dist/{chunk-SOSBOS5T.cjs → chunk-XWOLPNBW.cjs} +22 -22
- package/dist/{chunk-ILP77UD6.js → chunk-YGQVCQTG.js} +1 -1
- package/dist/{chunk-GXLZZVR5.cjs → chunk-ZXNO3ZOX.cjs} +37 -37
- package/dist/color/index.cjs +6 -4
- package/dist/color/index.js +9 -7
- package/dist/export/index.cjs +8 -7
- package/dist/export/index.js +7 -6
- package/dist/extensions/index.cjs +13 -10
- package/dist/extensions/index.js +12 -9
- package/dist/extensions/loading-node.d.cts +45 -1
- package/dist/extensions/loading-node.d.ts +45 -1
- package/dist/gradient/index.cjs +29 -28
- package/dist/gradient/index.js +4 -3
- package/dist/image-editor/index.cjs +778 -777
- package/dist/image-editor/index.js +9 -8
- package/dist/index.cjs +19 -16
- package/dist/index.js +13 -10
- package/dist/paint-editor/controller.d.cts +31 -1
- package/dist/paint-editor/controller.d.ts +31 -1
- package/dist/paint-editor/index.cjs +403 -195
- package/dist/paint-editor/index.js +231 -23
- package/dist/paint-editor/sticker-tools.d.cts +1 -1
- package/dist/paint-editor/sticker-tools.d.ts +1 -1
- package/dist/paint-editor/stickers.d.cts +10 -3
- package/dist/paint-editor/stickers.d.ts +10 -3
- package/dist/paint-editor/ui.d.cts +10 -3
- package/dist/paint-editor/ui.d.ts +10 -3
- package/dist/tokens/index.cjs +4 -3
- package/dist/tokens/index.js +3 -2
- package/dist/typography/index.cjs +8 -7
- package/dist/typography/index.js +3 -2
- package/dist/vector/index.cjs +967 -966
- package/dist/vector/index.js +9 -8
- package/dist/video-editor/index.cjs +7 -6
- package/dist/video-editor/index.js +6 -5
- package/package.json +1 -1
- package/skills/pixerate-color/SKILL.md +3 -0
- package/skills/pixerate-image-editor/SKILL.md +1 -0
- package/skills/pixerate-paint-editor/SKILL.md +6 -2
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
|
|
5
|
+
var _chunkRD7RX52Gcjs = require('./chunk-RD7RX52G.cjs');
|
|
5
6
|
|
|
6
7
|
|
|
7
8
|
|
|
@@ -10,7 +11,8 @@
|
|
|
10
11
|
|
|
11
12
|
|
|
12
13
|
|
|
13
|
-
|
|
14
|
+
|
|
15
|
+
var _chunk7AHBW2CQcjs = require('./chunk-7AHBW2CQ.cjs');
|
|
14
16
|
|
|
15
17
|
// src/color/gamut.ts
|
|
16
18
|
var clamp01 = (v) => Math.min(1, Math.max(0, v));
|
|
@@ -18,12 +20,12 @@ function inSrgbGamut(c, epsilon = 1e-5) {
|
|
|
18
20
|
return c.r >= -epsilon && c.r <= 1 + epsilon && c.g >= -epsilon && c.g <= 1 + epsilon && c.b >= -epsilon && c.b <= 1 + epsilon;
|
|
19
21
|
}
|
|
20
22
|
function deltaEOK(a, b) {
|
|
21
|
-
const la =
|
|
22
|
-
const lb =
|
|
23
|
+
const la = _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, a);
|
|
24
|
+
const lb = _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, b);
|
|
23
25
|
return Math.hypot(la.l - lb.l, la.a - lb.a, la.b - lb.b);
|
|
24
26
|
}
|
|
25
27
|
function toSrgbGamut(c) {
|
|
26
|
-
const lch =
|
|
28
|
+
const lch = _chunk7AHBW2CQcjs.oklabToOklch.call(void 0, _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, c));
|
|
27
29
|
if (lch.l >= 1) return { r: 1, g: 1, b: 1, a: c.a };
|
|
28
30
|
if (lch.l <= 0) return { r: 0, g: 0, b: 0, a: c.a };
|
|
29
31
|
if (inSrgbGamut(c)) {
|
|
@@ -36,7 +38,7 @@ function toSrgbGamut(c) {
|
|
|
36
38
|
const EPS = 1e-4;
|
|
37
39
|
for (let i = 0; i < 30; i++) {
|
|
38
40
|
const mid = (low + high) / 2;
|
|
39
|
-
const candidate =
|
|
41
|
+
const candidate = _chunk7AHBW2CQcjs.oklabToRgb.call(void 0, _chunk7AHBW2CQcjs.oklchToOklab.call(void 0, { l: lch.l, c: mid, h: lch.h, alpha: c.a }));
|
|
40
42
|
const clipped = {
|
|
41
43
|
r: clamp01(candidate.r),
|
|
42
44
|
g: clamp01(candidate.g),
|
|
@@ -83,21 +85,21 @@ function formatColor(c, format) {
|
|
|
83
85
|
return c.a < 1 ? `rgb(${r} ${g} ${b} / ${round2(c.a)})` : `rgb(${r} ${g} ${b})`;
|
|
84
86
|
}
|
|
85
87
|
case "hsl": {
|
|
86
|
-
const hsl =
|
|
88
|
+
const hsl = _chunk7AHBW2CQcjs.rgbToHsl.call(void 0, toSrgbGamut(c));
|
|
87
89
|
const h = (Math.round(hsl.h * 100) / 100).toString();
|
|
88
90
|
const s = (Math.round(hsl.s * 1e4) / 100).toString();
|
|
89
91
|
const l = (Math.round(hsl.l * 1e4) / 100).toString();
|
|
90
92
|
return c.a < 1 ? `hsl(${h} ${s}% ${l}% / ${round2(c.a)})` : `hsl(${h} ${s}% ${l}%)`;
|
|
91
93
|
}
|
|
92
94
|
case "oklch": {
|
|
93
|
-
const lch =
|
|
95
|
+
const lch = _chunk7AHBW2CQcjs.oklabToOklch.call(void 0, _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, c));
|
|
94
96
|
const l = (lch.l * 100).toFixed(2);
|
|
95
97
|
const ch = lch.c.toFixed(4);
|
|
96
98
|
const h = lch.h.toFixed(2);
|
|
97
99
|
return c.a < 1 ? `oklch(${l}% ${ch} ${h} / ${round2(c.a)})` : `oklch(${l}% ${ch} ${h})`;
|
|
98
100
|
}
|
|
99
101
|
case "oklab": {
|
|
100
|
-
const lab =
|
|
102
|
+
const lab = _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, c);
|
|
101
103
|
const l = (lab.l * 100).toFixed(2);
|
|
102
104
|
const a = lab.a.toFixed(4);
|
|
103
105
|
const b = lab.b.toFixed(4);
|
|
@@ -105,36 +107,36 @@ function formatColor(c, format) {
|
|
|
105
107
|
}
|
|
106
108
|
case "p3": {
|
|
107
109
|
const linSrgb = {
|
|
108
|
-
r:
|
|
109
|
-
g:
|
|
110
|
-
b:
|
|
110
|
+
r: _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.r),
|
|
111
|
+
g: _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.g),
|
|
112
|
+
b: _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.b),
|
|
111
113
|
a: c.a
|
|
112
114
|
};
|
|
113
|
-
const linP3 =
|
|
114
|
-
const r =
|
|
115
|
-
const g =
|
|
116
|
-
const b =
|
|
115
|
+
const linP3 = _chunk7AHBW2CQcjs.linearSrgbToDisplayP3.call(void 0, linSrgb);
|
|
116
|
+
const r = _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linP3.r).toFixed(4);
|
|
117
|
+
const g = _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linP3.g).toFixed(4);
|
|
118
|
+
const b = _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linP3.b).toFixed(4);
|
|
117
119
|
return c.a < 1 ? `color(display-p3 ${r} ${g} ${b} / ${round2(c.a)})` : `color(display-p3 ${r} ${g} ${b})`;
|
|
118
120
|
}
|
|
119
121
|
}
|
|
120
122
|
}
|
|
121
123
|
function normalizeColor(input) {
|
|
122
|
-
const parsed =
|
|
124
|
+
const parsed = _chunkRD7RX52Gcjs.parseColor.call(void 0, input);
|
|
123
125
|
return parsed ? formatHex(parsed) : null;
|
|
124
126
|
}
|
|
125
127
|
|
|
126
128
|
// src/color/suggest.ts
|
|
127
129
|
function suggestAccessibleForeground(foreground, background, options = {}) {
|
|
128
130
|
const large = _nullishCoalesce(options.large, () => ( false));
|
|
129
|
-
const lch =
|
|
130
|
-
const asHex = (l) =>
|
|
131
|
+
const lch = _chunk7AHBW2CQcjs.oklabToOklch.call(void 0, _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, foreground));
|
|
132
|
+
const asHex = (l) => _chunkRD7RX52Gcjs.parseColor.call(void 0, formatHex(toSrgbGamut(_chunk7AHBW2CQcjs.oklabToRgb.call(void 0, _chunk7AHBW2CQcjs.oklchToOklab.call(void 0, { ...lch, l })))));
|
|
131
133
|
for (let d = 0.01; d <= 1; d += 0.01) {
|
|
132
134
|
const downCand = asHex(Math.max(0, lch.l - d));
|
|
133
135
|
const upCand = asHex(Math.min(1, lch.l + d));
|
|
134
|
-
const downRatio =
|
|
135
|
-
const upRatio =
|
|
136
|
-
const downPass =
|
|
137
|
-
const upPass =
|
|
136
|
+
const downRatio = _chunkRD7RX52Gcjs.contrastRatio.call(void 0, downCand, background);
|
|
137
|
+
const upRatio = _chunkRD7RX52Gcjs.contrastRatio.call(void 0, upCand, background);
|
|
138
|
+
const downPass = _chunkRD7RX52Gcjs.contrastLevel.call(void 0, downRatio, { large }) !== "fail";
|
|
139
|
+
const upPass = _chunkRD7RX52Gcjs.contrastLevel.call(void 0, upRatio, { large }) !== "fail";
|
|
138
140
|
if (downPass && upPass) return formatHex(downRatio >= upRatio ? downCand : upCand);
|
|
139
141
|
if (downPass) return formatHex(downCand);
|
|
140
142
|
if (upPass) return formatHex(upCand);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
simulateColorVision
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BP6KSGVD.js";
|
|
4
4
|
import {
|
|
5
5
|
deltaEOK
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6ADHGQ73.js";
|
|
7
7
|
import {
|
|
8
8
|
rgbToOklab
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-F67XMVDI.js";
|
|
10
10
|
|
|
11
11
|
// src/chart/color.ts
|
|
12
12
|
var NAMED = {
|
|
@@ -5,184 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
// src/color/convert.ts
|
|
11
|
-
function srgbToLinear(v) {
|
|
12
|
-
const sign = Math.sign(v);
|
|
13
|
-
const abs = Math.abs(v);
|
|
14
|
-
return sign * (abs <= 0.04045 ? abs / 12.92 : ((abs + 0.055) / 1.055) ** 2.4);
|
|
15
|
-
}
|
|
16
|
-
function linearToSrgb(v) {
|
|
17
|
-
const sign = Math.sign(v);
|
|
18
|
-
const abs = Math.abs(v);
|
|
19
|
-
return sign * (abs <= 31308e-7 ? 12.92 * abs : 1.055 * abs ** (1 / 2.4) - 0.055);
|
|
20
|
-
}
|
|
21
|
-
function rgbToHsl(rgba) {
|
|
22
|
-
const { r, g, b, a } = rgba;
|
|
23
|
-
const max = Math.max(r, g, b);
|
|
24
|
-
const min = Math.min(r, g, b);
|
|
25
|
-
const d = max - min;
|
|
26
|
-
const l = (max + min) / 2;
|
|
27
|
-
let h = 0;
|
|
28
|
-
if (d > 0) {
|
|
29
|
-
if (max === r) h = 60 * ((g - b) / d % 6);
|
|
30
|
-
else if (max === g) h = 60 * ((b - r) / d + 2);
|
|
31
|
-
else h = 60 * ((r - g) / d + 4);
|
|
32
|
-
}
|
|
33
|
-
if (h < 0) h += 360;
|
|
34
|
-
const s = d === 0 ? 0 : d / (1 - Math.abs(2 * l - 1));
|
|
35
|
-
return { h, s, l, alpha: a };
|
|
36
|
-
}
|
|
37
|
-
function hslToRgb(hsla) {
|
|
38
|
-
const { h, s, l, alpha } = hsla;
|
|
39
|
-
const hh = (h % 360 + 360) % 360 / 60;
|
|
40
|
-
const c = (1 - Math.abs(2 * l - 1)) * s;
|
|
41
|
-
const x = c * (1 - Math.abs(hh % 2 - 1));
|
|
42
|
-
const m = l - c / 2;
|
|
43
|
-
let r = 0;
|
|
44
|
-
let g = 0;
|
|
45
|
-
let b = 0;
|
|
46
|
-
if (hh < 1) {
|
|
47
|
-
r = c;
|
|
48
|
-
g = x;
|
|
49
|
-
b = 0;
|
|
50
|
-
} else if (hh < 2) {
|
|
51
|
-
r = x;
|
|
52
|
-
g = c;
|
|
53
|
-
b = 0;
|
|
54
|
-
} else if (hh < 3) {
|
|
55
|
-
r = 0;
|
|
56
|
-
g = c;
|
|
57
|
-
b = x;
|
|
58
|
-
} else if (hh < 4) {
|
|
59
|
-
r = 0;
|
|
60
|
-
g = x;
|
|
61
|
-
b = c;
|
|
62
|
-
} else if (hh < 5) {
|
|
63
|
-
r = x;
|
|
64
|
-
g = 0;
|
|
65
|
-
b = c;
|
|
66
|
-
} else {
|
|
67
|
-
r = c;
|
|
68
|
-
g = 0;
|
|
69
|
-
b = x;
|
|
70
|
-
}
|
|
71
|
-
return { r: r + m, g: g + m, b: b + m, a: alpha };
|
|
72
|
-
}
|
|
73
|
-
function rgbToHsv(rgba) {
|
|
74
|
-
const { r, g, b, a } = rgba;
|
|
75
|
-
const max = Math.max(r, g, b);
|
|
76
|
-
const min = Math.min(r, g, b);
|
|
77
|
-
const d = max - min;
|
|
78
|
-
let h = 0;
|
|
79
|
-
if (d > 0) {
|
|
80
|
-
if (max === r) h = 60 * ((g - b) / d % 6);
|
|
81
|
-
else if (max === g) h = 60 * ((b - r) / d + 2);
|
|
82
|
-
else h = 60 * ((r - g) / d + 4);
|
|
83
|
-
}
|
|
84
|
-
if (h < 0) h += 360;
|
|
85
|
-
const s = max === 0 ? 0 : d / max;
|
|
86
|
-
return { h, s, v: max, alpha: a };
|
|
87
|
-
}
|
|
88
|
-
function hsvToRgb(hsva) {
|
|
89
|
-
const { h, s, v, alpha } = hsva;
|
|
90
|
-
const hh = (h % 360 + 360) % 360 / 60;
|
|
91
|
-
const c = v * s;
|
|
92
|
-
const x = c * (1 - Math.abs(hh % 2 - 1));
|
|
93
|
-
const m = v - c;
|
|
94
|
-
let r = 0;
|
|
95
|
-
let g = 0;
|
|
96
|
-
let b = 0;
|
|
97
|
-
if (hh < 1) {
|
|
98
|
-
r = c;
|
|
99
|
-
g = x;
|
|
100
|
-
b = 0;
|
|
101
|
-
} else if (hh < 2) {
|
|
102
|
-
r = x;
|
|
103
|
-
g = c;
|
|
104
|
-
b = 0;
|
|
105
|
-
} else if (hh < 3) {
|
|
106
|
-
r = 0;
|
|
107
|
-
g = c;
|
|
108
|
-
b = x;
|
|
109
|
-
} else if (hh < 4) {
|
|
110
|
-
r = 0;
|
|
111
|
-
g = x;
|
|
112
|
-
b = c;
|
|
113
|
-
} else if (hh < 5) {
|
|
114
|
-
r = x;
|
|
115
|
-
g = 0;
|
|
116
|
-
b = c;
|
|
117
|
-
} else {
|
|
118
|
-
r = c;
|
|
119
|
-
g = 0;
|
|
120
|
-
b = x;
|
|
121
|
-
}
|
|
122
|
-
return { r: r + m, g: g + m, b: b + m, a: alpha };
|
|
123
|
-
}
|
|
124
|
-
function rgbToOklab(rgba) {
|
|
125
|
-
const lr = srgbToLinear(rgba.r);
|
|
126
|
-
const lg = srgbToLinear(rgba.g);
|
|
127
|
-
const lb = srgbToLinear(rgba.b);
|
|
128
|
-
const l = Math.cbrt(0.4122214708 * lr + 0.5363325363 * lg + 0.0514459929 * lb);
|
|
129
|
-
const m = Math.cbrt(0.2119034982 * lr + 0.6806995451 * lg + 0.1073969566 * lb);
|
|
130
|
-
const s = Math.cbrt(0.0883024619 * lr + 0.2817188376 * lg + 0.6299787005 * lb);
|
|
131
|
-
return {
|
|
132
|
-
l: 0.2104542553 * l + 0.793617785 * m - 0.0040720468 * s,
|
|
133
|
-
a: 1.9779984951 * l - 2.428592205 * m + 0.4505937099 * s,
|
|
134
|
-
b: 0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s,
|
|
135
|
-
alpha: rgba.a
|
|
136
|
-
};
|
|
137
|
-
}
|
|
138
|
-
function oklabToRgb(lab) {
|
|
139
|
-
const l_ = lab.l + 0.3963377774 * lab.a + 0.2158037573 * lab.b;
|
|
140
|
-
const m_ = lab.l - 0.1055613458 * lab.a - 0.0638541728 * lab.b;
|
|
141
|
-
const s_ = lab.l - 0.0894841775 * lab.a - 1.291485548 * lab.b;
|
|
142
|
-
const l = l_ ** 3;
|
|
143
|
-
const m = m_ ** 3;
|
|
144
|
-
const s = s_ ** 3;
|
|
145
|
-
return {
|
|
146
|
-
r: linearToSrgb(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),
|
|
147
|
-
g: linearToSrgb(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),
|
|
148
|
-
b: linearToSrgb(-0.0041960863 * l - 0.7034186147 * m + 1.707614701 * s),
|
|
149
|
-
a: lab.alpha
|
|
150
|
-
};
|
|
151
|
-
}
|
|
152
|
-
function oklabToOklch(lab) {
|
|
153
|
-
const c = Math.hypot(lab.a, lab.b);
|
|
154
|
-
let h = 0;
|
|
155
|
-
if (c >= 1e-6) {
|
|
156
|
-
h = Math.atan2(lab.b, lab.a) * 180 / Math.PI;
|
|
157
|
-
if (h < 0) h += 360;
|
|
158
|
-
if (h >= 360) h -= 360;
|
|
159
|
-
}
|
|
160
|
-
return { l: lab.l, c, h, alpha: lab.alpha };
|
|
161
|
-
}
|
|
162
|
-
function oklchToOklab(lch) {
|
|
163
|
-
const rad = lch.h * Math.PI / 180;
|
|
164
|
-
return {
|
|
165
|
-
l: lch.l,
|
|
166
|
-
a: lch.c * Math.cos(rad),
|
|
167
|
-
b: lch.c * Math.sin(rad),
|
|
168
|
-
alpha: lch.alpha
|
|
169
|
-
};
|
|
170
|
-
}
|
|
171
|
-
var D65_XYZ = _chunkIPJ3TEYRcjs.xyToXyz.call(void 0, _chunkIPJ3TEYRcjs.D65_XY);
|
|
172
|
-
var SRGB_TO_XYZ = _chunkIPJ3TEYRcjs.rgbToXyzMatrix.call(void 0, [0.64, 0.33], [0.3, 0.6], [0.15, 0.06], D65_XYZ);
|
|
173
|
-
var P3_TO_XYZ = _chunkIPJ3TEYRcjs.rgbToXyzMatrix.call(void 0, [0.68, 0.32], [0.265, 0.69], [0.15, 0.06], D65_XYZ);
|
|
174
|
-
var XYZ_TO_SRGB = _chunkIPJ3TEYRcjs.invert.call(void 0, SRGB_TO_XYZ);
|
|
175
|
-
var XYZ_TO_P3 = _chunkIPJ3TEYRcjs.invert.call(void 0, P3_TO_XYZ);
|
|
176
|
-
var P3_TO_SRGB_MAT = _chunkIPJ3TEYRcjs.mul.call(void 0, XYZ_TO_SRGB, P3_TO_XYZ);
|
|
177
|
-
var SRGB_TO_P3_MAT = _chunkIPJ3TEYRcjs.mul.call(void 0, XYZ_TO_P3, SRGB_TO_XYZ);
|
|
178
|
-
function linearSrgbToDisplayP3(rgb) {
|
|
179
|
-
const out = _chunkIPJ3TEYRcjs.apply.call(void 0, SRGB_TO_P3_MAT, [rgb.r, rgb.g, rgb.b]);
|
|
180
|
-
return { r: out[0], g: out[1], b: out[2], a: rgb.a };
|
|
181
|
-
}
|
|
182
|
-
function displayP3ToLinearSrgb(rgb) {
|
|
183
|
-
const out = _chunkIPJ3TEYRcjs.apply.call(void 0, P3_TO_SRGB_MAT, [rgb.r, rgb.g, rgb.b]);
|
|
184
|
-
return { r: out[0], g: out[1], b: out[2], a: rgb.a };
|
|
185
|
-
}
|
|
8
|
+
var _chunk7AHBW2CQcjs = require('./chunk-7AHBW2CQ.cjs');
|
|
186
9
|
|
|
187
10
|
// src/color/named.ts
|
|
188
11
|
var NAMED_COLORS = {
|
|
@@ -430,7 +253,7 @@ function parseColor(input) {
|
|
|
430
253
|
const s = parsePercentOrNumber(parts[1], 100);
|
|
431
254
|
const l = parsePercentOrNumber(parts[2], 100);
|
|
432
255
|
if (h === null || s === null || l === null) return null;
|
|
433
|
-
return hslToRgb({ h, s, l, alpha: alphaVal });
|
|
256
|
+
return _chunk7AHBW2CQcjs.hslToRgb.call(void 0, { h, s, l, alpha: alphaVal });
|
|
434
257
|
}
|
|
435
258
|
const oklabMatch = OKLAB_RE.exec(text);
|
|
436
259
|
if (oklabMatch) {
|
|
@@ -446,7 +269,7 @@ function parseColor(input) {
|
|
|
446
269
|
const a = parsePercentOrNumber(parts[1], 1);
|
|
447
270
|
const b = parsePercentOrNumber(parts[2], 1);
|
|
448
271
|
if (l === null || a === null || b === null) return null;
|
|
449
|
-
return oklabToRgb({ l, a, b, alpha: alphaVal });
|
|
272
|
+
return _chunk7AHBW2CQcjs.oklabToRgb.call(void 0, { l, a, b, alpha: alphaVal });
|
|
450
273
|
}
|
|
451
274
|
const oklchMatch = OKLCH_RE.exec(text);
|
|
452
275
|
if (oklchMatch) {
|
|
@@ -462,7 +285,7 @@ function parseColor(input) {
|
|
|
462
285
|
const c = parsePercentOrNumber(parts[1], 1);
|
|
463
286
|
const h = parseAngle(parts[2]);
|
|
464
287
|
if (l === null || c === null || h === null) return null;
|
|
465
|
-
return oklabToRgb(oklchToOklab({ l, c, h, alpha: alphaVal }));
|
|
288
|
+
return _chunk7AHBW2CQcjs.oklabToRgb.call(void 0, _chunk7AHBW2CQcjs.oklchToOklab.call(void 0, { l, c, h, alpha: alphaVal }));
|
|
466
289
|
}
|
|
467
290
|
const colorMatch = COLOR_FN_RE.exec(text);
|
|
468
291
|
if (colorMatch) {
|
|
@@ -485,21 +308,21 @@ function parseColor(input) {
|
|
|
485
308
|
}
|
|
486
309
|
if (space === "srgb-linear") {
|
|
487
310
|
return {
|
|
488
|
-
r: linearToSrgb(c1),
|
|
489
|
-
g: linearToSrgb(c2),
|
|
490
|
-
b: linearToSrgb(c3),
|
|
311
|
+
r: _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, c1),
|
|
312
|
+
g: _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, c2),
|
|
313
|
+
b: _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, c3),
|
|
491
314
|
a: alphaVal
|
|
492
315
|
};
|
|
493
316
|
}
|
|
494
317
|
if (space === "display-p3") {
|
|
495
|
-
const linP3R = srgbToLinear(c1);
|
|
496
|
-
const linP3G = srgbToLinear(c2);
|
|
497
|
-
const linP3B = srgbToLinear(c3);
|
|
498
|
-
const linSrgb = displayP3ToLinearSrgb({ r: linP3R, g: linP3G, b: linP3B, a: alphaVal });
|
|
318
|
+
const linP3R = _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c1);
|
|
319
|
+
const linP3G = _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c2);
|
|
320
|
+
const linP3B = _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c3);
|
|
321
|
+
const linSrgb = _chunk7AHBW2CQcjs.displayP3ToLinearSrgb.call(void 0, { r: linP3R, g: linP3G, b: linP3B, a: alphaVal });
|
|
499
322
|
return {
|
|
500
|
-
r: linearToSrgb(linSrgb.r),
|
|
501
|
-
g: linearToSrgb(linSrgb.g),
|
|
502
|
-
b: linearToSrgb(linSrgb.b),
|
|
323
|
+
r: _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linSrgb.r),
|
|
324
|
+
g: _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linSrgb.g),
|
|
325
|
+
b: _chunk7AHBW2CQcjs.linearToSrgb.call(void 0, linSrgb.b),
|
|
503
326
|
a: alphaVal
|
|
504
327
|
};
|
|
505
328
|
}
|
|
@@ -565,9 +388,9 @@ function composite(fg, bg) {
|
|
|
565
388
|
};
|
|
566
389
|
}
|
|
567
390
|
function relativeLuminance(c) {
|
|
568
|
-
const r = srgbToLinear(c.r);
|
|
569
|
-
const g = srgbToLinear(c.g);
|
|
570
|
-
const b = srgbToLinear(c.b);
|
|
391
|
+
const r = _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.r);
|
|
392
|
+
const g = _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.g);
|
|
393
|
+
const b = _chunk7AHBW2CQcjs.srgbToLinear.call(void 0, c.b);
|
|
571
394
|
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
572
395
|
}
|
|
573
396
|
function contrastRatio(foreground, background) {
|
|
@@ -617,16 +440,4 @@ function readableTextColor(background, candidates = [BLACK, WHITE]) {
|
|
|
617
440
|
|
|
618
441
|
|
|
619
442
|
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
exports.srgbToLinear = srgbToLinear; exports.linearToSrgb = linearToSrgb; exports.rgbToHsl = rgbToHsl; exports.hslToRgb = hslToRgb; exports.rgbToHsv = rgbToHsv; exports.hsvToRgb = hsvToRgb; exports.rgbToOklab = rgbToOklab; exports.oklabToRgb = oklabToRgb; exports.oklabToOklch = oklabToOklch; exports.oklchToOklab = oklchToOklab; exports.linearSrgbToDisplayP3 = linearSrgbToDisplayP3; exports.displayP3ToLinearSrgb = displayP3ToLinearSrgb; exports.NAMED_COLORS = NAMED_COLORS; exports.parseColor = parseColor; exports.isColor = isColor; exports.relativeLuminance = relativeLuminance; exports.contrastRatio = contrastRatio; exports.contrastLevel = contrastLevel; exports.readableTextColor = readableTextColor;
|
|
443
|
+
exports.NAMED_COLORS = NAMED_COLORS; exports.parseColor = parseColor; exports.isColor = isColor; exports.relativeLuminance = relativeLuminance; exports.contrastRatio = contrastRatio; exports.contrastLevel = contrastLevel; exports.readableTextColor = readableTextColor;
|
|
@@ -74,7 +74,7 @@ function profileAlongPolyline(points, values, count = 32) {
|
|
|
74
74
|
var round3 = (v) => Math.round(v * 1e3) / 1e3;
|
|
75
75
|
var loading = null;
|
|
76
76
|
function loadCanvasBrushstrokeRenderer() {
|
|
77
|
-
loading ??= import("./brushstrokeRender-
|
|
77
|
+
loading ??= import("./brushstrokeRender-WB67GMUP.js").catch((error) => {
|
|
78
78
|
loading = null;
|
|
79
79
|
throw error;
|
|
80
80
|
});
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
|
-
var
|
|
11
|
+
var _chunk3R5P3DVYcjs = require('./chunk-3R5P3DVY.cjs');
|
|
12
12
|
|
|
13
13
|
// src/chart/ooxml.ts
|
|
14
14
|
var CHART_OOXML_NS = "http://schemas.openxmlformats.org/drawingml/2006/chart";
|
|
@@ -111,11 +111,11 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
111
111
|
try {
|
|
112
112
|
doc = new (parser(options))().parseFromString(xml, "application/xml");
|
|
113
113
|
} catch (error) {
|
|
114
|
-
return { spec:
|
|
114
|
+
return { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: `The chart XML could not be read: ${error.message}` }], unsupported, lossless: false };
|
|
115
115
|
}
|
|
116
116
|
const root = doc.documentElement;
|
|
117
117
|
if (!root || root.localName !== "chartSpace" || doc.getElementsByTagName("parsererror").length) {
|
|
118
|
-
return { spec:
|
|
118
|
+
return { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, {}).spec, issues: [{ path: "", message: "This is not a chart part: expected a c:chartSpace (or cx:chartSpace) root element." }], unsupported, lossless: false };
|
|
119
119
|
}
|
|
120
120
|
if (_optionalChain([root, 'access', _14 => _14.namespaceURI, 'optionalAccess', _15 => _15.includes, 'call', _16 => _16("chartex")]) || kid(root, "chartData")) return readChartex(root, issues, unsupported);
|
|
121
121
|
const chart = kid(root, "chart");
|
|
@@ -280,7 +280,7 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
280
280
|
}
|
|
281
281
|
if (!types.length) {
|
|
282
282
|
issues.push({ path: "plotArea", message: unsupported.length ? `The chart type is not supported: ${unsupported.join(", ")}.` : "The chart has no plot groups." });
|
|
283
|
-
return { spec:
|
|
283
|
+
return { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input).spec, issues, unsupported, lossless: false };
|
|
284
284
|
}
|
|
285
285
|
const first = types[0];
|
|
286
286
|
const combo = types.some((t) => t !== first);
|
|
@@ -290,14 +290,14 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
290
290
|
if (!combo) {
|
|
291
291
|
for (const s of series) if (s.axis) issues.push({ path: "series", message: `"${s.name}" is on a second value axis.` });
|
|
292
292
|
}
|
|
293
|
-
if (types.some((t) => !
|
|
293
|
+
if (types.some((t) => !_chunk3R5P3DVYcjs.isCartesianChart.call(void 0, t)) && combo) unsupported.push("a pie or radar mixed with other chart types");
|
|
294
294
|
input.series = series;
|
|
295
295
|
input.categories = categories.length ? categories : Array.from({ length: Math.max(0, ...series.map((s) => s.values.length)) }, (_, i) => `${i + 1}`);
|
|
296
296
|
input.stacking = stacking;
|
|
297
297
|
input.orientation = orientation;
|
|
298
298
|
input.dataLabels = dataLabels;
|
|
299
299
|
input.points = points || first !== "line";
|
|
300
|
-
if (bool(val(groups[0], "varyColors")) && !combo &&
|
|
300
|
+
if (bool(val(groups[0], "varyColors")) && !combo && _chunk3R5P3DVYcjs.isCartesianChart.call(void 0, first) && series.length === 1) input.varyColors = true;
|
|
301
301
|
const readAxis = (a, fallback) => {
|
|
302
302
|
const axis = { ...fallback, format: {} };
|
|
303
303
|
if (!a) return axis;
|
|
@@ -324,12 +324,12 @@ function chartFromOoxml(xml, options = {}) {
|
|
|
324
324
|
};
|
|
325
325
|
const xy = first === "scatter" || first === "bubble";
|
|
326
326
|
const catAxis = _nullishCoalesce(_nullishCoalesce(kid(plot, "catAx"), () => ( kid(plot, "dateAx"))), () => ( (xy ? valAxes.find((a) => !vertical(a)) : void 0)));
|
|
327
|
-
input.xAxis = readAxis(catAxis,
|
|
327
|
+
input.xAxis = readAxis(catAxis, _chunk3R5P3DVYcjs.defaultChartAxis.call(void 0, false));
|
|
328
328
|
if (kid(plot, "dateAx")) input.xAxis.kind = "date";
|
|
329
|
-
input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])),
|
|
329
|
+
input.yAxis = readAxis(_nullishCoalesce(_nullishCoalesce(primaryAxis, () => ( valAxes.find(vertical))), () => ( valAxes[0])), _chunk3R5P3DVYcjs.defaultChartAxis.call(void 0, true));
|
|
330
330
|
const secondaryAxis = valAxes.find((a) => a !== primaryAxis && (xy ? vertical(a) && a !== primaryAxis : true) && a !== catAxis);
|
|
331
|
-
if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis,
|
|
332
|
-
const { spec, issues: specIssues } =
|
|
331
|
+
if (series.some((s) => s.axis === "secondary") && secondaryAxis) input.yAxis2 = readAxis(secondaryAxis, _chunk3R5P3DVYcjs.defaultChartAxis.call(void 0, false));
|
|
332
|
+
const { spec, issues: specIssues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input);
|
|
333
333
|
issues.push(...specIssues);
|
|
334
334
|
const uniq = [...new Set(unsupported)];
|
|
335
335
|
return { spec, issues, unsupported: uniq, lossless: uniq.length === 0 && specIssues.length === 0 };
|
|
@@ -382,7 +382,7 @@ function readChartex(root, issues, unsupported) {
|
|
|
382
382
|
const type = layouts[layout];
|
|
383
383
|
if (!type) {
|
|
384
384
|
issues.push({ path: "plotArea", message: `The chart layout "${layout || "unknown"}" is not supported.` });
|
|
385
|
-
return { spec:
|
|
385
|
+
return { spec: _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, {}).spec, issues, unsupported: [layout || "unknown chartex layout"], lossless: false };
|
|
386
386
|
}
|
|
387
387
|
if (layout === "paretoLine") unsupported.push("pareto line");
|
|
388
388
|
const series = [];
|
|
@@ -409,18 +409,18 @@ function readChartex(root, issues, unsupported) {
|
|
|
409
409
|
const first = data.get(_nullishCoalesce(_optionalChain([kid, 'call', _35 => _35(seriesEls[0], "dataId"), 'optionalAccess', _36 => _36.getAttribute, 'call', _37 => _37("val")]), () => ( "0")));
|
|
410
410
|
if ((type === "treemap" || type === "sunburst") && _optionalChain([first, 'optionalAccess', _38 => _38.paths])) {
|
|
411
411
|
const treeIssues = [];
|
|
412
|
-
input.tree =
|
|
412
|
+
input.tree = _chunk3R5P3DVYcjs.chartTreeFromRows.call(void 0, first.paths.map((path2, i) => ({ path: path2, value: _nullishCoalesce(first.values[i], () => ( 0)) })), treeIssues);
|
|
413
413
|
for (const t of treeIssues) issues.push({ path: "chartData", message: t.message });
|
|
414
414
|
}
|
|
415
|
-
const { spec, issues: specIssues } =
|
|
415
|
+
const { spec, issues: specIssues } = _chunk3R5P3DVYcjs.normalizeChartSpec.call(void 0, input);
|
|
416
416
|
issues.push(...specIssues);
|
|
417
417
|
return { spec, issues, unsupported, lossless: unsupported.length === 0 && specIssues.length === 0 };
|
|
418
418
|
}
|
|
419
419
|
var esc = (s) => s.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
420
420
|
var hex = (color) => {
|
|
421
421
|
if (!color) return null;
|
|
422
|
-
const rgb =
|
|
423
|
-
return rgb ?
|
|
422
|
+
const rgb = _chunk3R5P3DVYcjs.parseChartColor.call(void 0, color);
|
|
423
|
+
return rgb ? _chunk3R5P3DVYcjs.chartRgbToHex.call(void 0, rgb).slice(1).toUpperCase() : null;
|
|
424
424
|
};
|
|
425
425
|
var fillXml = (color, line = false) => {
|
|
426
426
|
const h = hex(color);
|
|
@@ -464,7 +464,7 @@ function errBarsXml(bars, dir) {
|
|
|
464
464
|
var MARKER_OUT = { circle: "circle", square: "square", diamond: "diamond", triangle: "triangle", cross: "x", none: "none" };
|
|
465
465
|
function chartToOoxml(spec) {
|
|
466
466
|
const issues = [];
|
|
467
|
-
const family =
|
|
467
|
+
const family = _chunk3R5P3DVYcjs.chartFamily.call(void 0, spec);
|
|
468
468
|
let type = spec.type;
|
|
469
469
|
if (family === "waterfall" || family === "histogram" || family === "box" || family === "funnel") {
|
|
470
470
|
issues.push(`${spec.type} charts are written as bar charts: DrawingML has no ${spec.type} type (Office 2016 stores it as chartex).`);
|
|
@@ -512,7 +512,7 @@ function chartToOoxml(spec) {
|
|
|
512
512
|
const ids = { cat: 500000001, val: 500000002, cat2: 500000003, val2: 500000004 };
|
|
513
513
|
const xy = family === "xy" || type === "scatter" || type === "bubble";
|
|
514
514
|
const pieLike = type === "pie" || type === "donut";
|
|
515
|
-
const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" :
|
|
515
|
+
const typed = (s) => pieLike || type === "radar" ? type : type === "bubble" ? "bubble" : xy ? "scatter" : _chunk3R5P3DVYcjs.chartSeriesType.call(void 0, { type }, s);
|
|
516
516
|
const groups = [];
|
|
517
517
|
visible.forEach((s) => {
|
|
518
518
|
const kind = typed(s);
|
|
@@ -575,7 +575,7 @@ function chartToOoxml(spec) {
|
|
|
575
575
|
return `<c:ser>${parts.join("")}</c:ser>`;
|
|
576
576
|
};
|
|
577
577
|
const dLbls = `<c:dLbls><c:showLegendKey val="0"/><c:showVal val="${spec.dataLabels ? 1 : 0}"/><c:showCatName val="0"/><c:showSerName val="0"/><c:showPercent val="0"/><c:showBubbleSize val="0"/></c:dLbls>`;
|
|
578
|
-
const vary =
|
|
578
|
+
const vary = _chunk3R5P3DVYcjs.chartVariesColors.call(void 0, spec) ? 1 : 0;
|
|
579
579
|
const groupXml = groups.map((g) => {
|
|
580
580
|
const axes2 = g.secondary ? `<c:axId val="${ids.cat2}"/><c:axId val="${ids.val2}"/>` : `<c:axId val="${ids.cat}"/><c:axId val="${ids.val}"/>`;
|
|
581
581
|
const sers = g.series.map(({ s, index }) => serXml(g.kind, s, index)).join("");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true}); function _nullishCoalesce(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } } function _optionalChain(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; } var _class; var _class2;
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkNKTNLJUJcjs = require('./chunk-NKTNLJUJ.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkCVFAAZXEcjs = require('./chunk-CVFAAZXE.cjs');
|
|
@@ -51,7 +51,7 @@ var _chunkPQ3H2AANcjs = require('./chunk-PQ3H2AAN.cjs');
|
|
|
51
51
|
|
|
52
52
|
|
|
53
53
|
|
|
54
|
-
var
|
|
54
|
+
var _chunkUTI5IITZcjs = require('./chunk-UTI5IITZ.cjs');
|
|
55
55
|
|
|
56
56
|
|
|
57
57
|
|
|
@@ -192,7 +192,7 @@ var toGamma = (c) => {
|
|
|
192
192
|
function intoSpace(space, [r, g, b]) {
|
|
193
193
|
if (space === "linear") return [toLinear(r), toLinear(g), toLinear(b)];
|
|
194
194
|
if (space === "oklab") {
|
|
195
|
-
const c =
|
|
195
|
+
const c = _chunkUTI5IITZcjs.rgbToOklab.call(void 0, r, g, b);
|
|
196
196
|
return [c.l, c.a, c.b];
|
|
197
197
|
}
|
|
198
198
|
return [r, g, b];
|
|
@@ -200,7 +200,7 @@ function intoSpace(space, [r, g, b]) {
|
|
|
200
200
|
function outOfSpace(space, [x, y, z]) {
|
|
201
201
|
if (space === "linear") return [toGamma(x), toGamma(y), toGamma(z)];
|
|
202
202
|
if (space === "oklab") {
|
|
203
|
-
const c =
|
|
203
|
+
const c = _chunkUTI5IITZcjs.oklabToRgb.call(void 0, { l: x, a: y, b: z, alpha: 1 });
|
|
204
204
|
return [c.r, c.g, c.b];
|
|
205
205
|
}
|
|
206
206
|
return [clamp(x, 0, 1), clamp(y, 0, 1), clamp(z, 0, 1)];
|
|
@@ -2527,7 +2527,7 @@ function vectorExtrudeFaces(path, params) {
|
|
|
2527
2527
|
// src/vector/brushstroke.ts
|
|
2528
2528
|
var VECTOR_BRUSHSTROKE_SCALE = 2;
|
|
2529
2529
|
function vectorBrushstrokeBrushes() {
|
|
2530
|
-
return
|
|
2530
|
+
return _chunkNKTNLJUJcjs.BUILTIN_BRUSHES.filter((b) => _chunkPQ3H2AANcjs.isBrushstrokeBrush.call(void 0, b));
|
|
2531
2531
|
}
|
|
2532
2532
|
function vectorBrushstrokeBrush(id) {
|
|
2533
2533
|
return _nullishCoalesce(vectorBrushstrokeBrushes().find((b) => b.id === id), () => ( null));
|
|
@@ -6,15 +6,15 @@ var _chunkA6QWKBJPcjs = require('./chunk-A6QWKBJP.cjs');
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
var
|
|
9
|
+
var _chunk7AHBW2CQcjs = require('./chunk-7AHBW2CQ.cjs');
|
|
10
10
|
|
|
11
11
|
// src/animation/color.ts
|
|
12
12
|
function rgbToOklab2(r, g, b, alpha = 1) {
|
|
13
|
-
const lab =
|
|
13
|
+
const lab = _chunk7AHBW2CQcjs.rgbToOklab.call(void 0, { r, g, b, a: alpha });
|
|
14
14
|
return { l: lab.l, a: lab.a, b: lab.b, alpha: lab.alpha };
|
|
15
15
|
}
|
|
16
16
|
function oklabToRgb2(color) {
|
|
17
|
-
const c =
|
|
17
|
+
const c = _chunk7AHBW2CQcjs.oklabToRgb.call(void 0, { l: color.l, a: color.a, b: color.b, alpha: color.alpha });
|
|
18
18
|
const clamp01 = (v) => Math.min(1, Math.max(0, v));
|
|
19
19
|
return {
|
|
20
20
|
r: clamp01(c.r),
|