@a_ng_d/utils-ui-color-palette 1.3.3 → 1.3.5
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/modules/data/data.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/modules/data/data.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,WAAW,EAGZ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAEjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAIjC,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,IAAI,CAAC,CAAmB;IAChC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAoB;gBAE5B,EACV,IAAI,EACJ,MAAM,EACN,IAAI,GACL,EAAE;QACD,IAAI,EAAE,iBAAiB,CAAA;QACvB,MAAM,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACjC,IAAI,CAAC,EAAE,iBAAiB,CAAA;KACzB;IAeD,eAAe,oBAmUd;IAED,eAAe,aACH,KAAK,CACX,eAAe,GACf,SAAS,GACT,aAAa,GACb,UAAU,GACV,IAAI,GACJ,KAAK,GACL,aAAa,CAChB,iBACc,KAAK,CAAC,WAAW,CAAC,mBAsDlC;IAED,mBAAmB,0BAUlB;CACF"}
|
|
@@ -1,273 +1,262 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { C as
|
|
5
|
-
import { c as
|
|
6
|
-
|
|
7
|
-
for (; S--; ) y[S] = (S + 256).toString(16).substring(1);
|
|
8
|
-
function E(g) {
|
|
9
|
-
var r = 0, l = 11;
|
|
10
|
-
if (!p || S + l > v * 2)
|
|
11
|
-
for (p = "", S = 0; r < v; r++)
|
|
12
|
-
p += y[Math.random() * 256 | 0];
|
|
13
|
-
return p.substring(S, S++ + l);
|
|
14
|
-
}
|
|
15
|
-
class W {
|
|
1
|
+
var v = Object.defineProperty;
|
|
2
|
+
var E = (g, r, h) => r in g ? v(g, r, { enumerable: !0, configurable: !0, writable: !0, value: h }) : g[r] = h;
|
|
3
|
+
var u = (g, r, h) => E(g, typeof r != "symbol" ? r + "" : r, h);
|
|
4
|
+
import { C as k, H as f } from "../../color-1CXTuV84.js";
|
|
5
|
+
import { c as s } from "../../index-Beb8qoyd.js";
|
|
6
|
+
class A {
|
|
16
7
|
constructor({
|
|
17
8
|
base: r,
|
|
18
|
-
themes:
|
|
19
|
-
meta:
|
|
9
|
+
themes: h,
|
|
10
|
+
meta: e
|
|
20
11
|
}) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
const
|
|
12
|
+
u(this, "base");
|
|
13
|
+
u(this, "themes");
|
|
14
|
+
u(this, "meta");
|
|
15
|
+
u(this, "paletteData");
|
|
16
|
+
u(this, "currentScale");
|
|
17
|
+
u(this, "makePaletteData", () => (this.themes.forEach((r) => {
|
|
18
|
+
const h = {
|
|
28
19
|
id: r.id,
|
|
29
20
|
name: r.name,
|
|
30
21
|
description: r.description,
|
|
31
22
|
colors: [],
|
|
32
23
|
type: r.type
|
|
33
24
|
};
|
|
34
|
-
this.base.colors.forEach((
|
|
35
|
-
const d = Object.entries(r.scale).reverse().map((
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
25
|
+
this.base.colors.forEach((e) => {
|
|
26
|
+
const d = Object.entries(r.scale).reverse().map((a) => {
|
|
27
|
+
if (e.alpha.isEnabled) {
|
|
28
|
+
const t = new k({
|
|
38
29
|
render: "RGB",
|
|
39
30
|
sourceColor: [
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
31
|
+
e.rgb.r * 255,
|
|
32
|
+
e.rgb.g * 255,
|
|
33
|
+
e.rgb.b * 255
|
|
43
34
|
],
|
|
44
|
-
alpha: parseFloat((
|
|
45
|
-
hueShifting:
|
|
46
|
-
chromaShifting:
|
|
35
|
+
alpha: parseFloat((a[1] / 100).toFixed(2)),
|
|
36
|
+
hueShifting: e.hue.shift !== void 0 ? e.hue.shift : 0,
|
|
37
|
+
chromaShifting: e.chroma.shift !== void 0 ? e.chroma.shift : 100,
|
|
47
38
|
algorithmVersion: this.base.algorithmVersion,
|
|
48
39
|
visionSimulationMode: r.visionSimulationMode
|
|
49
|
-
}),
|
|
40
|
+
}), l = new k({
|
|
50
41
|
render: "RGB",
|
|
51
|
-
sourceColor:
|
|
42
|
+
sourceColor: s(e.alpha.backgroundColor).rgb(),
|
|
52
43
|
algorithmVersion: this.base.algorithmVersion,
|
|
53
44
|
visionSimulationMode: r.visionSimulationMode
|
|
54
45
|
});
|
|
55
46
|
switch (this.base.colorSpace) {
|
|
56
47
|
case "LCH":
|
|
57
48
|
return this.base.areSourceColorsLocked ? [
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
49
|
+
a,
|
|
50
|
+
t.setColorWithAlpha(),
|
|
51
|
+
l.setColorWithAlpha()
|
|
61
52
|
] : [
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
a,
|
|
54
|
+
t.lcha(),
|
|
55
|
+
l.lcha()
|
|
65
56
|
];
|
|
66
57
|
case "OKLCH":
|
|
67
58
|
return this.base.areSourceColorsLocked ? [
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
59
|
+
a,
|
|
60
|
+
t.setColorWithAlpha(),
|
|
61
|
+
l.setColorWithAlpha()
|
|
71
62
|
] : [
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
63
|
+
a,
|
|
64
|
+
t.oklcha(),
|
|
65
|
+
l.oklcha()
|
|
75
66
|
];
|
|
76
67
|
case "LAB":
|
|
77
68
|
return this.base.areSourceColorsLocked ? [
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
a,
|
|
70
|
+
t.setColorWithAlpha(),
|
|
71
|
+
l.setColorWithAlpha()
|
|
81
72
|
] : [
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
73
|
+
a,
|
|
74
|
+
t.laba(),
|
|
75
|
+
l.laba()
|
|
85
76
|
];
|
|
86
77
|
case "OKLAB":
|
|
87
78
|
return this.base.areSourceColorsLocked ? [
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
79
|
+
a,
|
|
80
|
+
t.setColorWithAlpha(),
|
|
81
|
+
l.setColorWithAlpha()
|
|
91
82
|
] : [
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
83
|
+
a,
|
|
84
|
+
t.oklaba(),
|
|
85
|
+
l.oklaba()
|
|
95
86
|
];
|
|
96
87
|
case "HSL":
|
|
97
88
|
return this.base.areSourceColorsLocked ? [
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
89
|
+
a,
|
|
90
|
+
t.setColorWithAlpha(),
|
|
91
|
+
l.setColorWithAlpha()
|
|
101
92
|
] : [
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
93
|
+
a,
|
|
94
|
+
t.hsla(),
|
|
95
|
+
l.hsla()
|
|
105
96
|
];
|
|
106
97
|
case "HSLUV":
|
|
107
98
|
return this.base.areSourceColorsLocked ? [
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
a,
|
|
100
|
+
t.setColorWithAlpha(),
|
|
101
|
+
l.setColorWithAlpha()
|
|
111
102
|
] : [
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
103
|
+
a,
|
|
104
|
+
t.hsluva(),
|
|
105
|
+
l.hsluva()
|
|
115
106
|
];
|
|
116
107
|
default:
|
|
117
|
-
return [
|
|
108
|
+
return [a, [0, 0, 0], [255, 255, 255]];
|
|
118
109
|
}
|
|
119
110
|
} else {
|
|
120
|
-
const
|
|
111
|
+
const t = new k({
|
|
121
112
|
render: "RGB",
|
|
122
113
|
sourceColor: [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
114
|
+
e.rgb.r * 255,
|
|
115
|
+
e.rgb.g * 255,
|
|
116
|
+
e.rgb.b * 255
|
|
126
117
|
],
|
|
127
|
-
lightness:
|
|
128
|
-
hueShifting:
|
|
129
|
-
chromaShifting:
|
|
118
|
+
lightness: a[1],
|
|
119
|
+
hueShifting: e.hue.shift !== void 0 ? e.hue.shift : 0,
|
|
120
|
+
chromaShifting: e.chroma.shift !== void 0 ? e.chroma.shift : 100,
|
|
130
121
|
algorithmVersion: this.base.algorithmVersion,
|
|
131
122
|
visionSimulationMode: r.visionSimulationMode
|
|
132
123
|
});
|
|
133
124
|
switch (this.base.colorSpace) {
|
|
134
125
|
case "LCH":
|
|
135
|
-
return [
|
|
126
|
+
return [a, t.lch()];
|
|
136
127
|
case "OKLCH":
|
|
137
|
-
return [
|
|
128
|
+
return [a, t.oklch()];
|
|
138
129
|
case "LAB":
|
|
139
|
-
return [
|
|
130
|
+
return [a, t.lab()];
|
|
140
131
|
case "OKLAB":
|
|
141
|
-
return [
|
|
132
|
+
return [a, t.oklab()];
|
|
142
133
|
case "HSL":
|
|
143
|
-
return [
|
|
134
|
+
return [a, t.hsl()];
|
|
144
135
|
case "HSLUV":
|
|
145
|
-
return [
|
|
136
|
+
return [a, t.hsluv()];
|
|
146
137
|
default:
|
|
147
|
-
return [
|
|
138
|
+
return [a, [0, 0, 0]];
|
|
148
139
|
}
|
|
149
140
|
}
|
|
150
|
-
}),
|
|
151
|
-
id:
|
|
152
|
-
name:
|
|
153
|
-
description:
|
|
141
|
+
}), S = {
|
|
142
|
+
id: e.id,
|
|
143
|
+
name: e.name,
|
|
144
|
+
description: e.description,
|
|
154
145
|
shades: [],
|
|
155
146
|
type: "color"
|
|
156
147
|
}, i = [
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
],
|
|
161
|
-
|
|
162
|
-
id: E(),
|
|
148
|
+
e.rgb.r * 255,
|
|
149
|
+
e.rgb.g * 255,
|
|
150
|
+
e.rgb.b * 255
|
|
151
|
+
], o = new f();
|
|
152
|
+
o.rgb_r = e.rgb.r, o.rgb_g = e.rgb.g, o.rgb_b = e.rgb.b, o.rgbToHsluv(), S.shades.push({
|
|
163
153
|
name: "source",
|
|
164
154
|
description: "Source color",
|
|
165
|
-
hex:
|
|
155
|
+
hex: s(i).hex(),
|
|
166
156
|
rgb: i,
|
|
167
|
-
gl:
|
|
168
|
-
lch:
|
|
169
|
-
oklch:
|
|
170
|
-
lab:
|
|
171
|
-
oklab:
|
|
172
|
-
hsl:
|
|
157
|
+
gl: s(i).gl(),
|
|
158
|
+
lch: s(i).lch(),
|
|
159
|
+
oklch: s(i).oklch(),
|
|
160
|
+
lab: s(i).lab(),
|
|
161
|
+
oklab: s(i).oklab(),
|
|
162
|
+
hsl: s(i).hsl(),
|
|
173
163
|
hsluv: [
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
164
|
+
o.hsluv_h,
|
|
165
|
+
o.hsluv_s,
|
|
166
|
+
o.hsluv_l
|
|
177
167
|
],
|
|
178
168
|
type: "source color"
|
|
179
169
|
});
|
|
180
|
-
const
|
|
181
|
-
(
|
|
182
|
-
|
|
183
|
-
|
|
170
|
+
const c = d.map(
|
|
171
|
+
(a) => s.distance(
|
|
172
|
+
s(i).hex(),
|
|
173
|
+
s(a[1]).hex(),
|
|
184
174
|
"rgb"
|
|
185
175
|
)
|
|
186
|
-
),
|
|
187
|
-
d.forEach((
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
176
|
+
), b = c.indexOf(Math.min(...c));
|
|
177
|
+
d.forEach((a, t) => {
|
|
178
|
+
const l = s.distance(
|
|
179
|
+
s(i).hex(),
|
|
180
|
+
s(a[1]).hex(),
|
|
191
181
|
"rgb"
|
|
192
|
-
),
|
|
193
|
-
(
|
|
194
|
-
) ?? "0",
|
|
182
|
+
), C = Object.keys(this.currentScale).find(
|
|
183
|
+
(L) => L === a[0][0]
|
|
184
|
+
) ?? "0", n = new f(), p = new k({
|
|
195
185
|
render: "RGB",
|
|
196
|
-
sourceColor:
|
|
186
|
+
sourceColor: s(i).rgb(),
|
|
197
187
|
visionSimulationMode: r.visionSimulationMode
|
|
198
|
-
}).setColor(), m = new
|
|
188
|
+
}).setColor(), m = new k({
|
|
199
189
|
render: "HEX",
|
|
200
|
-
sourceColor:
|
|
190
|
+
sourceColor: s(i).rgb(),
|
|
201
191
|
visionSimulationMode: r.visionSimulationMode
|
|
202
192
|
}).setColor();
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
mixedColor: a.alpha.isEnabled && a.alpha.backgroundColor ? new f({
|
|
193
|
+
t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? (n.rgb_r = Number(p[0]) / 255, n.rgb_g = Number(p[1]) / 255, n.rgb_b = Number(p[2]) / 255) : (n.rgb_r = Number(a[1][0]) / 255, n.rgb_g = Number(a[1][1]) / 255, n.rgb_b = Number(a[1][2]) / 255), n.rgbToHsluv(), S.shades.push({
|
|
194
|
+
name: C,
|
|
195
|
+
description: `Shade color with ${typeof a[0][1] == "number" ? a[0][1].toFixed(1) : a[0][1]}% of ${e.alpha.isEnabled ? "opacity" : "lightness"}`,
|
|
196
|
+
hex: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? s(m).hex() : s(a[1]).hex(),
|
|
197
|
+
rgb: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? s(m).rgb() : s(a[1]).rgb(),
|
|
198
|
+
gl: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? s(m).gl() : s(a[1]).gl(),
|
|
199
|
+
lch: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? s(m).lch() : s(a[1]).lch(),
|
|
200
|
+
oklch: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? s(m).oklch() : s(a[1]).oklch(),
|
|
201
|
+
lab: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? s(m).lab() : s(a[1]).lab(),
|
|
202
|
+
oklab: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? s(m).oklab() : s(a[1]).oklab(),
|
|
203
|
+
hsl: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled ? s(m).hsl() : s(a[1]).hsl(),
|
|
204
|
+
hsluv: [n.hsluv_h, n.hsluv_s, n.hsluv_l],
|
|
205
|
+
alpha: e.alpha.isEnabled ? parseFloat((a[0][1] / 100).toFixed(2)) : void 0,
|
|
206
|
+
backgroundColor: e.alpha.isEnabled && e.alpha.backgroundColor ? s(a[2]).rgb() : void 0,
|
|
207
|
+
mixedColor: e.alpha.isEnabled && e.alpha.backgroundColor ? new k({
|
|
219
208
|
visionSimulationMode: r.visionSimulationMode
|
|
220
209
|
}).mixColorsRgb(
|
|
221
210
|
[
|
|
222
|
-
...
|
|
211
|
+
...a[1],
|
|
223
212
|
parseFloat(
|
|
224
|
-
(
|
|
213
|
+
(a[0][1] / 100).toFixed(2)
|
|
225
214
|
)
|
|
226
215
|
],
|
|
227
|
-
[...
|
|
216
|
+
[...a[2], 1]
|
|
228
217
|
) : void 0,
|
|
229
|
-
isClosestToRef:
|
|
230
|
-
isSourceColorLocked:
|
|
231
|
-
isTransparent:
|
|
218
|
+
isClosestToRef: l < 4 && !this.base.areSourceColorsLocked,
|
|
219
|
+
isSourceColorLocked: t === b && this.base.areSourceColorsLocked && !e.alpha.isEnabled,
|
|
220
|
+
isTransparent: e.alpha.isEnabled,
|
|
232
221
|
type: "color shade"
|
|
233
222
|
});
|
|
234
|
-
}),
|
|
235
|
-
}), this.paletteData.themes.push(
|
|
223
|
+
}), h.colors.push(S);
|
|
224
|
+
}), this.paletteData.themes.push(h);
|
|
236
225
|
}), this.paletteData));
|
|
237
|
-
|
|
238
|
-
const
|
|
226
|
+
u(this, "makeLibraryData", (r, h) => {
|
|
227
|
+
const e = this.makePaletteData(), d = e.themes.filter((i) => i.type === "custom theme").length === 0 ? e.themes.filter((i) => i.type === "default theme") : e.themes.filter((i) => i.type === "custom theme");
|
|
239
228
|
return d.flatMap((i) => i.colors.flatMap(
|
|
240
|
-
(
|
|
241
|
-
const
|
|
242
|
-
(
|
|
229
|
+
(o) => o.shades.flatMap((c) => {
|
|
230
|
+
const b = d[0].type === "custom theme" ? `${e.name === "" ? "" : e.name + " / "}${i.name} / ${o.name}` : `${e.name === "" ? "" : e.name} / ${o.name}`, a = `${i.id}:${o.id}:${c.name}`, t = h == null ? void 0 : h.find(
|
|
231
|
+
(l) => l.id === a
|
|
243
232
|
);
|
|
244
233
|
return {
|
|
245
|
-
id:
|
|
246
|
-
name:
|
|
247
|
-
path:
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
...(r == null ? void 0 : r.includes("gl")) && { gl:
|
|
234
|
+
id: a,
|
|
235
|
+
name: c.name,
|
|
236
|
+
path: b,
|
|
237
|
+
hex: c.hex,
|
|
238
|
+
alpha: c.alpha,
|
|
239
|
+
...(r == null ? void 0 : r.includes("gl")) && { gl: c.gl },
|
|
251
240
|
...(r == null ? void 0 : r.includes("description")) && {
|
|
252
|
-
description:
|
|
241
|
+
description: c.description
|
|
253
242
|
},
|
|
254
243
|
...(r == null ? void 0 : r.includes("collection_id")) && {
|
|
255
|
-
collectionId:
|
|
244
|
+
collectionId: t == null ? void 0 : t.collectionId
|
|
256
245
|
},
|
|
257
246
|
...(r == null ? void 0 : r.includes("mode_id")) && {
|
|
258
|
-
modeId:
|
|
247
|
+
modeId: t == null ? void 0 : t.modeId
|
|
259
248
|
},
|
|
260
249
|
...(r == null ? void 0 : r.includes("variable_id")) && {
|
|
261
|
-
variableId:
|
|
250
|
+
variableId: t == null ? void 0 : t.variableId
|
|
262
251
|
},
|
|
263
252
|
...(r == null ? void 0 : r.includes("style_id")) && {
|
|
264
|
-
styleId:
|
|
253
|
+
styleId: t == null ? void 0 : t.styleId
|
|
265
254
|
}
|
|
266
255
|
};
|
|
267
256
|
})
|
|
268
257
|
));
|
|
269
258
|
});
|
|
270
|
-
|
|
259
|
+
u(this, "makePaletteFullData", () => ({
|
|
271
260
|
base: this.base,
|
|
272
261
|
themes: this.themes,
|
|
273
262
|
libraryData: this.makeLibraryData(),
|
|
@@ -275,15 +264,15 @@ class W {
|
|
|
275
264
|
type: "UI_COLOR_PALETTE"
|
|
276
265
|
}));
|
|
277
266
|
var d;
|
|
278
|
-
this.base = r, this.themes =
|
|
267
|
+
this.base = r, this.themes = h, this.meta = e, this.paletteData = {
|
|
279
268
|
name: r.name ?? "UI Color Palette",
|
|
280
269
|
description: r.description,
|
|
281
270
|
themes: [],
|
|
282
271
|
type: "palette"
|
|
283
|
-
}, this.currentScale = ((d =
|
|
272
|
+
}, this.currentScale = ((d = h.find((S) => S.isEnabled)) == null ? void 0 : d.scale) ?? {};
|
|
284
273
|
}
|
|
285
274
|
}
|
|
286
275
|
export {
|
|
287
|
-
|
|
276
|
+
A as default
|
|
288
277
|
};
|
|
289
278
|
//# sourceMappingURL=data.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"data.js","sources":["../../../node_modules/uid/dist/index.mjs","../../../src/modules/data/data.ts"],"sourcesContent":["var IDX=256, HEX=[], SIZE=256, BUFFER;\nwhile (IDX--) HEX[IDX] = (IDX + 256).toString(16).substring(1);\n\nexport function uid(len) {\n\tvar i=0, tmp=(len || 11);\n\tif (!BUFFER || ((IDX + tmp) > SIZE*2)) {\n\t\tfor (BUFFER='',IDX=0; i < SIZE; i++) {\n\t\t\tBUFFER += HEX[Math.random() * 256 | 0];\n\t\t}\n\t}\n\n\treturn BUFFER.substring(IDX, IDX++ + tmp);\n}\n","import { uid } from 'uid'\nimport { Hsluv } from 'hsluv'\nimport chroma from 'chroma-js'\nimport {\n LibraryData,\n PaletteData,\n PaletteDataColorItem,\n PaletteDataThemeItem,\n} from '@tps/data.types'\nimport {\n MetaConfiguration,\n BaseConfiguration,\n ScaleConfiguration,\n ThemeConfiguration,\n FullConfiguration,\n} from '@tps/configuration.types'\nimport { Channel, HexModel } from '@tps/color.types'\nimport Color from '@modules/color/color'\n\nexport default class Data {\n private base: BaseConfiguration\n private themes: Array<ThemeConfiguration>\n private meta?: MetaConfiguration\n private paletteData: PaletteData\n private currentScale: ScaleConfiguration\n\n constructor({\n base,\n themes,\n meta,\n }: {\n base: BaseConfiguration\n themes: Array<ThemeConfiguration>\n meta?: MetaConfiguration\n }) {\n this.base = base\n this.themes = themes\n this.meta = meta\n this.paletteData = {\n name: base.name ?? 'UI Color Palette',\n description: base.description,\n themes: [],\n type: 'palette',\n }\n this.currentScale =\n themes.find((theme) => theme.isEnabled)?.scale ??\n ({} as ScaleConfiguration)\n }\n\n makePaletteData = () => {\n this.themes.forEach((theme) => {\n const paletteDataThemeItem: PaletteDataThemeItem = {\n id: theme.id,\n name: theme.name,\n description: theme.description,\n colors: [],\n type: theme.type,\n }\n this.base.colors.forEach((color) => {\n const scaledColors = Object.entries(theme.scale)\n .reverse()\n .map((lightness) => {\n if (color.alpha.isEnabled) {\n const foregroundColorData = new Color({\n render: 'RGB',\n sourceColor: [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ],\n alpha: parseFloat((lightness[1] / 100).toFixed(2)),\n hueShifting:\n color.hue.shift !== undefined ? color.hue.shift : 0,\n chromaShifting:\n color.chroma.shift !== undefined ? color.chroma.shift : 100,\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n const backgroundColorData = new Color({\n render: 'RGB',\n sourceColor: chroma(color.alpha.backgroundColor).rgb(),\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n\n switch (this.base.colorSpace) {\n case 'LCH':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.lcha(),\n backgroundColorData.lcha(),\n ]\n case 'OKLCH':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.oklcha(),\n backgroundColorData.oklcha(),\n ]\n case 'LAB':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.laba(),\n backgroundColorData.laba(),\n ]\n case 'OKLAB':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.oklaba(),\n backgroundColorData.oklaba(),\n ]\n case 'HSL':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.hsla(),\n backgroundColorData.hsla(),\n ]\n case 'HSLUV':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.hsluva(),\n backgroundColorData.hsluva(),\n ]\n default:\n return [lightness, [0, 0, 0], [255, 255, 255]]\n }\n } else {\n const colorData = new Color({\n render: 'RGB',\n sourceColor: [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ],\n lightness: lightness[1],\n hueShifting:\n color.hue.shift !== undefined ? color.hue.shift : 0,\n chromaShifting:\n color.chroma.shift !== undefined ? color.chroma.shift : 100,\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n\n switch (this.base.colorSpace) {\n case 'LCH':\n return [lightness, colorData.lch()]\n case 'OKLCH':\n return [lightness, colorData.oklch()]\n case 'LAB':\n return [lightness, colorData.lab()]\n case 'OKLAB':\n return [lightness, colorData.oklab()]\n case 'HSL':\n return [lightness, colorData.hsl()]\n case 'HSLUV':\n return [lightness, colorData.hsluv()]\n default:\n return [lightness, [0, 0, 0]]\n }\n }\n })\n\n const paletteDataColorItem: PaletteDataColorItem = {\n id: color.id,\n name: color.name,\n description: color.description,\n shades: [],\n type: 'color',\n },\n sourceColor: Channel = [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ]\n\n const sourceHsluv = new Hsluv()\n sourceHsluv.rgb_r = color.rgb.r\n sourceHsluv.rgb_g = color.rgb.g\n sourceHsluv.rgb_b = color.rgb.b\n sourceHsluv.rgbToHsluv()\n\n paletteDataColorItem.shades.push({\n id: uid(),\n name: 'source',\n description: 'Source color',\n hex: chroma(sourceColor).hex(),\n rgb: sourceColor,\n gl: chroma(sourceColor).gl(),\n lch: chroma(sourceColor).lch(),\n oklch: chroma(sourceColor).oklch(),\n lab: chroma(sourceColor).lab(),\n oklab: chroma(sourceColor).oklab(),\n hsl: chroma(sourceColor).hsl(),\n hsluv: [\n sourceHsluv.hsluv_h,\n sourceHsluv.hsluv_s,\n sourceHsluv.hsluv_l,\n ],\n type: 'source color',\n })\n\n const distances = scaledColors.map((shade) =>\n chroma.distance(\n chroma(sourceColor).hex(),\n chroma(shade[1] as Channel).hex(),\n 'rgb'\n )\n )\n const minDistanceIndex = distances.indexOf(Math.min(...distances))\n\n scaledColors.forEach((scaledColor, index) => {\n const distance: number = chroma.distance(\n chroma(sourceColor).hex(),\n chroma(scaledColor[1] as Channel).hex(),\n 'rgb'\n )\n const scaleName: string =\n Object.keys(this.currentScale).find(\n (key) => key === scaledColor[0][0]\n ) ?? '0'\n const newHsluv = new Hsluv()\n const simulatedSourceColorRgb = new Color({\n render: 'RGB',\n sourceColor: chroma(sourceColor).rgb(),\n visionSimulationMode: theme.visionSimulationMode,\n }).setColor() as Channel\n const simulatedSourceColorHex = new Color({\n render: 'HEX',\n sourceColor: chroma(sourceColor).rgb(),\n visionSimulationMode: theme.visionSimulationMode,\n }).setColor() as HexModel\n\n if (\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ) {\n newHsluv.rgb_r = Number(simulatedSourceColorRgb[0]) / 255\n newHsluv.rgb_g = Number(simulatedSourceColorRgb[1]) / 255\n newHsluv.rgb_b = Number(simulatedSourceColorRgb[2]) / 255\n } else {\n newHsluv.rgb_r = Number(scaledColor[1][0]) / 255\n newHsluv.rgb_g = Number(scaledColor[1][1]) / 255\n newHsluv.rgb_b = Number(scaledColor[1][2]) / 255\n }\n newHsluv.rgbToHsluv()\n\n paletteDataColorItem.shades.push({\n id: uid(),\n name: scaleName,\n description: `Shade color with ${typeof scaledColor[0][1] === 'number' ? scaledColor[0][1].toFixed(1) : scaledColor[0][1]}% of ${\n color.alpha.isEnabled ? 'opacity' : 'lightness'\n }`,\n hex:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).hex()\n : chroma(scaledColor[1] as Channel).hex(),\n rgb:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).rgb()\n : chroma(scaledColor[1] as Channel).rgb(),\n gl:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).gl()\n : chroma(scaledColor[1] as Channel).gl(),\n lch:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).lch()\n : chroma(scaledColor[1] as Channel).lch(),\n oklch:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).oklch()\n : chroma(scaledColor[1] as Channel).oklch(),\n lab:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).lab()\n : chroma(scaledColor[1] as Channel).lab(),\n oklab:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).oklab()\n : chroma(scaledColor[1] as Channel).oklab(),\n hsl:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).hsl()\n : chroma(scaledColor[1] as Channel).hsl(),\n hsluv: [newHsluv.hsluv_h, newHsluv.hsluv_s, newHsluv.hsluv_l],\n alpha: color.alpha.isEnabled\n ? parseFloat(((scaledColor[0][1] as number) / 100).toFixed(2))\n : undefined,\n backgroundColor:\n color.alpha.isEnabled && color.alpha.backgroundColor\n ? chroma(scaledColor[2] as Channel).rgb()\n : undefined,\n mixedColor:\n color.alpha.isEnabled && color.alpha.backgroundColor\n ? new Color({\n visionSimulationMode: theme.visionSimulationMode,\n }).mixColorsRgb(\n [\n ...(scaledColor[1] as Channel),\n parseFloat(\n ((scaledColor[0][1] as number) / 100).toFixed(2)\n ),\n ],\n [...(scaledColor[2] as Channel), 1]\n )\n : undefined,\n isClosestToRef: distance < 4 && !this.base.areSourceColorsLocked,\n isSourceColorLocked:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled,\n isTransparent: color.alpha.isEnabled,\n type: 'color shade',\n })\n })\n\n paletteDataThemeItem.colors.push(paletteDataColorItem)\n })\n this.paletteData.themes.push(paletteDataThemeItem)\n })\n\n return this.paletteData\n }\n\n makeLibraryData = (\n options?: Array<\n | 'collection_id'\n | 'mode_id'\n | 'variable_id'\n | 'style_id'\n | 'gl'\n | 'hex'\n | 'description'\n >,\n previousData?: Array<LibraryData>\n ) => {\n const paletteData = this.makePaletteData()\n const workingThemes =\n paletteData.themes.filter((theme) => theme.type === 'custom theme')\n .length === 0\n ? paletteData.themes.filter((theme) => theme.type === 'default theme')\n : paletteData.themes.filter((theme) => theme.type === 'custom theme')\n\n const libraryData: Array<LibraryData> = workingThemes.flatMap((theme) => {\n return theme.colors.flatMap((color) =>\n color.shades.flatMap((shade) => {\n const path =\n workingThemes[0].type === 'custom theme'\n ? `${\n paletteData.name === '' ? '' : paletteData.name + ' / '\n }${theme.name} / ${color.name}`\n : `${paletteData.name === '' ? '' : paletteData.name} / ${\n color.name\n }`\n\n const previousItem = previousData?.find(\n (item) => item.id === shade.id\n )\n\n return {\n id: previousItem?.id || shade.id,\n name: shade.name,\n path: path,\n alpha: shade.alpha,\n ...(options?.includes('hex') && { hex: shade.hex }),\n ...(options?.includes('gl') && { gl: shade.gl }),\n ...(options?.includes('description') && {\n description: shade.description,\n }),\n ...(options?.includes('collection_id') && {\n collectionId: previousItem?.collectionId,\n }),\n ...(options?.includes('mode_id') && {\n modeId: previousItem?.modeId,\n }),\n ...(options?.includes('variable_id') && {\n variableId: previousItem?.variableId,\n }),\n ...(options?.includes('style_id') && {\n styleId: previousItem?.styleId,\n }),\n }\n })\n )\n })\n\n return libraryData\n }\n\n makePaletteFullData = () => {\n const fullPaletteData = {\n base: this.base,\n themes: this.themes,\n libraryData: this.makeLibraryData(),\n meta: this.meta,\n type: 'UI_COLOR_PALETTE',\n } as FullConfiguration\n\n return fullPaletteData\n }\n}\n"],"names":["IDX","HEX","SIZE","BUFFER","uid","len","i","tmp","Data","base","themes","meta","__publicField","theme","paletteDataThemeItem","color","scaledColors","lightness","foregroundColorData","Color","backgroundColorData","chroma","colorData","paletteDataColorItem","sourceColor","sourceHsluv","Hsluv","distances","shade","minDistanceIndex","scaledColor","index","distance","scaleName","key","newHsluv","simulatedSourceColorRgb","simulatedSourceColorHex","options","previousData","paletteData","workingThemes","path","previousItem","item","_a"],"mappings":";;;;;AAAA,IAAIA,IAAI,KAAK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AS,SAAS,mBAAkB;AAAA,cACtC,YAAYK,KAAA,gBAAAA,EAAc;AAAA,YAC5B;AAAA,YACA,IAAIL,KAAA,gBAAAA,EAAS,SAAS,gBAAe;AAAA,cACnC,SAASK,KAAA,gBAAAA,EAAc;AAAA,YAAA;AAAA,UAE3B;AAAA,QACD,CAAA;AAAA,MACH,CACD;AAAA,IAGH;AAEA,IAAA/B,EAAA,6BAAsB,OACI;AAAA,MACtB,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,aAAa,KAAK,gBAAgB;AAAA,MAClC,MAAM,KAAK;AAAA,MACX,MAAM;AAAA,IACR;;AA7ZA,SAAK,OAAOH,GACZ,KAAK,SAASC,GACd,KAAK,OAAOC,GACZ,KAAK,cAAc;AAAA,MACjB,MAAMF,EAAK,QAAQ;AAAA,MACnB,aAAaA,EAAK;AAAA,MAClB,QAAQ,CAAC;AAAA,MACT,MAAM;AAAA,IACR,GACK,KAAA,iBACHoC,IAAAnC,EAAO,KAAK,CAACG,MAAUA,EAAM,SAAS,MAAtC,gBAAAgC,EAAyC,UACxC,CAAC;AAAA,EAAA;AAsZR;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"data.js","sources":["../../../src/modules/data/data.ts"],"sourcesContent":["import { Hsluv } from 'hsluv'\nimport chroma from 'chroma-js'\nimport {\n LibraryData,\n PaletteData,\n PaletteDataColorItem,\n PaletteDataThemeItem,\n} from '@tps/data.types'\nimport {\n MetaConfiguration,\n BaseConfiguration,\n ScaleConfiguration,\n ThemeConfiguration,\n FullConfiguration,\n} from '@tps/configuration.types'\nimport { Channel, HexModel } from '@tps/color.types'\nimport Color from '@modules/color/color'\n\nexport default class Data {\n private base: BaseConfiguration\n private themes: Array<ThemeConfiguration>\n private meta?: MetaConfiguration\n private paletteData: PaletteData\n private currentScale: ScaleConfiguration\n\n constructor({\n base,\n themes,\n meta,\n }: {\n base: BaseConfiguration\n themes: Array<ThemeConfiguration>\n meta?: MetaConfiguration\n }) {\n this.base = base\n this.themes = themes\n this.meta = meta\n this.paletteData = {\n name: base.name ?? 'UI Color Palette',\n description: base.description,\n themes: [],\n type: 'palette',\n }\n this.currentScale =\n themes.find((theme) => theme.isEnabled)?.scale ??\n ({} as ScaleConfiguration)\n }\n\n makePaletteData = () => {\n this.themes.forEach((theme) => {\n const paletteDataThemeItem: PaletteDataThemeItem = {\n id: theme.id,\n name: theme.name,\n description: theme.description,\n colors: [],\n type: theme.type,\n }\n this.base.colors.forEach((color) => {\n const scaledColors = Object.entries(theme.scale)\n .reverse()\n .map((lightness) => {\n if (color.alpha.isEnabled) {\n const foregroundColorData = new Color({\n render: 'RGB',\n sourceColor: [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ],\n alpha: parseFloat((lightness[1] / 100).toFixed(2)),\n hueShifting:\n color.hue.shift !== undefined ? color.hue.shift : 0,\n chromaShifting:\n color.chroma.shift !== undefined ? color.chroma.shift : 100,\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n const backgroundColorData = new Color({\n render: 'RGB',\n sourceColor: chroma(color.alpha.backgroundColor).rgb(),\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n\n switch (this.base.colorSpace) {\n case 'LCH':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.lcha(),\n backgroundColorData.lcha(),\n ]\n case 'OKLCH':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.oklcha(),\n backgroundColorData.oklcha(),\n ]\n case 'LAB':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.laba(),\n backgroundColorData.laba(),\n ]\n case 'OKLAB':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.oklaba(),\n backgroundColorData.oklaba(),\n ]\n case 'HSL':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.hsla(),\n backgroundColorData.hsla(),\n ]\n case 'HSLUV':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.hsluva(),\n backgroundColorData.hsluva(),\n ]\n default:\n return [lightness, [0, 0, 0], [255, 255, 255]]\n }\n } else {\n const colorData = new Color({\n render: 'RGB',\n sourceColor: [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ],\n lightness: lightness[1],\n hueShifting:\n color.hue.shift !== undefined ? color.hue.shift : 0,\n chromaShifting:\n color.chroma.shift !== undefined ? color.chroma.shift : 100,\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n\n switch (this.base.colorSpace) {\n case 'LCH':\n return [lightness, colorData.lch()]\n case 'OKLCH':\n return [lightness, colorData.oklch()]\n case 'LAB':\n return [lightness, colorData.lab()]\n case 'OKLAB':\n return [lightness, colorData.oklab()]\n case 'HSL':\n return [lightness, colorData.hsl()]\n case 'HSLUV':\n return [lightness, colorData.hsluv()]\n default:\n return [lightness, [0, 0, 0]]\n }\n }\n })\n\n const paletteDataColorItem: PaletteDataColorItem = {\n id: color.id,\n name: color.name,\n description: color.description,\n shades: [],\n type: 'color',\n },\n sourceColor: Channel = [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ]\n\n const sourceHsluv = new Hsluv()\n sourceHsluv.rgb_r = color.rgb.r\n sourceHsluv.rgb_g = color.rgb.g\n sourceHsluv.rgb_b = color.rgb.b\n sourceHsluv.rgbToHsluv()\n\n paletteDataColorItem.shades.push({\n name: 'source',\n description: 'Source color',\n hex: chroma(sourceColor).hex(),\n rgb: sourceColor,\n gl: chroma(sourceColor).gl(),\n lch: chroma(sourceColor).lch(),\n oklch: chroma(sourceColor).oklch(),\n lab: chroma(sourceColor).lab(),\n oklab: chroma(sourceColor).oklab(),\n hsl: chroma(sourceColor).hsl(),\n hsluv: [\n sourceHsluv.hsluv_h,\n sourceHsluv.hsluv_s,\n sourceHsluv.hsluv_l,\n ],\n type: 'source color',\n })\n\n const distances = scaledColors.map((shade) =>\n chroma.distance(\n chroma(sourceColor).hex(),\n chroma(shade[1] as Channel).hex(),\n 'rgb'\n )\n )\n const minDistanceIndex = distances.indexOf(Math.min(...distances))\n\n scaledColors.forEach((scaledColor, index) => {\n const distance: number = chroma.distance(\n chroma(sourceColor).hex(),\n chroma(scaledColor[1] as Channel).hex(),\n 'rgb'\n )\n const scaleName: string =\n Object.keys(this.currentScale).find(\n (key) => key === scaledColor[0][0]\n ) ?? '0'\n const newHsluv = new Hsluv()\n const simulatedSourceColorRgb = new Color({\n render: 'RGB',\n sourceColor: chroma(sourceColor).rgb(),\n visionSimulationMode: theme.visionSimulationMode,\n }).setColor() as Channel\n const simulatedSourceColorHex = new Color({\n render: 'HEX',\n sourceColor: chroma(sourceColor).rgb(),\n visionSimulationMode: theme.visionSimulationMode,\n }).setColor() as HexModel\n\n if (\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ) {\n newHsluv.rgb_r = Number(simulatedSourceColorRgb[0]) / 255\n newHsluv.rgb_g = Number(simulatedSourceColorRgb[1]) / 255\n newHsluv.rgb_b = Number(simulatedSourceColorRgb[2]) / 255\n } else {\n newHsluv.rgb_r = Number(scaledColor[1][0]) / 255\n newHsluv.rgb_g = Number(scaledColor[1][1]) / 255\n newHsluv.rgb_b = Number(scaledColor[1][2]) / 255\n }\n newHsluv.rgbToHsluv()\n\n paletteDataColorItem.shades.push({\n name: scaleName,\n description: `Shade color with ${typeof scaledColor[0][1] === 'number' ? scaledColor[0][1].toFixed(1) : scaledColor[0][1]}% of ${\n color.alpha.isEnabled ? 'opacity' : 'lightness'\n }`,\n hex:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).hex()\n : chroma(scaledColor[1] as Channel).hex(),\n rgb:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).rgb()\n : chroma(scaledColor[1] as Channel).rgb(),\n gl:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).gl()\n : chroma(scaledColor[1] as Channel).gl(),\n lch:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).lch()\n : chroma(scaledColor[1] as Channel).lch(),\n oklch:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).oklch()\n : chroma(scaledColor[1] as Channel).oklch(),\n lab:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).lab()\n : chroma(scaledColor[1] as Channel).lab(),\n oklab:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).oklab()\n : chroma(scaledColor[1] as Channel).oklab(),\n hsl:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).hsl()\n : chroma(scaledColor[1] as Channel).hsl(),\n hsluv: [newHsluv.hsluv_h, newHsluv.hsluv_s, newHsluv.hsluv_l],\n alpha: color.alpha.isEnabled\n ? parseFloat(((scaledColor[0][1] as number) / 100).toFixed(2))\n : undefined,\n backgroundColor:\n color.alpha.isEnabled && color.alpha.backgroundColor\n ? chroma(scaledColor[2] as Channel).rgb()\n : undefined,\n mixedColor:\n color.alpha.isEnabled && color.alpha.backgroundColor\n ? new Color({\n visionSimulationMode: theme.visionSimulationMode,\n }).mixColorsRgb(\n [\n ...(scaledColor[1] as Channel),\n parseFloat(\n ((scaledColor[0][1] as number) / 100).toFixed(2)\n ),\n ],\n [...(scaledColor[2] as Channel), 1]\n )\n : undefined,\n isClosestToRef: distance < 4 && !this.base.areSourceColorsLocked,\n isSourceColorLocked:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled,\n isTransparent: color.alpha.isEnabled,\n type: 'color shade',\n })\n })\n\n paletteDataThemeItem.colors.push(paletteDataColorItem)\n })\n this.paletteData.themes.push(paletteDataThemeItem)\n })\n\n return this.paletteData\n }\n\n makeLibraryData = (\n options?: Array<\n | 'collection_id'\n | 'mode_id'\n | 'variable_id'\n | 'style_id'\n | 'gl'\n | 'hex'\n | 'description'\n >,\n previousData?: Array<LibraryData>\n ) => {\n const paletteData = this.makePaletteData()\n const workingThemes =\n paletteData.themes.filter((theme) => theme.type === 'custom theme')\n .length === 0\n ? paletteData.themes.filter((theme) => theme.type === 'default theme')\n : paletteData.themes.filter((theme) => theme.type === 'custom theme')\n\n const libraryData: Array<LibraryData> = workingThemes.flatMap((theme) => {\n return theme.colors.flatMap((color) =>\n color.shades.flatMap((shade) => {\n const path =\n workingThemes[0].type === 'custom theme'\n ? `${\n paletteData.name === '' ? '' : paletteData.name + ' / '\n }${theme.name} / ${color.name}`\n : `${paletteData.name === '' ? '' : paletteData.name} / ${\n color.name\n }`\n const generatedId = `${theme.id}:${color.id}:${shade.name}`\n\n const previousItem = previousData?.find(\n (item) => item.id === generatedId\n )\n\n return {\n id: generatedId,\n name: shade.name,\n path: path,\n hex: shade.hex,\n alpha: shade.alpha,\n ...(options?.includes('gl') && { gl: shade.gl }),\n ...(options?.includes('description') && {\n description: shade.description,\n }),\n ...(options?.includes('collection_id') && {\n collectionId: previousItem?.collectionId,\n }),\n ...(options?.includes('mode_id') && {\n modeId: previousItem?.modeId,\n }),\n ...(options?.includes('variable_id') && {\n variableId: previousItem?.variableId,\n }),\n ...(options?.includes('style_id') && {\n styleId: previousItem?.styleId,\n }),\n }\n })\n )\n })\n\n return libraryData\n }\n\n makePaletteFullData = () => {\n const fullPaletteData = {\n base: this.base,\n themes: this.themes,\n libraryData: this.makeLibraryData(),\n meta: this.meta,\n type: 'UI_COLOR_PALETTE',\n } as FullConfiguration\n\n return fullPaletteData\n }\n}\n"],"names":["Data","base","themes","meta","__publicField","theme","paletteDataThemeItem","color","scaledColors","lightness","foregroundColorData","Color","backgroundColorData","chroma","colorData","paletteDataColorItem","sourceColor","sourceHsluv","Hsluv","distances","shade","minDistanceIndex","scaledColor","index","distance","scaleName","key","newHsluv","simulatedSourceColorRgb","simulatedSourceColorHex","options","previousData","paletteData","workingThemes","path","generatedId","previousItem","item","_a"],"mappings":";;;;;AAkBA,MAAqBA,EAAK;AAAA,EAOxB,YAAY;AAAA,IACV,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,EAAA,GAKC;AAdK,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAyBR,IAAAA,EAAA,yBAAkB,OACX,KAAA,OAAO,QAAQ,CAACC,MAAU;AAC7B,YAAMC,IAA6C;AAAA,QACjD,IAAID,EAAM;AAAA,QACV,MAAMA,EAAM;AAAA,QACZ,aAAaA,EAAM;AAAA,QACnB,QAAQ,CAAC;AAAA,QACT,MAAMA,EAAM;AAAA,MACd;AACA,WAAK,KAAK,OAAO,QAAQ,CAACE,MAAU;AAC5B,cAAAC,IAAe,OAAO,QAAQH,EAAM,KAAK,EAC5C,QAAQ,EACR,IAAI,CAACI,MAAc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AE,KAAK,CAAC,kBAAkB,CAAC,CAAA;IACjC,MAAM,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAA;IACjC,WAAW,EAAE,uBAAuB,CAAA;IACpC,iBAAiB,EAAE,6BAA6B,CAAA;IAChD,cAAc,EAAE,MAAM,CAAA;IACtB,iBAAiB,EAAE,MAAM,CAAA;IACzB,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,OAAO,CAAA;CACnB"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@a_ng_d/utils-ui-color-palette",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.5",
|
|
5
5
|
"description": "Core utilities library for UI Color Palette - a color management plugin for design tools. This library provides the foundational color manipulation, contrast calculation, and palette generation features used in the plugin.",
|
|
6
6
|
"repository": {
|
|
7
7
|
"type": "git",
|
|
@@ -59,7 +59,6 @@
|
|
|
59
59
|
"@a_ng_d/figmug-utils": "^0.3.1",
|
|
60
60
|
"apca-w3": "^0.1.9",
|
|
61
61
|
"chroma-js": "^2.4.2",
|
|
62
|
-
"hsluv": "^1.0.1"
|
|
63
|
-
"uid": "^2.0.2"
|
|
62
|
+
"hsluv": "^1.0.1"
|
|
64
63
|
}
|
|
65
64
|
}
|