@a_ng_d/utils-ui-color-palette 1.5.15 → 1.6.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.
@@ -1,1079 +1,323 @@
1
- var N = Object.defineProperty;
2
- var w = (m, l, n) => l in m ? N(m, l, { enumerable: !0, configurable: !0, writable: !0, value: n }) : m[l] = n;
3
- var k = (m, l, n) => w(m, typeof l != "symbol" ? l + "" : l, n);
4
- import { C as x, H as M } from "../../color-1CXTuV84.js";
5
- import { c as u } from "../../index-Beb8qoyd.js";
6
- const S = (m) => {
7
- const l = m.themes.filter((a) => a.type === "custom theme").length === 0 ? m.themes.filter((a) => a.type === "default theme") : m.themes.filter((a) => a.type === "custom theme"), n = {}, t = (a) => (isNaN(a.hsl[0]) && (a.hsl[0] = 0), isNaN(a.lch[2]) && (a.lch[2] = 0), isNaN(a.oklch[2]) && (a.oklch[2] = 0), {
8
- rgb: {
9
- r: Math.floor(a.rgb[0]),
10
- g: Math.floor(a.rgb[1]),
11
- b: Math.floor(a.rgb[2])
12
- },
13
- gl: {
14
- r: parseFloat(a.gl[0].toFixed(3)),
15
- g: parseFloat(a.gl[1].toFixed(3)),
16
- b: parseFloat(a.gl[2].toFixed(3))
17
- },
18
- lch: {
19
- l: Math.floor(a.lch[0]),
20
- c: Math.floor(a.lch[1]),
21
- h: Math.floor(a.lch[2])
22
- },
23
- oklch: {
24
- l: parseFloat(a.oklch[0].toFixed(3)),
25
- c: parseFloat(a.oklch[1].toFixed(3)),
26
- h: Math.floor(a.oklch[2])
27
- },
28
- lab: {
29
- l: Math.floor(a.lab[0]),
30
- a: Math.floor(a.lab[1]),
31
- b: Math.floor(a.lab[2])
32
- },
33
- oklab: {
34
- l: parseFloat(a.oklab[0].toFixed(3)),
35
- a: parseFloat(a.oklab[1].toFixed(3)),
36
- b: parseFloat(a.oklab[2].toFixed(3))
37
- },
38
- hsl: {
39
- h: Math.floor(a.hsl[0]),
40
- s: Math.floor(a.hsl[1] * 100),
41
- l: Math.floor(a.hsl[2] * 100)
42
- },
43
- hsluv: {
44
- h: Math.floor(a.hsluv[0]),
45
- s: Math.floor(a.hsluv[1]),
46
- l: Math.floor(a.hsluv[2])
47
- },
48
- hex: a.hex,
49
- description: a.description,
50
- type: "color shade/tint"
51
- }), i = (a, e) => ({
52
- rgb: {
53
- r: Math.floor(e.rgb[0]),
54
- g: Math.floor(e.rgb[1]),
55
- b: Math.floor(e.rgb[2])
56
- },
57
- gl: {
58
- r: parseFloat(e.gl[0].toFixed(3)),
59
- g: parseFloat(e.gl[1].toFixed(3)),
60
- b: parseFloat(e.gl[2].toFixed(3))
61
- },
62
- lch: {
63
- l: Math.floor(e.lch[0]),
64
- c: Math.floor(e.lch[1]),
65
- h: Math.floor(e.lch[2])
66
- },
67
- oklch: {
68
- l: parseFloat(e.oklch[0].toFixed(3)),
69
- c: parseFloat(e.oklch[1].toFixed(3)),
70
- h: Math.floor(e.oklch[2])
71
- },
72
- lab: {
73
- l: Math.floor(e.lab[0]),
74
- a: Math.floor(e.lab[1]),
75
- b: Math.floor(e.lab[2])
76
- },
77
- oklab: {
78
- l: parseFloat(e.oklab[0].toFixed(3)),
79
- a: parseFloat(e.oklab[1].toFixed(3)),
80
- b: parseFloat(e.oklab[2].toFixed(3))
81
- },
82
- hsl: {
83
- h: Math.floor(e.hsl[0]),
84
- s: Math.floor(e.hsl[1] * 100),
85
- l: Math.floor(e.hsl[2] * 100)
86
- },
87
- hsluv: {
88
- h: Math.floor(e.hsluv[0]),
89
- s: Math.floor(e.hsluv[1]),
90
- l: Math.floor(e.hsluv[2])
91
- },
92
- hex: e.hex,
93
- alpha: a.alpha,
94
- description: a.description,
95
- type: "color shade/tint"
96
- });
97
- return l[0].type === "custom theme" ? l.forEach((a) => {
98
- n[a.name] = {}, a.colors.forEach((e) => {
99
- const o = e.shades.find(
100
- (c) => c.type === "source color"
101
- );
102
- n[a.name][e.name] = {}, e.shades.forEach((c) => {
103
- c && o && (n[a.name][e.name][c.name] = c.isTransparent ? i(c, o) : t(c));
104
- }), n[a.name][e.name].description = e.description, n[a.name][e.name].type = "color";
105
- }), n[a.name].description = a.description, n[a.name].type = "color mode";
106
- }) : l.forEach((a) => {
107
- a.colors.forEach((e) => {
108
- const o = e.shades.find(
109
- (c) => c.type === "source color"
110
- );
111
- n[e.name] = {}, e.shades.forEach((c) => {
112
- c && o && (n[e.name][c.name] = c.isTransparent ? i(c, o) : t(c));
113
- }), n[e.name].description = e.description, n[e.name].type = "color";
114
- });
115
- }), n.description = m.description, n.type = "color palette", JSON.stringify(n, null, " ");
116
- };
117
- var v = Object.defineProperty, T = (m, l, n) => l in m ? v(m, l, { enumerable: !0, configurable: !0, writable: !0, value: n }) : m[l] = n, y = (m, l, n) => T(m, typeof l != "symbol" ? l + "" : l, n);
118
- class b {
119
- constructor(l) {
120
- y(this, "string"), y(this, "doSnakeCase", () => this.string.toLowerCase().split(" ").join("_").replace(/[@/$^%#&!?.,;:+=<>(){}"«»]/g, "")), y(this, "doPascalCase", () => this.string.charAt(0).toUpperCase() + this.string.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (n) => n.toUpperCase()).replace(/[@/$^%#&!?.,;:+=<>(){}"«» ]/g, "").slice(1)), y(this, "doKebabCase", () => this.string.toLowerCase().split(" ").join("-").replace(/[@/$^%#&!?.,;:+=<>(){}"«»]/g, "")), y(this, "doCamelCase", () => this.string.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (n) => n.toUpperCase()).replace(/[@/$^%#&!?.,;:+=<>(){}"«» ]/g, "")), this.string = l;
121
- }
122
- }
123
- const L = (m) => {
124
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = [];
125
- return l.forEach((t) => {
126
- const i = [];
127
- t.colors.forEach((a) => {
128
- const e = a.shades.find((o) => o.type === "source color");
129
- i.push(`// ${a.name}`), a.shades.reverse().forEach((o) => {
130
- i.push(
131
- o.isTransparent ? `static let ${new b(a.name).doPascalCase()}${o.name === "source" ? "Source" : o.name} = UIColor(red: ${e == null ? void 0 : e.gl[0].toFixed(
132
- 3
133
- )}, green: ${e == null ? void 0 : e.gl[1].toFixed(3)}, blue: ${e == null ? void 0 : e.gl[2].toFixed(
134
- 3
135
- )}, alpha: ${o.alpha ?? 1})` : `static let ${new b(a.name).doPascalCase()}${o.name === "source" ? "Source" : o.name} = UIColor(red: ${o.gl[0].toFixed(
136
- 3
137
- )}, green: ${o.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
138
- 3
139
- )})`
140
- );
141
- }), i.push("");
142
- }), i.pop(), l[0].type === "custom theme" ? n.push(
143
- `// ${t.name}
144
- struct ${new b(t.name).doPascalCase()} {
145
- ${i.join(
146
- `
147
- `
148
- )}
149
- }`
150
- ) : n.push(`${i.join(`
151
- `)}`);
152
- }), `import UIKit
153
-
154
- struct Color {
155
- ${n.join(`
156
-
157
- `)}
158
- }`;
159
- }, H = (m) => {
160
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme");
161
- let n = `@import "tailwindcss";
162
-
163
- @theme {
164
- --color-*: initial;
165
-
166
- `;
167
- return l[0].type !== "custom theme" ? l.forEach((t) => {
168
- t.colors.forEach((i) => {
169
- const a = i.shades.find(
170
- (r) => r.type === "source color"
171
- ), e = new b(i.name).doKebabCase();
172
- n += ` /* ${i.name} */
173
- `, i.shades.sort().forEach((r) => {
174
- const h = r.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(r.alpha ?? 1).hex() : r.hex, s = new b(r.name).doKebabCase();
175
- n += ` --color-${e}-${s}: ${h};
176
- `;
177
- });
178
- const o = i === t.colors[t.colors.length - 1], c = t === l[l.length - 1];
179
- o && c || (n += `
180
- `);
181
- });
182
- }) : l.forEach((t) => {
183
- const i = new b(t.name).doKebabCase();
184
- t.colors.forEach((a) => {
185
- const e = a.shades.find(
186
- (h) => h.type === "source color"
187
- ), o = new b(a.name).doKebabCase();
188
- n += ` /* ${t.name} - ${a.name} */
189
- `, a.shades.forEach((h) => {
190
- const s = h.isTransparent ? u((e == null ? void 0 : e.hex) ?? "#000000").alpha(h.alpha ?? 1).hex() : h.hex, p = new b(h.name).doKebabCase();
191
- n += ` --color-${i}-${o}-${p}: ${s};
192
- `;
193
- });
194
- const c = a === t.colors[t.colors.length - 1], r = t === l[l.length - 1];
195
- c && r || (n += `
196
- `);
197
- });
198
- }), n += `}
199
- `, n;
200
- }, K = (m) => {
201
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = {
202
- theme: {
203
- colors: {}
204
- }
205
- };
206
- return m.themes[0].colors.forEach((t) => {
207
- n.theme.colors[new b(t.name).doKebabCase()] = {};
208
- }), l[0].type === "custom theme" ? l.forEach((t) => {
209
- t.colors.forEach((i) => {
210
- const a = i.shades.find(
211
- (e) => e.type === "source color"
212
- );
213
- n.theme.colors[new b(i.name).doKebabCase()][new b(t.name).doKebabCase()] = {}, i.shades.forEach((e) => {
214
- n.theme.colors[new b(i.name).doKebabCase()][new b(t.name).doKebabCase()][new b(e.name).doKebabCase()] = e.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
215
- });
216
- });
217
- }) : l.forEach((t) => {
218
- t.colors.forEach((i) => {
219
- const a = i.shades.find(
220
- (e) => e.type === "source color"
221
- );
222
- n.theme.colors[new b(i.name).doKebabCase()] = {}, i.shades.sort().forEach((e) => {
223
- n.theme.colors[new b(i.name).doKebabCase()][new b(e.name).doKebabCase()] = e.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
224
- });
225
- });
226
- }), `module.exports = ${JSON.stringify(n, null, " ")}`;
227
- }, A = (m) => {
228
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = [];
229
- return l.forEach((t) => {
230
- t.colors.forEach((i) => {
231
- const a = i.shades.find((o) => o.type === "source color"), e = [];
232
- e.push(
233
- `// ${l[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
234
- ), i.shades.reverse().forEach((o) => {
235
- e.push(
236
- o.isTransparent ? `public let ${l[0].type === "custom theme" ? new b(t.name + " " + i.name).doPascalCase() : new b(i.name).doPascalCase()}${o.name === "source" ? "Source" : o.name} = Color(red: ${a == null ? void 0 : a.gl[0].toFixed(
237
- 3
238
- )}, green: ${a == null ? void 0 : a.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
239
- 3
240
- )}).opacity(${o.alpha ?? 1})` : `public let ${l[0].type === "custom theme" ? new b(t.name + " " + i.name).doPascalCase() : new b(i.name).doPascalCase()}${o.name === "source" ? "Source" : o.name} = Color(red: ${o.gl[0].toFixed(
241
- 3
242
- )}, green: ${o.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
243
- 3
244
- )})`
245
- );
246
- }), e.push(""), e.forEach((o) => n.push(o));
247
- });
248
- }), n.pop(), `import SwiftUI
249
-
250
- public extension Color {
251
- static let Token = Color.TokenColor()
252
- struct TokenColor {
253
- ${n.join(
254
- `
255
- `
256
- )}
257
- }
258
- }`;
259
- }, V = (m) => {
260
- const l = m.themes.filter((i) => i.type === "custom theme").length === 0 ? m.themes.filter((i) => i.type === "default theme") : m.themes.filter((i) => i.type === "custom theme"), n = {
261
- color: {}
262
- }, t = (i, a, e) => ({
263
- type: "color",
264
- value: a.isTransparent ? u(e.hex).alpha(a.alpha ?? 1).hex() : a.hex,
265
- comment: i.description !== "" ? i.description + " - " + a.description : a.description
266
- });
267
- return m.themes[0].colors.forEach((i) => {
268
- n.color[i.name] = {};
269
- }), l[0].type === "custom theme" ? l.forEach((i) => {
270
- i.colors.forEach((a) => {
271
- const e = a.shades.find(
272
- (o) => o.type === "source color"
273
- );
274
- n.color[a.name][i.name] = {}, a.shades.forEach((o) => {
275
- o && e && (n.color[a.name][i.name][o.name] = t(
276
- a,
277
- o,
278
- e
279
- ));
280
- });
281
- });
282
- }) : l.forEach((i) => {
283
- i.colors.forEach((a) => {
284
- const e = a.shades.find(
285
- (o) => o.type === "source color"
286
- );
287
- n.color[a.name] = {}, a.shades.forEach((o) => {
288
- o && e && (n.color[a.name][o.name] = t(a, o, e));
289
- });
290
- });
291
- }), JSON.stringify(n, null, " ");
292
- }, P = (m, l) => {
293
- const n = m.themes.filter((s) => s.type === "custom theme").length === 0 ? m.themes.filter((s) => s.type === "default theme") : m.themes.filter((s) => s.type === "custom theme"), t = [], i = [], a = (s) => {
294
- var f;
295
- isNaN(s.hsl[0]) && (s.hsl[0] = 0), isNaN(s.lch[2]) && (s.lch[2] = 0), isNaN(s.oklch[2]) && (s.oklch[2] = 0);
296
- const p = {
297
- RGB: () => `rgb(${Math.floor(s.rgb[0])}, ${Math.floor(
298
- s.rgb[1]
299
- )}, ${Math.floor(s.rgb[2])})`,
300
- HEX: () => s.hex,
301
- HSL: () => `hsl(${Math.floor(s.hsl[0])} ${Math.floor(
302
- s.hsl[1] * 100
303
- )}% ${Math.floor(s.hsl[2] * 100)}%)`,
304
- LCH: () => `lch(${Math.floor(s.lch[0])}% ${Math.floor(
305
- s.lch[1]
306
- )} ${Math.floor(s.lch[2])})`,
307
- OKLCH: () => `oklch(${Math.floor(s.oklch[0] * 100)}% ${s.oklch[1].toFixed(3)} ${Math.floor(s.oklch[2])})`
308
- };
309
- return (f = p[l ?? "RGB"]) == null ? void 0 : f.call(p);
310
- }, e = (s, p) => {
311
- var $;
312
- isNaN(s.hsl[0]) && (s.hsl[0] = 0), isNaN(s.lch[2]) && (s.lch[2] = 0), isNaN(s.oklch[2]) && (s.oklch[2] = 0);
313
- const f = {
314
- RGB: () => {
315
- var g;
316
- return `rgba(${Math.floor(p.rgb[0])}, ${Math.floor(
317
- p.rgb[1]
318
- )}, ${Math.floor(p.rgb[2])}, ${((g = s.alpha) == null ? void 0 : g.toFixed(2)) ?? 1})`;
319
- },
320
- HEX: () => u(p.hex).alpha(s.alpha ?? 1).hex(),
321
- HSL: () => {
322
- var g;
323
- return `hsla(${Math.floor(p.hsl[0])} ${Math.floor(
324
- p.hsl[1] * 100
325
- )}%, ${Math.floor(p.hsl[2] * 100)}% ${((g = s.alpha) == null ? void 0 : g.toFixed(2)) ?? 1})`;
326
- },
327
- LCH: () => {
328
- var g;
329
- return `lch(${Math.floor(p.lch[0])}% ${Math.floor(
330
- p.lch[1]
331
- )} ${Math.floor(p.lch[2])} / ${((g = s.alpha) == null ? void 0 : g.toFixed(2)) ?? 1})`;
332
- },
333
- OKLCH: () => {
334
- var g;
335
- return `oklch(${Math.floor(p.oklch[0 * 100])}% ${p.oklch[1].toFixed(3)} ${Math.floor(p.oklch[2])} / ${((g = s.alpha) == null ? void 0 : g.toFixed(2)) ?? 1})`;
336
- }
337
- };
338
- return ($ = f[l ?? "RGB"]) == null ? void 0 : $.call(f);
339
- }, o = n.find(
340
- (s) => s.type === "default theme"
341
- );
342
- if (o) {
343
- const s = [];
344
- return o.colors.forEach((p, f) => {
345
- f > 0 && s.push(""), s.push(`// ${p.name}`), p.shades.reverse().forEach(($) => {
346
- const g = p.shades.find((C) => C.type === "source color"), d = `$${new b(p.name).doKebabCase()}-${$.name}`;
347
- g && s.push(
348
- `${d}: ${$.isTransparent ? e($, g) : a($)};`
349
- );
350
- });
351
- }), t.push(s.join(`
352
- `)), t.join(`
353
- `);
354
- }
355
- n.forEach((s) => {
356
- const p = new b(s.name).doKebabCase(), f = [];
357
- f.push(`// ${s.name}`), f.push(`@mixin ${p} {`), s.colors.forEach(($, g) => {
358
- g > 0 && f.push(""), f.push(` // ${$.name}`), $.shades.reverse().forEach((d) => {
359
- const C = $.shades.find((F) => F.type === "source color"), E = `--${new b($.name).doKebabCase()}-${d.name}`;
360
- C && f.push(
361
- ` ${E}: ${d.isTransparent ? e(d, C) : a(d)};`
362
- );
363
- });
364
- }), f.push("}"), t.push(f.join(`
365
- `));
366
- });
367
- const c = /* @__PURE__ */ new Set();
368
- if (n.forEach((s) => {
369
- s.colors.forEach((p) => {
370
- p.shades.forEach((f) => {
371
- if (p.shades.find((g) => g.type === "source color")) {
372
- const d = `--${new b(p.name).doKebabCase()}-${f.name}`;
373
- c.add(d);
374
- }
375
- });
376
- });
377
- }), c.size > 0) {
378
- const s = /* @__PURE__ */ new Map();
379
- c.forEach((p) => {
380
- const f = p.match(/--([a-zA-Z0-9-]+)-([a-zA-Z0-9-]+)/);
381
- if (f) {
382
- const $ = f[1];
383
- s.has($) || s.set($, []);
384
- const g = `$${p.substring(2)}`;
385
- s.get($).push(`${g}: var(${p});`);
386
- }
387
- }), s.forEach((p, f) => {
388
- i.push(
389
- `// ${f.charAt(0).toUpperCase() + f.slice(1)}`
390
- ), i.push(...p), i.push("");
391
- }), i.length > 0 && i[i.length - 1] === "" && i.pop(), t.push(i.join(`
392
- `));
393
- }
394
- const r = [":root {"];
395
- n.forEach((s, p) => {
396
- const f = new b(s.name).doKebabCase();
397
- r.push(` &[data-theme="${f}"] {
398
- @include ${f};
399
- }`), p !== n.length - 1 && r.push("");
400
- }), r.push("}"), t.push(r.join(`
401
- `));
402
- const h = [];
403
- return n.forEach((s) => {
404
- const p = new b(s.name).doKebabCase();
405
- h.push(`.${p} {
406
- @include ${p};
407
- }`);
408
- }), t.push(h.join(`
409
-
410
- `)), t.join(`
411
-
412
- `);
413
- }, j = (m) => {
414
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = [];
415
- return l.forEach((t) => {
416
- t.colors.forEach((i) => {
417
- const a = i.shades.find((o) => o.type === "source color"), e = [];
418
- e.push(
419
- `<!--${l[0].type === "custom theme" ? `${t.name} - ${i.name}-->` : `${i.name}-->`}`
420
- ), i.shades.reverse().forEach((o) => {
421
- e.push(
422
- `<color name="${l[0].type === "custom theme" ? new b(t.name + " " + i.name).doSnakeCase() : new b(i.name).doSnakeCase()}_${o.name}">${o.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(o.alpha ?? 1).hex() : o.hex}</color>`
423
- );
424
- }), e.push(""), e.forEach((o) => n.push(o));
425
- });
426
- }), n.pop(), `<?xml version="1.0" encoding="utf-8"?>
427
- <resources>
428
- ${n.join(
429
- `
430
- `
431
- )}
432
- </resources>`;
433
- }, B = (m) => {
434
- const l = m.themes.filter((a) => a.type === "custom theme").length === 0 ? m.themes.filter((a) => a.type === "default theme") : m.themes.filter((a) => a.type === "custom theme"), n = {
435
- $themes: [],
436
- $metadata: {
437
- activeThemes: [],
438
- tokenSetOrder: [],
439
- activeSets: []
440
- }
441
- }, t = m.name, i = (a, e, o) => ({
442
- $type: "color",
443
- $value: e.isTransparent ? u(o.hex).alpha(e.alpha ?? 1).hex() : e.hex,
444
- $description: a.description !== "" ? a.description + " - " + e.description : e.description
445
- });
446
- return l[0].type === "custom theme" ? l.forEach((a) => {
447
- a.colors.forEach((e) => {
448
- const o = e.shades.find(
449
- (c) => c.type === "source color"
450
- );
451
- n[`${a.name}/${e.name}`] = {}, e.shades.forEach((c) => {
452
- c && o && (n[`${a.name}/${e.name}`][c.name] = i(
453
- e,
454
- c,
455
- o
456
- ));
457
- });
458
- });
459
- }) : l.forEach((a) => {
460
- a.colors.forEach((e) => {
461
- const o = e.shades.find(
462
- (c) => c.type === "source color"
463
- );
464
- n[`${t}/${e.name}`] = {}, e.shades.forEach((c) => {
465
- c && o && (n[`${t}/${e.name}`][c.name] = i(
466
- e,
467
- c,
468
- o
469
- ));
470
- });
471
- });
472
- }), JSON.stringify(n, null, " ");
473
- }, R = (m, l) => {
474
- const n = m.themes.filter((r) => r.type === "custom theme").length === 0 ? m.themes.filter((r) => r.type === "default theme") : m.themes.filter((r) => r.type === "custom theme"), t = [], i = (r) => {
475
- var s;
476
- isNaN(r.hsl[0]) && (r.hsl[0] = 0), isNaN(r.lch[2]) && (r.lch[2] = 0), isNaN(r.oklch[2]) && (r.oklch[2] = 0);
477
- const h = {
478
- RGB: () => `rgb(${Math.floor(r.rgb[0])}, ${Math.floor(
479
- r.rgb[1]
480
- )}, ${Math.floor(r.rgb[2])})`,
481
- HEX: () => r.hex,
482
- HSL: () => `hsl(${Math.floor(r.hsl[0])} ${Math.floor(
483
- r.hsl[1] * 100
484
- )}% ${Math.floor(r.hsl[2] * 100)}%)`,
485
- LCH: () => `lch(${Math.floor(r.lch[0])}% ${Math.floor(
486
- r.lch[1]
487
- )} ${Math.floor(r.lch[2])})`,
488
- OKLCH: () => `oklch(${Math.floor(r.oklch[0] * 100)}% ${r.oklch[1].toFixed(3)} ${Math.floor(r.oklch[2])})`
489
- };
490
- return (s = h[l ?? "RGB"]) == null ? void 0 : s.call(h);
491
- }, a = (r, h) => {
492
- var p;
493
- isNaN(r.hsl[0]) && (r.hsl[0] = 0), isNaN(r.lch[2]) && (r.lch[2] = 0), isNaN(r.oklch[2]) && (r.oklch[2] = 0);
494
- const s = {
495
- RGB: () => {
496
- var f;
497
- return `rgba(${Math.floor(h.rgb[0])}, ${Math.floor(
498
- h.rgb[1]
499
- )}, ${Math.floor(h.rgb[2])}, ${((f = r.alpha) == null ? void 0 : f.toFixed(2)) ?? 1})`;
500
- },
501
- HEX: () => u(h.hex).alpha(r.alpha ?? 1).hex(),
502
- HSL: () => {
503
- var f;
504
- return `hsla(${Math.floor(h.hsl[0])}, ${Math.floor(
505
- h.hsl[1] * 100
506
- )}% ${Math.floor(h.hsl[2] * 100)}% ${((f = r.alpha) == null ? void 0 : f.toFixed(2)) ?? 1})`;
507
- },
508
- LCH: () => {
509
- var f;
510
- return `lch(${Math.floor(h.lch[0])}% ${Math.floor(
511
- h.lch[1]
512
- )} ${Math.floor(h.lch[2])} / ${((f = r.alpha) == null ? void 0 : f.toFixed(2)) ?? 1})`;
513
- },
514
- OKLCH: () => {
515
- var f;
516
- return `oklch(${Math.floor(h.oklch[0] * 100)}% ${h.oklch[1].toFixed(3)} ${Math.floor(h.oklch[2])} / ${((f = r.alpha) == null ? void 0 : f.toFixed(2)) ?? 1})`;
517
- }
518
- };
519
- return (p = s[l ?? "RGB"]) == null ? void 0 : p.call(s);
520
- }, e = n.find(
521
- (r) => r.type === "default theme"
522
- );
523
- if (e) {
524
- const r = [];
525
- return e.colors.forEach((h, s) => {
526
- s > 0 && r.push(""), r.push(`// ${h.name}`), h.shades.reverse().forEach((p) => {
527
- const f = h.shades.find((g) => g.type === "source color"), $ = `@${new b(h.name).doKebabCase()}-${p.name}`;
528
- f && r.push(
529
- `${$}: ${p.isTransparent ? a(p, f) : i(p)};`
530
- );
531
- });
532
- }), t.push(r.join(`
533
- `)), t.join(`
534
- `);
535
- }
536
- n.forEach((r) => {
537
- const h = new b(r.name).doKebabCase(), s = [];
538
- s.push(`// ${r.name}`), s.push(`.${h}() {`), r.colors.forEach((p, f) => {
539
- f > 0 && s.push(""), s.push(` // ${p.name}`), p.shades.reverse().forEach(($) => {
540
- const g = p.shades.find((C) => C.type === "source color"), d = `@${new b(p.name).doKebabCase()}-${$.name}`;
541
- g && s.push(
542
- ` ${d}: ${$.isTransparent ? a($, g) : i($)};`
543
- );
544
- });
545
- }), s.push("}"), t.push(s.join(`
546
- `));
547
- });
548
- const o = [":root {"];
549
- n.forEach((r, h) => {
550
- const s = new b(r.name).doKebabCase();
551
- o.push(` &[data-theme="${s}"] {
552
- .${s}();
553
- }`), h !== n.length - 1 && o.push("");
554
- }), o.push("}"), t.push(o.join(`
555
- `));
556
- const c = [];
557
- return n.forEach((r) => {
558
- const h = new b(r.name).doKebabCase();
559
- c.push(`.${h} {
560
- .${h}();
561
- }`);
562
- }), t.push(c.join(`
563
-
564
- `)), t.join(`
565
-
566
- `);
567
- }, G = (m, l) => {
568
- const n = m.themes.filter((e) => e.type === "custom theme").length === 0 ? m.themes.filter((e) => e.type === "default theme") : m.themes.filter((e) => e.type === "custom theme"), t = {}, i = (e) => {
569
- var c;
570
- isNaN(e.oklch[2]) && (e.oklch[2] = 0);
571
- const o = {
572
- RGB: () => ({
573
- colorSpace: "srgb",
574
- components: [
575
- parseFloat(e.gl[0].toFixed(3)),
576
- parseFloat(e.gl[1].toFixed(3)),
577
- parseFloat(e.gl[2].toFixed(3))
578
- ],
579
- hex: e.hex
580
- }),
581
- OKLCH: () => ({
582
- colorSpace: "oklch",
583
- components: [
584
- parseFloat(e.oklch[0].toFixed(3)),
585
- parseFloat(e.oklch[1].toFixed(3)),
586
- parseFloat(e.oklch[2].toFixed(0))
587
- ],
588
- hex: e.hex
589
- })
590
- };
591
- return (c = o[l ?? "RGB"]) == null ? void 0 : c.call(o);
592
- }, a = (e, o) => {
593
- var r;
594
- isNaN(o.oklch[2]) && (o.oklch[2] = 0);
595
- const c = {
596
- RGB: () => ({
597
- colorSpace: "srgb",
598
- components: [
599
- parseFloat(e.gl[0].toFixed(3)),
600
- parseFloat(e.gl[1].toFixed(3)),
601
- parseFloat(e.gl[2].toFixed(3))
602
- ],
603
- hex: e.hex,
604
- alpha: o.alpha
605
- }),
606
- OKLCH: () => ({
607
- colorSpace: "oklch",
608
- components: [
609
- parseFloat(e.oklch[0].toFixed(3)),
610
- parseFloat(e.oklch[1].toFixed(3)),
611
- parseFloat(e.oklch[2].toFixed(0))
612
- ],
613
- hex: e.hex,
614
- alpha: o.alpha
615
- })
616
- };
617
- return (r = c[l ?? "RGB"]) == null ? void 0 : r.call(c);
618
- };
619
- return n[0].type === "custom theme" ? n.forEach((e) => {
620
- e.colors.forEach((o) => {
621
- const c = o.shades.find(
622
- (r) => r.type === "source color"
623
- );
624
- t[o.name] || (t[o.name] = {
625
- $type: "color"
626
- }), o.shades.forEach((r) => {
627
- !t[o.name][r.name] && c && (t[o.name][r.name] = {
628
- $type: "color",
629
- $value: r.isTransparent ? a(c, r) : i(r),
630
- $description: o.description !== "" ? o.description + " - " + r.description : r.description,
631
- $extensions: {
632
- mode: {}
633
- }
634
- }), c && (t[o.name][r.name].$extensions.mode[e.name] = r.isTransparent ? a(c, r) : i(r));
635
- });
636
- });
637
- }) : n.forEach((e) => {
638
- e.colors.forEach((o) => {
639
- const c = o.shades.find(
640
- (r) => r.type === "source color"
641
- );
642
- t[o.name] = {}, o.shades.forEach((r) => {
643
- r && c && (t[o.name][r.name] = {
644
- $type: "color",
645
- $value: r.isTransparent ? a(c, r) : i(r),
646
- $description: o.description !== "" ? o.description + " - " + r.description : r.description
647
- });
648
- });
649
- });
650
- }), JSON.stringify(t, null, " ");
651
- }, O = (m) => {
652
- const l = m.themes.filter((c) => c.type === "custom theme").length === 0 ? m.themes.filter((c) => c.type === "default theme") : m.themes.filter((c) => c.type === "custom theme"), n = [], t = [], i = [], a = [], e = [], o = [];
653
- return l.forEach((c) => {
654
- c.colors.forEach((r) => {
655
- r.shades.forEach((h) => {
656
- i.push(h.name), a.push(Math.floor(h.lch[0])), e.push(Math.floor(h.lch[1])), o.push(Math.floor(h.lch[2]));
657
- }), n.push({
658
- name: r.name,
659
- csv: `${r.name},Lightness,Chroma,Hue
660
- ${i.map((h, s) => `${h},${a[s]},${e[s]},${o[s]}`).join(`
661
- `)}`
662
- }), i.splice(0, i.length), a.splice(0, a.length), e.splice(0, e.length), o.splice(0, o.length);
663
- }), t.push({
664
- name: c.name,
665
- colors: n.map((r) => r),
666
- type: c.type
667
- }), n.splice(0, n.length);
668
- }), t;
669
- }, _ = (m, l) => {
670
- const n = m.themes.filter((e) => e.type === "custom theme").length === 0 ? m.themes.filter((e) => e.type === "default theme") : m.themes.filter((e) => e.type === "custom theme"), t = [], i = (e) => {
671
- var c;
672
- isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0), isNaN(e.oklch[2]) && (e.oklch[2] = 0);
673
- const o = {
674
- RGB: () => `rgb(${Math.floor(e.rgb[0])}, ${Math.floor(
675
- e.rgb[1]
676
- )}, ${Math.floor(e.rgb[2])})`,
677
- HEX: () => e.hex,
678
- HSL: () => `hsl(${Math.floor(e.hsl[0])} ${Math.floor(
679
- e.hsl[1] * 100
680
- )}% ${Math.floor(e.hsl[2] * 100)}%)`,
681
- LCH: () => `lch(${Math.floor(e.lch[0])}% ${Math.floor(
682
- e.lch[1]
683
- )} ${Math.floor(e.lch[2])})`,
684
- OKLCH: () => `oklch(${Math.floor(e.oklch[0] * 100)}% ${e.oklch[1].toFixed(3)} ${Math.floor(e.oklch[2])})`,
685
- P3: () => `color(display-p3 ${e.gl[0].toFixed(3)} ${e.gl[1].toFixed(
686
- 3
687
- )} ${e.gl[2].toFixed(3)})`
688
- };
689
- return (c = o[l ?? "RGB"]) == null ? void 0 : c.call(o);
690
- }, a = (e, o) => {
691
- var r;
692
- isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0), isNaN(e.oklch[2]) && (e.oklch[2] = 0);
693
- const c = {
694
- RGB: () => {
695
- var h;
696
- return `rgb(${Math.floor(o.rgb[0])}, ${Math.floor(
697
- o.rgb[1]
698
- )}, ${Math.floor(o.rgb[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
699
- },
700
- HEX: () => u(o.hex).alpha(e.alpha ?? 1).hex(),
701
- HSL: () => {
702
- var h;
703
- return `hsl(${Math.floor(o.hsl[0])} ${Math.floor(
704
- o.hsl[1] * 100
705
- )}% ${Math.floor(o.hsl[2] * 100)}% / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
706
- },
707
- LCH: () => {
708
- var h;
709
- return `lch(${Math.floor(o.lch[0])}% ${Math.floor(
710
- o.lch[1]
711
- )} ${Math.floor(o.lch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
712
- },
713
- OKLCH: () => {
714
- var h;
715
- return `oklch(${Math.floor(o.oklch[0 * 100])}% ${o.oklch[1].toFixed(3)} ${Math.floor(o.oklch[2])} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
716
- },
717
- P3: () => {
718
- var h;
719
- return `color(display-p3 ${o.gl[0].toFixed(3)} ${o.gl[1].toFixed(
720
- 3
721
- )} ${o.gl[2].toFixed(3)} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
722
- }
723
- };
724
- return (r = c[l ?? "RGB"]) == null ? void 0 : r.call(c);
725
- };
726
- return n.forEach((e) => {
727
- const o = [];
728
- e.colors.forEach((c) => {
729
- o.push(`/* ${c.name} */`), c.shades.reverse().forEach((r) => {
730
- const h = c.shades.find((s) => s.type === "source color");
731
- h && o.push(
732
- `--${new b(c.name).doKebabCase()}-${r.name}: ${r.isTransparent ? a(r, h) : i(r)};`
733
- );
734
- }), o.push("");
735
- }), o.pop(), t.push(
736
- `${e.type === "custom theme" ? `/* ${e.name} */
737
- ` : ""}:root${e.type === "custom theme" ? `[data-theme='${new b(e.name).doKebabCase()}']` : ""} {
738
- ${o.join(`
739
- `)}
740
- }`
741
- );
742
- }), t.join(`
743
-
744
- `);
745
- }, U = (m) => {
746
- const l = m.themes.filter((t) => t.type === "custom theme").length === 0 ? m.themes.filter((t) => t.type === "default theme") : m.themes.filter((t) => t.type === "custom theme"), n = [];
747
- return l.forEach((t) => {
748
- t.colors.forEach((i) => {
749
- const a = i.shades.find((o) => o.type === "source color"), e = [];
750
- e.push(
751
- `// ${l[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
752
- ), i.shades.reverse().forEach((o) => {
753
- e.push(
754
- `val ${l[0].type === "custom theme" ? new b(t.name + " " + i.name).doSnakeCase() : new b(i.name).doSnakeCase()}_${o.name} = Color(${o.isTransparent ? u((a == null ? void 0 : a.hex) ?? "#000000").alpha(o.alpha ?? 1).hex().replace("#", "0xFF").toUpperCase() : o.hex.replace("#", "0xFF").toUpperCase()})`
755
- );
756
- }), e.push(""), e.forEach((o) => n.push(o));
757
- });
758
- }), n.pop(), `import androidx.compose.ui.graphics.Color
759
-
760
- ${n.join(`
761
- `)}`;
762
- };
763
- class J {
1
+ var L = Object.defineProperty;
2
+ var v = (d, a, h) => a in d ? L(d, a, { enumerable: !0, configurable: !0, writable: !0, value: h }) : d[a] = h;
3
+ var i = (d, a, h) => v(d, typeof a != "symbol" ? a + "" : a, h);
4
+ import { C as g, H as C } from "../../color-1CXTuV84.js";
5
+ import { c as s } from "../../index-Beb8qoyd.js";
6
+ import { m as E, a as P, b as y, c as _, d as T, e as w, f as V, g as A, h as H, i as M, j as R, k as x, l as N, n as B } from "../../makeCompose-hjSTxNaX.js";
7
+ class F {
764
8
  constructor({
765
- base: l,
766
- themes: n,
9
+ base: a,
10
+ themes: h,
767
11
  meta: t
768
12
  }) {
769
- k(this, "base");
770
- k(this, "themes");
771
- k(this, "meta");
772
- k(this, "paletteData");
773
- k(this, "currentScale");
774
- k(this, "makePaletteData", () => (this.themes.forEach((l) => {
775
- const n = {
776
- id: l.id,
777
- name: l.name,
778
- description: l.description,
13
+ i(this, "base");
14
+ i(this, "themes");
15
+ i(this, "meta");
16
+ i(this, "paletteData");
17
+ i(this, "currentScale");
18
+ i(this, "makePaletteData", () => (this.themes.forEach((a) => {
19
+ const h = {
20
+ id: a.id,
21
+ name: a.name,
22
+ description: a.description,
779
23
  colors: [],
780
- type: l.type
24
+ type: a.type
781
25
  };
782
26
  this.base.colors.forEach((t) => {
783
- const i = Object.entries(l.scale).reverse().map((h) => {
27
+ const k = Object.entries(a.scale).reverse().map((e) => {
784
28
  if (t.alpha.isEnabled) {
785
- const s = new x({
29
+ const r = new g({
786
30
  render: "RGB",
787
31
  sourceColor: [
788
32
  t.rgb.r * 255,
789
33
  t.rgb.g * 255,
790
34
  t.rgb.b * 255
791
35
  ],
792
- alpha: parseFloat((h[1] / 100).toFixed(2)),
36
+ alpha: parseFloat((e[1] / 100).toFixed(2)),
793
37
  hueShifting: t.hue.shift !== void 0 ? t.hue.shift : 0,
794
38
  chromaShifting: t.chroma.shift !== void 0 ? t.chroma.shift : 100,
795
39
  algorithmVersion: this.base.algorithmVersion,
796
- visionSimulationMode: l.visionSimulationMode
797
- }), p = new x({
40
+ visionSimulationMode: a.visionSimulationMode
41
+ }), o = new g({
798
42
  render: "RGB",
799
- sourceColor: u(t.alpha.backgroundColor).rgb(),
43
+ sourceColor: s(t.alpha.backgroundColor).rgb(),
800
44
  algorithmVersion: this.base.algorithmVersion,
801
- visionSimulationMode: l.visionSimulationMode
45
+ visionSimulationMode: a.visionSimulationMode
802
46
  });
803
47
  switch (this.base.colorSpace) {
804
48
  case "LCH":
805
49
  return this.base.areSourceColorsLocked ? [
806
- h,
807
- s.setColorWithAlpha(),
808
- p.setColorWithAlpha()
50
+ e,
51
+ r.setColorWithAlpha(),
52
+ o.setColorWithAlpha()
809
53
  ] : [
810
- h,
811
- s.lcha(),
812
- p.lcha()
54
+ e,
55
+ r.lcha(),
56
+ o.lcha()
813
57
  ];
814
58
  case "OKLCH":
815
59
  return this.base.areSourceColorsLocked ? [
816
- h,
817
- s.setColorWithAlpha(),
818
- p.setColorWithAlpha()
60
+ e,
61
+ r.setColorWithAlpha(),
62
+ o.setColorWithAlpha()
819
63
  ] : [
820
- h,
821
- s.oklcha(),
822
- p.oklcha()
64
+ e,
65
+ r.oklcha(),
66
+ o.oklcha()
823
67
  ];
824
68
  case "LAB":
825
69
  return this.base.areSourceColorsLocked ? [
826
- h,
827
- s.setColorWithAlpha(),
828
- p.setColorWithAlpha()
70
+ e,
71
+ r.setColorWithAlpha(),
72
+ o.setColorWithAlpha()
829
73
  ] : [
830
- h,
831
- s.laba(),
832
- p.laba()
74
+ e,
75
+ r.laba(),
76
+ o.laba()
833
77
  ];
834
78
  case "OKLAB":
835
79
  return this.base.areSourceColorsLocked ? [
836
- h,
837
- s.setColorWithAlpha(),
838
- p.setColorWithAlpha()
80
+ e,
81
+ r.setColorWithAlpha(),
82
+ o.setColorWithAlpha()
839
83
  ] : [
840
- h,
841
- s.oklaba(),
842
- p.oklaba()
84
+ e,
85
+ r.oklaba(),
86
+ o.oklaba()
843
87
  ];
844
88
  case "HSL":
845
89
  return this.base.areSourceColorsLocked ? [
846
- h,
847
- s.setColorWithAlpha(),
848
- p.setColorWithAlpha()
90
+ e,
91
+ r.setColorWithAlpha(),
92
+ o.setColorWithAlpha()
849
93
  ] : [
850
- h,
851
- s.hsla(),
852
- p.hsla()
94
+ e,
95
+ r.hsla(),
96
+ o.hsla()
853
97
  ];
854
98
  case "HSLUV":
855
99
  return this.base.areSourceColorsLocked ? [
856
- h,
857
- s.setColorWithAlpha(),
858
- p.setColorWithAlpha()
100
+ e,
101
+ r.setColorWithAlpha(),
102
+ o.setColorWithAlpha()
859
103
  ] : [
860
- h,
861
- s.hsluva(),
862
- p.hsluva()
104
+ e,
105
+ r.hsluva(),
106
+ o.hsluva()
863
107
  ];
864
108
  default:
865
- return [h, [0, 0, 0], [255, 255, 255]];
109
+ return [e, [0, 0, 0], [255, 255, 255]];
866
110
  }
867
111
  } else {
868
- const s = new x({
112
+ const r = new g({
869
113
  render: "RGB",
870
114
  sourceColor: [
871
115
  t.rgb.r * 255,
872
116
  t.rgb.g * 255,
873
117
  t.rgb.b * 255
874
118
  ],
875
- lightness: h[1],
119
+ lightness: e[1],
876
120
  hueShifting: t.hue.shift !== void 0 ? t.hue.shift : 0,
877
121
  chromaShifting: t.chroma.shift !== void 0 ? t.chroma.shift : 100,
878
122
  algorithmVersion: this.base.algorithmVersion,
879
- visionSimulationMode: l.visionSimulationMode
123
+ visionSimulationMode: a.visionSimulationMode
880
124
  });
881
125
  switch (this.base.colorSpace) {
882
126
  case "LCH":
883
- return [h, s.lch()];
127
+ return [e, r.lch()];
884
128
  case "OKLCH":
885
- return [h, s.oklch()];
129
+ return [e, r.oklch()];
886
130
  case "LAB":
887
- return [h, s.lab()];
131
+ return [e, r.lab()];
888
132
  case "OKLAB":
889
- return [h, s.oklab()];
133
+ return [e, r.oklab()];
890
134
  case "HSL":
891
- return [h, s.hsl()];
135
+ return [e, r.hsl()];
892
136
  case "HSLUV":
893
- return [h, s.hsluv()];
137
+ return [e, r.hsluv()];
894
138
  default:
895
- return [h, [0, 0, 0]];
139
+ return [e, [0, 0, 0]];
896
140
  }
897
141
  }
898
- }), a = {
142
+ }), u = {
899
143
  id: t.id,
900
144
  name: t.name,
901
145
  description: t.description,
902
146
  shades: [],
903
147
  type: "color"
904
- }, e = [
148
+ }, n = [
905
149
  t.rgb.r * 255,
906
150
  t.rgb.g * 255,
907
151
  t.rgb.b * 255
908
- ], o = new M();
909
- o.rgb_r = t.rgb.r, o.rgb_g = t.rgb.g, o.rgb_b = t.rgb.b, o.rgbToHsluv(), a.shades.push({
152
+ ], c = new C();
153
+ c.rgb_r = t.rgb.r, c.rgb_g = t.rgb.g, c.rgb_b = t.rgb.b, c.rgbToHsluv(), u.shades.push({
910
154
  name: "source",
911
155
  description: "Source color",
912
- hex: u(e).hex(),
913
- rgb: e,
914
- gl: u(e).gl(),
915
- lch: u(e).lch(),
916
- oklch: u(e).oklch(),
917
- lab: u(e).lab(),
918
- oklab: u(e).oklab(),
919
- hsl: u(e).hsl(),
156
+ hex: s(n).hex(),
157
+ rgb: n,
158
+ gl: s(n).gl(),
159
+ lch: s(n).lch(),
160
+ oklch: s(n).oklch(),
161
+ lab: s(n).lab(),
162
+ oklab: s(n).oklab(),
163
+ hsl: s(n).hsl(),
920
164
  hsluv: [
921
- o.hsluv_h,
922
- o.hsluv_s,
923
- o.hsluv_l
165
+ c.hsluv_h,
166
+ c.hsluv_s,
167
+ c.hsluv_l
924
168
  ],
925
169
  type: "source color"
926
170
  });
927
- const c = i.map(
928
- (h) => u.distance(
929
- u(e).hex(),
930
- u(h[1]).hex(),
171
+ const S = k.map(
172
+ (e) => s.distance(
173
+ s(n).hex(),
174
+ s(e[1]).hex(),
931
175
  "rgb"
932
176
  )
933
- ), r = c.indexOf(Math.min(...c));
934
- i.forEach((h, s) => {
935
- const p = u.distance(
936
- u(e).hex(),
937
- u(h[1]).hex(),
177
+ ), l = S.indexOf(Math.min(...S));
178
+ k.forEach((e, r) => {
179
+ const o = s.distance(
180
+ s(n).hex(),
181
+ s(e[1]).hex(),
938
182
  "rgb"
939
- ), f = Object.keys(this.currentScale).find(
940
- (C) => C === h[0][0]
941
- ) ?? "0", $ = new M(), g = new x({
183
+ ), D = Object.keys(this.currentScale).find(
184
+ (f) => f === e[0][0]
185
+ ) ?? "0", b = new C(), p = new g({
942
186
  render: "RGB",
943
- sourceColor: u(e).rgb(),
944
- visionSimulationMode: l.visionSimulationMode
945
- }).setColor(), d = new x({
187
+ sourceColor: s(n).rgb(),
188
+ visionSimulationMode: a.visionSimulationMode
189
+ }).setColor(), m = new g({
946
190
  render: "HEX",
947
- sourceColor: u(e).rgb(),
948
- visionSimulationMode: l.visionSimulationMode
191
+ sourceColor: s(n).rgb(),
192
+ visionSimulationMode: a.visionSimulationMode
949
193
  }).setColor();
950
- s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? ($.rgb_r = Number(g[0]) / 255, $.rgb_g = Number(g[1]) / 255, $.rgb_b = Number(g[2]) / 255) : ($.rgb_r = Number(h[1][0]) / 255, $.rgb_g = Number(h[1][1]) / 255, $.rgb_b = Number(h[1][2]) / 255), $.rgbToHsluv(), a.shades.push({
951
- name: f,
952
- description: `Shade/Tint color with ${typeof h[0][1] == "number" ? h[0][1].toFixed(1) : h[0][1]}% of ${t.alpha.isEnabled ? "opacity" : "lightness"}`,
953
- hex: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).hex() : u(h[1]).hex(),
954
- rgb: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).rgb() : u(h[1]).rgb(),
955
- gl: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).gl() : u(h[1]).gl(),
956
- lch: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).lch() : u(h[1]).lch(),
957
- oklch: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).oklch() : u(h[1]).oklch(),
958
- lab: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).lab() : u(h[1]).lab(),
959
- oklab: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).oklab() : u(h[1]).oklab(),
960
- hsl: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? u(d).hsl() : u(h[1]).hsl(),
961
- hsluv: [$.hsluv_h, $.hsluv_s, $.hsluv_l],
962
- alpha: t.alpha.isEnabled ? parseFloat((h[0][1] / 100).toFixed(2)) : void 0,
963
- backgroundColor: t.alpha.isEnabled && t.alpha.backgroundColor ? u(h[2]).rgb() : void 0,
964
- mixedColor: t.alpha.isEnabled && t.alpha.backgroundColor ? new x({
965
- visionSimulationMode: l.visionSimulationMode
194
+ r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? (b.rgb_r = Number(p[0]) / 255, b.rgb_g = Number(p[1]) / 255, b.rgb_b = Number(p[2]) / 255) : (b.rgb_r = Number(e[1][0]) / 255, b.rgb_g = Number(e[1][1]) / 255, b.rgb_b = Number(e[1][2]) / 255), b.rgbToHsluv(), u.shades.push({
195
+ name: D,
196
+ description: `Shade/Tint color with ${typeof e[0][1] == "number" ? e[0][1].toFixed(1) : e[0][1]}% of ${t.alpha.isEnabled ? "opacity" : "lightness"}`,
197
+ hex: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).hex() : s(e[1]).hex(),
198
+ rgb: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).rgb() : s(e[1]).rgb(),
199
+ gl: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).gl() : s(e[1]).gl(),
200
+ lch: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).lch() : s(e[1]).lch(),
201
+ oklch: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).oklch() : s(e[1]).oklch(),
202
+ lab: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).lab() : s(e[1]).lab(),
203
+ oklab: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).oklab() : s(e[1]).oklab(),
204
+ hsl: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled ? s(m).hsl() : s(e[1]).hsl(),
205
+ hsluv: [b.hsluv_h, b.hsluv_s, b.hsluv_l],
206
+ alpha: t.alpha.isEnabled ? parseFloat((e[0][1] / 100).toFixed(2)) : void 0,
207
+ backgroundColor: t.alpha.isEnabled && t.alpha.backgroundColor ? s(e[2]).rgb() : void 0,
208
+ mixedColor: t.alpha.isEnabled && t.alpha.backgroundColor ? new g({
209
+ visionSimulationMode: a.visionSimulationMode
966
210
  }).mixColorsRgb(
967
211
  [
968
- ...h[1],
212
+ ...e[1],
969
213
  parseFloat(
970
- (h[0][1] / 100).toFixed(2)
214
+ (e[0][1] / 100).toFixed(2)
971
215
  )
972
216
  ],
973
- [...h[2], 1]
217
+ [...e[2], 1]
974
218
  ) : void 0,
975
- isClosestToRef: p < 4 && !this.base.areSourceColorsLocked,
976
- isSourceColorLocked: s === r && this.base.areSourceColorsLocked && !t.alpha.isEnabled,
219
+ isClosestToRef: o < 4 && !this.base.areSourceColorsLocked,
220
+ isSourceColorLocked: r === l && this.base.areSourceColorsLocked && !t.alpha.isEnabled,
977
221
  isTransparent: t.alpha.isEnabled,
978
222
  type: "color shade/tint"
979
223
  });
980
- }), n.colors.push(a);
981
- }), this.paletteData.themes.push(n);
224
+ }), h.colors.push(u);
225
+ }), this.paletteData.themes.push(h);
982
226
  }), this.paletteData));
983
- k(this, "makeLibraryData", (l, n) => {
227
+ i(this, "makeLibraryData", (a, h) => {
984
228
  const t = this.makePaletteData();
985
229
  return t.themes.flatMap(
986
- (a) => a.colors.flatMap(
987
- (e) => e.shades.flatMap((o) => {
988
- const c = `${a.id}:${e.id}:${o.name}`, r = n == null ? void 0 : n.find(
989
- (h) => h.id === c
230
+ (u) => u.colors.flatMap(
231
+ (n) => n.shades.flatMap((c) => {
232
+ const S = `${u.id}:${n.id}:${c.name}`, l = h == null ? void 0 : h.find(
233
+ (e) => e.id === S
990
234
  );
991
235
  return {
992
- id: c,
236
+ id: S,
993
237
  paletteName: t.name,
994
- themeName: a.name,
995
- colorName: e.name,
996
- shadeName: o.name,
997
- ...(l == null ? void 0 : l.includes("alpha")) && { alpha: o.alpha ?? 1 },
998
- ...(l == null ? void 0 : l.includes("hex")) && { hex: o.hex },
999
- ...(l == null ? void 0 : l.includes("gl")) && { gl: o.gl },
1000
- ...(l == null ? void 0 : l.includes("description")) && {
1001
- description: e.description
238
+ themeName: u.name,
239
+ colorName: n.name,
240
+ shadeName: c.name,
241
+ ...(a == null ? void 0 : a.includes("alpha")) && { alpha: c.alpha ?? 1 },
242
+ ...(a == null ? void 0 : a.includes("hex")) && { hex: c.hex },
243
+ ...(a == null ? void 0 : a.includes("gl")) && { gl: c.gl },
244
+ ...(a == null ? void 0 : a.includes("description")) && {
245
+ description: n.description
1002
246
  },
1003
- ...(l == null ? void 0 : l.includes("collection_id")) && {
1004
- collectionId: r == null ? void 0 : r.collectionId
247
+ ...(a == null ? void 0 : a.includes("collection_id")) && {
248
+ collectionId: l == null ? void 0 : l.collectionId
1005
249
  },
1006
- ...(l == null ? void 0 : l.includes("mode_id")) && {
1007
- modeId: r == null ? void 0 : r.modeId
250
+ ...(a == null ? void 0 : a.includes("mode_id")) && {
251
+ modeId: l == null ? void 0 : l.modeId
1008
252
  },
1009
- ...(l == null ? void 0 : l.includes("variable_id")) && {
1010
- variableId: r == null ? void 0 : r.variableId
253
+ ...(a == null ? void 0 : a.includes("variable_id")) && {
254
+ variableId: l == null ? void 0 : l.variableId
1011
255
  },
1012
- ...(l == null ? void 0 : l.includes("style_id")) && {
1013
- styleId: r == null ? void 0 : r.styleId
256
+ ...(a == null ? void 0 : a.includes("style_id")) && {
257
+ styleId: l == null ? void 0 : l.styleId
1014
258
  }
1015
259
  };
1016
260
  })
1017
261
  )
1018
262
  );
1019
263
  });
1020
- k(this, "makeNativeTokens", () => {
1021
- const l = this.makePaletteData();
1022
- return B(l);
264
+ i(this, "makeNativeTokens", () => {
265
+ const a = this.makePaletteData();
266
+ return E(a);
1023
267
  });
1024
- k(this, "makeDtcgTokens", (l = "RGB") => {
1025
- const n = this.makePaletteData();
1026
- return G(n, l);
268
+ i(this, "makeDtcgTokens", (a = "RGB") => {
269
+ const h = this.makePaletteData();
270
+ return P(h, a);
1027
271
  });
1028
- k(this, "makeStyleDictionaryV3Tokens", () => {
1029
- const l = this.makePaletteData();
1030
- return V(l);
272
+ i(this, "makeStyleDictionaryV3Tokens", () => {
273
+ const a = this.makePaletteData();
274
+ return y(a);
1031
275
  });
1032
- k(this, "makeUniversalJson", () => {
1033
- const l = this.makePaletteData();
1034
- return S(l);
276
+ i(this, "makeUniversalJson", () => {
277
+ const a = this.makePaletteData();
278
+ return _(a);
1035
279
  });
1036
- k(this, "makeCssCustomProps", (l = "RGB") => {
1037
- const n = this.makePaletteData();
1038
- return _(n, l);
280
+ i(this, "makeCssCustomProps", (a = "RGB") => {
281
+ const h = this.makePaletteData();
282
+ return T(h, a);
1039
283
  });
1040
- k(this, "makeScssVariables", (l = "RGB") => {
1041
- const n = this.makePaletteData();
1042
- return P(n, l);
284
+ i(this, "makeScssVariables", (a = "RGB") => {
285
+ const h = this.makePaletteData();
286
+ return w(h, a);
1043
287
  });
1044
- k(this, "makeLessVariables", (l = "RGB") => {
1045
- const n = this.makePaletteData();
1046
- return R(n, l);
288
+ i(this, "makeLessVariables", (a = "RGB") => {
289
+ const h = this.makePaletteData();
290
+ return V(h, a);
1047
291
  });
1048
- k(this, "makeTailwindV3Config", () => {
1049
- const l = this.makePaletteData();
1050
- return K(l);
292
+ i(this, "makeTailwindV3Config", () => {
293
+ const a = this.makePaletteData();
294
+ return A(a);
1051
295
  });
1052
- k(this, "makeTailwindV4Config", () => {
1053
- const l = this.makePaletteData();
1054
- return H(l);
296
+ i(this, "makeTailwindV4Config", () => {
297
+ const a = this.makePaletteData();
298
+ return H(a);
1055
299
  });
1056
- k(this, "makeSwiftUI", () => {
1057
- const l = this.makePaletteData();
1058
- return A(l);
300
+ i(this, "makeSwiftUI", () => {
301
+ const a = this.makePaletteData();
302
+ return M(a);
1059
303
  });
1060
- k(this, "makeUIKit", () => {
1061
- const l = this.makePaletteData();
1062
- return L(l);
304
+ i(this, "makeUIKit", () => {
305
+ const a = this.makePaletteData();
306
+ return R(a);
1063
307
  });
1064
- k(this, "makeCompose", () => {
1065
- const l = this.makePaletteData();
1066
- return U(l);
308
+ i(this, "makeCompose", () => {
309
+ const a = this.makePaletteData();
310
+ return x(a);
1067
311
  });
1068
- k(this, "makeResources", () => {
1069
- const l = this.makePaletteData();
1070
- return j(l);
312
+ i(this, "makeResources", () => {
313
+ const a = this.makePaletteData();
314
+ return N(a);
1071
315
  });
1072
- k(this, "makeCsv", () => {
1073
- const l = this.makePaletteData();
1074
- return O(l);
316
+ i(this, "makeCsv", () => {
317
+ const a = this.makePaletteData();
318
+ return B(a);
1075
319
  });
1076
- k(this, "makePaletteFullData", () => ({
320
+ i(this, "makePaletteFullData", () => ({
1077
321
  base: this.base,
1078
322
  themes: this.themes,
1079
323
  libraryData: this.makeLibraryData(),
@@ -1081,16 +325,16 @@ class J {
1081
325
  version: "2025.06",
1082
326
  type: "UI_COLOR_PALETTE"
1083
327
  }));
1084
- var i;
1085
- this.base = l, this.themes = n, this.meta = t, this.paletteData = {
1086
- name: l.name ?? "UI Color Palette",
1087
- description: l.description,
328
+ var k;
329
+ this.base = a, this.themes = h, this.meta = t, this.paletteData = {
330
+ name: a.name ?? "UI Color Palette",
331
+ description: a.description,
1088
332
  themes: [],
1089
333
  type: "palette"
1090
- }, this.currentScale = ((i = n.find((a) => a.isEnabled)) == null ? void 0 : i.scale) ?? {};
334
+ }, this.currentScale = ((k = h.find((u) => u.isEnabled)) == null ? void 0 : k.scale) ?? {};
1091
335
  }
1092
336
  }
1093
337
  export {
1094
- J as default
338
+ F as default
1095
339
  };
1096
340
  //# sourceMappingURL=data.js.map