@a_ng_d/utils-ui-color-palette 1.4.1 → 1.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,51 +4,51 @@ var u = (c, r, s) => E(c, typeof r != "symbol" ? r + "" : r, s);
4
4
  import { C as d, H as C } from "../../color-1CXTuV84.js";
5
5
  import { c as p } from "../../index-Beb8qoyd.js";
6
6
  const S = (c) => {
7
- const r = c.themes.filter((o) => o.type === "custom theme").length === 0 ? c.themes.filter((o) => o.type === "default theme") : c.themes.filter((o) => o.type === "custom theme"), s = {}, a = (o) => ({
7
+ const r = c.themes.filter((a) => a.type === "custom theme").length === 0 ? c.themes.filter((a) => a.type === "default theme") : c.themes.filter((a) => a.type === "custom theme"), s = {}, o = (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
8
  rgb: {
9
- r: Math.floor(o.rgb[0]),
10
- g: Math.floor(o.rgb[1]),
11
- b: Math.floor(o.rgb[2])
9
+ r: Math.floor(a.rgb[0]),
10
+ g: Math.floor(a.rgb[1]),
11
+ b: Math.floor(a.rgb[2])
12
12
  },
13
13
  gl: {
14
- r: parseFloat(o.gl[0].toFixed(3)),
15
- g: parseFloat(o.gl[1].toFixed(3)),
16
- b: parseFloat(o.gl[2].toFixed(3))
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
17
  },
18
18
  lch: {
19
- l: Math.floor(o.lch[0]),
20
- c: Math.floor(o.lch[1]),
21
- h: Math.floor(o.lch[2])
19
+ l: Math.floor(a.lch[0]),
20
+ c: Math.floor(a.lch[1]),
21
+ h: Math.floor(a.lch[2])
22
22
  },
23
23
  oklch: {
24
- l: parseFloat(o.oklch[0].toFixed(3)),
25
- c: parseFloat(o.oklch[1].toFixed(3)),
26
- h: Math.floor(o.oklch[2])
24
+ l: parseFloat(a.oklch[0].toFixed(3)),
25
+ c: parseFloat(a.oklch[1].toFixed(3)),
26
+ h: Math.floor(a.oklch[2])
27
27
  },
28
28
  lab: {
29
- l: Math.floor(o.lab[0]),
30
- a: Math.floor(o.lab[1]),
31
- b: Math.floor(o.lab[2])
29
+ l: Math.floor(a.lab[0]),
30
+ a: Math.floor(a.lab[1]),
31
+ b: Math.floor(a.lab[2])
32
32
  },
33
33
  oklab: {
34
- l: parseFloat(o.oklab[0].toFixed(3)),
35
- a: parseFloat(o.oklab[1].toFixed(3)),
36
- b: parseFloat(o.oklab[2].toFixed(3))
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
37
  },
38
38
  hsl: {
39
- h: Math.floor(o.hsl[0]),
40
- s: Math.floor(o.hsl[1] * 100),
41
- l: Math.floor(o.hsl[2] * 100)
39
+ h: Math.floor(a.hsl[0]),
40
+ s: Math.floor(a.hsl[1] * 100),
41
+ l: Math.floor(a.hsl[2] * 100)
42
42
  },
43
43
  hsluv: {
44
- h: Math.floor(o.hsluv[0]),
45
- s: Math.floor(o.hsluv[1]),
46
- l: Math.floor(o.hsluv[2])
44
+ h: Math.floor(a.hsluv[0]),
45
+ s: Math.floor(a.hsluv[1]),
46
+ l: Math.floor(a.hsluv[2])
47
47
  },
48
- hex: o.hex,
49
- description: o.description,
48
+ hex: a.hex,
49
+ description: a.description,
50
50
  type: "color shade/tint"
51
- }), h = (o, e) => ({
51
+ }), h = (a, e) => ({
52
52
  rgb: {
53
53
  r: Math.floor(e.rgb[0]),
54
54
  g: Math.floor(e.rgb[1]),
@@ -90,26 +90,26 @@ const S = (c) => {
90
90
  l: Math.floor(e.hsluv[2])
91
91
  },
92
92
  hex: e.hex,
93
- alpha: o.alpha,
94
- description: o.description,
93
+ alpha: a.alpha,
94
+ description: a.description,
95
95
  type: "color shade/tint"
96
96
  });
97
- return r[0].type === "custom theme" ? r.forEach((o) => {
98
- s[o.name] = {}, o.colors.forEach((e) => {
97
+ return r[0].type === "custom theme" ? r.forEach((a) => {
98
+ s[a.name] = {}, a.colors.forEach((e) => {
99
99
  const t = e.shades.find(
100
100
  (l) => l.type === "source color"
101
101
  );
102
- s[o.name][e.name] = {}, e.shades.forEach((l) => {
103
- l && t && (s[o.name][e.name][l.name] = l.isTransparent ? h(l, t) : a(l));
104
- }), s[o.name][e.name].description = e.description, s[o.name][e.name].type = "color";
105
- }), s[o.name].description = o.description, s[o.name].type = "color mode";
106
- }) : r.forEach((o) => {
107
- o.colors.forEach((e) => {
102
+ s[a.name][e.name] = {}, e.shades.forEach((l) => {
103
+ l && t && (s[a.name][e.name][l.name] = l.isTransparent ? h(l, t) : o(l));
104
+ }), s[a.name][e.name].description = e.description, s[a.name][e.name].type = "color";
105
+ }), s[a.name].description = a.description, s[a.name].type = "color mode";
106
+ }) : r.forEach((a) => {
107
+ a.colors.forEach((e) => {
108
108
  const t = e.shades.find(
109
109
  (l) => l.type === "source color"
110
110
  );
111
111
  s[e.name] = {}, e.shades.forEach((l) => {
112
- l && t && (s[e.name][l.name] = l.isTransparent ? h(l, t) : a(l));
112
+ l && t && (s[e.name][l.name] = l.isTransparent ? h(l, t) : o(l));
113
113
  }), s[e.name].description = e.description, s[e.name].type = "color";
114
114
  });
115
115
  }), s.description = c.description, s.type = "color palette", JSON.stringify(s, null, " ");
@@ -121,18 +121,18 @@ class f {
121
121
  }
122
122
  }
123
123
  const T = (c) => {
124
- const r = c.themes.filter((a) => a.type === "custom theme").length === 0 ? c.themes.filter((a) => a.type === "default theme") : c.themes.filter((a) => a.type === "custom theme"), s = [];
125
- return r.forEach((a) => {
124
+ const r = c.themes.filter((o) => o.type === "custom theme").length === 0 ? c.themes.filter((o) => o.type === "default theme") : c.themes.filter((o) => o.type === "custom theme"), s = [];
125
+ return r.forEach((o) => {
126
126
  const h = [];
127
- a.colors.forEach((o) => {
128
- const e = o.shades.find((t) => t.type === "source color");
129
- h.push(`// ${o.name}`), o.shades.reverse().forEach((t) => {
127
+ o.colors.forEach((a) => {
128
+ const e = a.shades.find((t) => t.type === "source color");
129
+ h.push(`// ${a.name}`), a.shades.reverse().forEach((t) => {
130
130
  h.push(
131
- t.isTransparent ? `static let ${new f(o.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = UIColor(red: ${e == null ? void 0 : e.gl[0].toFixed(
131
+ t.isTransparent ? `static let ${new f(a.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = UIColor(red: ${e == null ? void 0 : e.gl[0].toFixed(
132
132
  3
133
133
  )}, green: ${e == null ? void 0 : e.gl[1].toFixed(3)}, blue: ${e == null ? void 0 : e.gl[2].toFixed(
134
134
  3
135
- )}, alpha: ${t.alpha ?? 1})` : `static let ${new f(o.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = UIColor(red: ${t.gl[0].toFixed(
135
+ )}, alpha: ${t.alpha ?? 1})` : `static let ${new f(a.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = UIColor(red: ${t.gl[0].toFixed(
136
136
  3
137
137
  )}, green: ${t.gl[1].toFixed(3)}, blue: ${t.gl[2].toFixed(
138
138
  3
@@ -140,7 +140,7 @@ const T = (c) => {
140
140
  );
141
141
  }), h.push("");
142
142
  }), h.pop(), r[0].type === "custom theme" ? s.push(
143
- `struct ${new f(a.name).doPascalCase()} {
143
+ `struct ${new f(o.name).doPascalCase()} {
144
144
  ${h.join(
145
145
  `
146
146
  `
@@ -156,46 +156,46 @@ struct Color {
156
156
  `)}
157
157
  }`;
158
158
  }, L = (c) => {
159
- const r = c.themes.filter((a) => a.type === "custom theme").length === 0 ? c.themes.filter((a) => a.type === "default theme") : c.themes.filter((a) => a.type === "custom theme"), s = {
159
+ const r = c.themes.filter((o) => o.type === "custom theme").length === 0 ? c.themes.filter((o) => o.type === "default theme") : c.themes.filter((o) => o.type === "custom theme"), s = {
160
160
  theme: {
161
161
  colors: {}
162
162
  }
163
163
  };
164
- return c.themes[0].colors.forEach((a) => {
165
- s.theme.colors[new f(a.name).doKebabCase()] = {};
166
- }), r[0].type === "custom theme" ? r.forEach((a) => {
167
- a.colors.forEach((h) => {
168
- const o = h.shades.find(
164
+ return c.themes[0].colors.forEach((o) => {
165
+ s.theme.colors[new f(o.name).doKebabCase()] = {};
166
+ }), r[0].type === "custom theme" ? r.forEach((o) => {
167
+ o.colors.forEach((h) => {
168
+ const a = h.shades.find(
169
169
  (e) => e.type === "source color"
170
170
  );
171
- s.theme.colors[new f(h.name).doKebabCase()][new f(a.name).doKebabCase()] = {}, h.shades.forEach((e) => {
172
- s.theme.colors[new f(h.name).doKebabCase()][new f(a.name).doKebabCase()][new f(e.name).doKebabCase()] = e.isTransparent ? p((o == null ? void 0 : o.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
171
+ s.theme.colors[new f(h.name).doKebabCase()][new f(o.name).doKebabCase()] = {}, h.shades.forEach((e) => {
172
+ s.theme.colors[new f(h.name).doKebabCase()][new f(o.name).doKebabCase()][new f(e.name).doKebabCase()] = e.isTransparent ? p((a == null ? void 0 : a.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
173
173
  });
174
174
  });
175
- }) : r.forEach((a) => {
176
- a.colors.forEach((h) => {
177
- const o = h.shades.find(
175
+ }) : r.forEach((o) => {
176
+ o.colors.forEach((h) => {
177
+ const a = h.shades.find(
178
178
  (e) => e.type === "source color"
179
179
  );
180
180
  s.theme.colors[new f(h.name).doKebabCase()] = {}, h.shades.sort().forEach((e) => {
181
- s.theme.colors[new f(h.name).doKebabCase()][new f(e.name).doKebabCase()] = e.isTransparent ? p((o == null ? void 0 : o.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
181
+ s.theme.colors[new f(h.name).doKebabCase()][new f(e.name).doKebabCase()] = e.isTransparent ? p((a == null ? void 0 : a.hex) ?? "#000000").alpha(e.alpha ?? 1).hex() : e.hex;
182
182
  });
183
183
  });
184
184
  }), s;
185
- }, H = (c) => {
186
- const r = c.themes.filter((a) => a.type === "custom theme").length === 0 ? c.themes.filter((a) => a.type === "default theme") : c.themes.filter((a) => a.type === "custom theme"), s = [];
187
- return r.forEach((a) => {
188
- a.colors.forEach((h) => {
189
- const o = h.shades.find((t) => t.type === "source color"), e = [];
185
+ }, N = (c) => {
186
+ const r = c.themes.filter((o) => o.type === "custom theme").length === 0 ? c.themes.filter((o) => o.type === "default theme") : c.themes.filter((o) => o.type === "custom theme"), s = [];
187
+ return r.forEach((o) => {
188
+ o.colors.forEach((h) => {
189
+ const a = h.shades.find((t) => t.type === "source color"), e = [];
190
190
  e.push(
191
- `// ${r[0].type === "custom theme" ? a.name + " - " : ""}${h.name}`
191
+ `// ${r[0].type === "custom theme" ? o.name + " - " : ""}${h.name}`
192
192
  ), h.shades.reverse().forEach((t) => {
193
193
  e.push(
194
- t.isTransparent ? `public let ${r[0].type === "custom theme" ? new f(a.name + " " + h.name).doPascalCase() : new f(h.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = Color(red: ${o == null ? void 0 : o.gl[0].toFixed(
194
+ t.isTransparent ? `public let ${r[0].type === "custom theme" ? new f(o.name + " " + h.name).doPascalCase() : new f(h.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = Color(red: ${a == null ? void 0 : a.gl[0].toFixed(
195
195
  3
196
- )}, green: ${o == null ? void 0 : o.gl[1].toFixed(3)}, blue: ${t.gl[2].toFixed(
196
+ )}, green: ${a == null ? void 0 : a.gl[1].toFixed(3)}, blue: ${t.gl[2].toFixed(
197
197
  3
198
- )}).opacity(${t.alpha ?? 1})` : `public let ${r[0].type === "custom theme" ? new f(a.name + " " + h.name).doPascalCase() : new f(h.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = Color(red: ${t.gl[0].toFixed(
198
+ )}).opacity(${t.alpha ?? 1})` : `public let ${r[0].type === "custom theme" ? new f(o.name + " " + h.name).doPascalCase() : new f(h.name).doPascalCase()}${t.name === "source" ? "Source" : t.name} = Color(red: ${t.gl[0].toFixed(
199
199
  3
200
200
  )}, green: ${t.gl[1].toFixed(3)}, blue: ${t.gl[2].toFixed(
201
201
  3
@@ -214,43 +214,43 @@ public extension Color {
214
214
  )}
215
215
  }
216
216
  }`;
217
- }, P = (c) => {
217
+ }, H = (c) => {
218
218
  const r = c.themes.filter((h) => h.type === "custom theme").length === 0 ? c.themes.filter((h) => h.type === "default theme") : c.themes.filter((h) => h.type === "custom theme"), s = {
219
219
  color: {}
220
- }, a = (h, o, e) => ({
220
+ }, o = (h, a, e) => ({
221
221
  type: "color",
222
- value: o.isTransparent ? p(e.hex).alpha(o.alpha ?? 1).hex() : o.hex,
223
- comment: h.description !== "" ? h.description + " - " + o.description : o.description
222
+ value: a.isTransparent ? p(e.hex).alpha(a.alpha ?? 1).hex() : a.hex,
223
+ comment: h.description !== "" ? h.description + " - " + a.description : a.description
224
224
  });
225
225
  return c.themes[0].colors.forEach((h) => {
226
226
  s.color[h.name] = {};
227
227
  }), r[0].type === "custom theme" ? r.forEach((h) => {
228
- h.colors.forEach((o) => {
229
- const e = o.shades.find(
228
+ h.colors.forEach((a) => {
229
+ const e = a.shades.find(
230
230
  (t) => t.type === "source color"
231
231
  );
232
- s.color[o.name][h.name] = {}, o.shades.forEach((t) => {
233
- t && e && (s.color[o.name][h.name][t.name] = a(
234
- o,
232
+ s.color[a.name][h.name] = {}, a.shades.forEach((t) => {
233
+ t && e && (s.color[a.name][h.name][t.name] = o(
234
+ a,
235
235
  t,
236
236
  e
237
237
  ));
238
238
  });
239
239
  });
240
240
  }) : r.forEach((h) => {
241
- h.colors.forEach((o) => {
242
- const e = o.shades.find(
241
+ h.colors.forEach((a) => {
242
+ const e = a.shades.find(
243
243
  (t) => t.type === "source color"
244
244
  );
245
- s.color[o.name] = {}, o.shades.forEach((t) => {
246
- t && e && (s.color[o.name][t.name] = a(o, t, e));
245
+ s.color[a.name] = {}, a.shades.forEach((t) => {
246
+ t && e && (s.color[a.name][t.name] = o(a, t, e));
247
247
  });
248
248
  });
249
249
  }), JSON.stringify(s, null, " ");
250
- }, A = (c, r) => {
251
- const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), a = [], h = (e) => {
250
+ }, P = (c, r) => {
251
+ const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), o = [], h = (e) => {
252
252
  var l;
253
- e.hsl[0] === null && (e.hsl[0] = 0), e.lch[2] === null && (e.lch[2] = 0);
253
+ isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0);
254
254
  const t = {
255
255
  RGB: () => `rgb(${Math.floor(e.rgb[0])}, ${Math.floor(
256
256
  e.rgb[1]
@@ -267,7 +267,7 @@ public extension Color {
267
267
  )}, ${e.gl[2].toFixed(3)})`
268
268
  };
269
269
  return (l = t[r ?? "RGB"]) == null ? void 0 : l.call(t);
270
- }, o = (e, t) => {
270
+ }, a = (e, t) => {
271
271
  var i;
272
272
  const l = {
273
273
  RGB: () => {
@@ -304,21 +304,21 @@ public extension Color {
304
304
  t.push(`// ${l.name}`), l.shades.reverse().forEach((i) => {
305
305
  const n = l.shades.find((b) => b.type === "source color"), m = `$${new f(l.name).doKebabCase()}-${i.name}`;
306
306
  n && (e.type === "custom theme" ? t.push(
307
- ` ${m}: ${i.isTransparent ? o(i, n) : h(i)};`
307
+ ` ${m}: ${i.isTransparent ? a(i, n) : h(i)};`
308
308
  ) : t.push(
309
- `${m}: ${i.isTransparent ? o(i, n) : h(i)};`
309
+ `${m}: ${i.isTransparent ? a(i, n) : h(i)};`
310
310
  ));
311
311
  }), t.push("");
312
- }), e.type === "custom theme" && t.push("}"), a.push(t.join(`
312
+ }), e.type === "custom theme" && t.push("}"), o.push(t.join(`
313
313
  `));
314
- }), a.push(`
314
+ }), o.push(`
315
315
  // Color modes map
316
316
  $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
317
317
  const i = new f(e.name).doKebabCase();
318
- a.push(
318
+ o.push(
319
319
  ` '${i}': ${new f(e.name).doCamelCase()}-mode${t < l.length - 1 ? "," : ""}`
320
320
  );
321
- }), a.push(`);
321
+ }), o.push(`);
322
322
 
323
323
  // Mode application mixin
324
324
  @mixin with-color-mode() {
@@ -330,19 +330,19 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
330
330
  @content($mode);
331
331
  }
332
332
  }
333
- }`), a.join(`
333
+ }`), o.join(`
334
334
 
335
335
  `);
336
- }, R = (c) => {
337
- const r = c.themes.filter((a) => a.type === "custom theme").length === 0 ? c.themes.filter((a) => a.type === "default theme") : c.themes.filter((a) => a.type === "custom theme"), s = [];
338
- return r.forEach((a) => {
339
- a.colors.forEach((h) => {
340
- const o = h.shades.find((t) => t.type === "source color"), e = [];
336
+ }, A = (c) => {
337
+ const r = c.themes.filter((o) => o.type === "custom theme").length === 0 ? c.themes.filter((o) => o.type === "default theme") : c.themes.filter((o) => o.type === "custom theme"), s = [];
338
+ return r.forEach((o) => {
339
+ o.colors.forEach((h) => {
340
+ const a = h.shades.find((t) => t.type === "source color"), e = [];
341
341
  e.push(
342
- `<!--${r[0].type === "custom theme" ? `${a.name} - ${h.name}-->` : `${h.name}-->`}`
342
+ `<!--${r[0].type === "custom theme" ? `${o.name} - ${h.name}-->` : `${h.name}-->`}`
343
343
  ), h.shades.reverse().forEach((t) => {
344
344
  e.push(
345
- `<color name="${r[0].type === "custom theme" ? new f(a.name + " " + h.name).doSnakeCase() : new f(h.name).doSnakeCase()}_${t.name}">${t.isTransparent ? p((o == null ? void 0 : o.hex) ?? "#000000").alpha(t.alpha ?? 1).hex() : t.hex}</color>`
345
+ `<color name="${r[0].type === "custom theme" ? new f(o.name + " " + h.name).doSnakeCase() : new f(h.name).doSnakeCase()}_${t.name}">${t.isTransparent ? p((a == null ? void 0 : a.hex) ?? "#000000").alpha(t.alpha ?? 1).hex() : t.hex}</color>`
346
346
  );
347
347
  }), e.push(""), e.forEach((t) => s.push(t));
348
348
  });
@@ -353,39 +353,39 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
353
353
  `
354
354
  )}
355
355
  </resources>`;
356
- }, B = (c) => {
357
- const r = c.themes.filter((o) => o.type === "custom theme").length === 0 ? c.themes.filter((o) => o.type === "default theme") : c.themes.filter((o) => o.type === "custom theme"), s = {
356
+ }, R = (c) => {
357
+ const r = c.themes.filter((a) => a.type === "custom theme").length === 0 ? c.themes.filter((a) => a.type === "default theme") : c.themes.filter((a) => a.type === "custom theme"), s = {
358
358
  $themes: [],
359
359
  $metadata: {
360
360
  activeThemes: [],
361
361
  tokenSetOrder: [],
362
362
  activeSets: []
363
363
  }
364
- }, a = c.name, h = (o, e, t) => ({
364
+ }, o = c.name, h = (a, e, t) => ({
365
365
  $type: "color",
366
366
  $value: e.isTransparent ? p(t.hex).alpha(e.alpha ?? 1).hex() : e.hex,
367
- $description: o.description !== "" ? o.description + " - " + e.description : e.description
367
+ $description: a.description !== "" ? a.description + " - " + e.description : e.description
368
368
  });
369
- return r[0].type === "custom theme" ? r.forEach((o) => {
370
- o.colors.forEach((e) => {
369
+ return r[0].type === "custom theme" ? r.forEach((a) => {
370
+ a.colors.forEach((e) => {
371
371
  const t = e.shades.find(
372
372
  (l) => l.type === "source color"
373
373
  );
374
- s[`${o.name}/${e.name}`] = {}, e.shades.forEach((l) => {
375
- l && t && (s[`${o.name}/${e.name}`][l.name] = h(
374
+ s[`${a.name}/${e.name}`] = {}, e.shades.forEach((l) => {
375
+ l && t && (s[`${a.name}/${e.name}`][l.name] = h(
376
376
  e,
377
377
  l,
378
378
  t
379
379
  ));
380
380
  });
381
381
  });
382
- }) : r.forEach((o) => {
383
- o.colors.forEach((e) => {
382
+ }) : r.forEach((a) => {
383
+ a.colors.forEach((e) => {
384
384
  const t = e.shades.find(
385
385
  (l) => l.type === "source color"
386
386
  );
387
- s[`${a}/${e.name}`] = {}, e.shades.forEach((l) => {
388
- l && t && (s[`${a}/${e.name}`][l.name] = h(
387
+ s[`${o}/${e.name}`] = {}, e.shades.forEach((l) => {
388
+ l && t && (s[`${o}/${e.name}`][l.name] = h(
389
389
  e,
390
390
  l,
391
391
  t
@@ -393,10 +393,10 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
393
393
  });
394
394
  });
395
395
  }), JSON.stringify(s, null, " ");
396
- }, K = (c, r) => {
397
- const s = c.themes.filter((t) => t.type === "custom theme").length === 0 ? c.themes.filter((t) => t.type === "default theme") : c.themes.filter((t) => t.type === "custom theme"), a = [], h = (t) => {
396
+ }, B = (c, r) => {
397
+ const s = c.themes.filter((t) => t.type === "custom theme").length === 0 ? c.themes.filter((t) => t.type === "default theme") : c.themes.filter((t) => t.type === "custom theme"), o = [], h = (t) => {
398
398
  var i;
399
- t.hsl[0] === null && (t.hsl[0] = 0), t.lch[2] === null && (t.lch[2] = 0);
399
+ isNaN(t.hsl[0]) && (t.hsl[0] = 0), isNaN(t.lch[2]) && (t.lch[2] = 0);
400
400
  const l = {
401
401
  RGB: () => `rgb(${Math.floor(t.rgb[0])}, ${Math.floor(
402
402
  t.rgb[1]
@@ -413,7 +413,7 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
413
413
  )}, ${t.gl[2].toFixed(3)})`
414
414
  };
415
415
  return (i = l[r ?? "RGB"]) == null ? void 0 : i.call(l);
416
- }, o = (t, l) => {
416
+ }, a = (t, l) => {
417
417
  var n;
418
418
  const i = {
419
419
  RGB: () => {
@@ -452,15 +452,15 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
452
452
  t.push(`// ${l.name}`), l.shades.reverse().forEach((i) => {
453
453
  const n = l.shades.find((b) => b.type === "source color"), m = `@${new f(l.name).doKebabCase()}-${i.name}`;
454
454
  n && t.push(
455
- `${m}: ${i.isTransparent ? o(i, n) : h(i)};`
455
+ `${m}: ${i.isTransparent ? a(i, n) : h(i)};`
456
456
  );
457
457
  }), t.push("");
458
- }), a.push(t.join(`
458
+ }), o.push(t.join(`
459
459
  `));
460
460
  }
461
461
  return s.filter((t) => t.type === "custom theme").forEach((t) => {
462
462
  const l = new f(t.name).doKebabCase();
463
- a.push(`
463
+ o.push(`
464
464
  // ${t.name} mode
465
465
  #${l} {
466
466
  .mode() {`);
@@ -469,24 +469,24 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
469
469
  i.push(` // ${n.name}`), n.shades.reverse().forEach((m) => {
470
470
  const b = n.shades.find(($) => $.type === "source color"), x = `@${new f(n.name).doKebabCase()}-${m.name}`;
471
471
  b && i.push(
472
- ` ${x}: ${m.isTransparent ? o(m, b) : h(m)};`
472
+ ` ${x}: ${m.isTransparent ? a(m, b) : h(m)};`
473
473
  );
474
474
  }), i.push("");
475
- }), i.length > 0 && i.pop(), a.push(i.join(`
476
- `)), a.push(` }
475
+ }), i.length > 0 && i.pop(), o.push(i.join(`
476
+ `)), o.push(` }
477
477
  }`);
478
- }), a.push(`
478
+ }), o.push(`
479
479
  // Mode application
480
480
  .apply-mode(@mode) {
481
481
  & when (@mode = default) {
482
482
  // Default mode variables are already available
483
483
  }`), s.filter((t) => t.type === "custom theme").forEach((t) => {
484
484
  const l = new f(t.name).doKebabCase();
485
- a.push(`
485
+ o.push(`
486
486
  & when (@mode = ${l}) {
487
487
  #${l} > .mode();
488
488
  }`);
489
- }), a.push(`}
489
+ }), o.push(`}
490
490
 
491
491
  // Mode application via HTML attribute
492
492
  .with-mode(@selector) {
@@ -503,13 +503,13 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
503
503
  }).join(`
504
504
 
505
505
  `)}
506
- }`), a.join(`
506
+ }`), o.join(`
507
507
 
508
508
  `);
509
- }, j = (c, r) => {
510
- const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), a = {}, h = (e) => {
509
+ }, K = (c, r) => {
510
+ const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), o = {}, h = (e) => {
511
511
  var l;
512
- e.oklch[2] === null && (e.oklch[2] = 0);
512
+ isNaN(e.oklch[2]) && (e.oklch[2] = 0);
513
513
  const t = {
514
514
  RGB: () => ({
515
515
  colorSpace: "srgb",
@@ -531,7 +531,7 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
531
531
  })
532
532
  };
533
533
  return (l = t[r ?? "RGB"]) == null ? void 0 : l.call(t);
534
- }, o = (e, t) => {
534
+ }, a = (e, t) => {
535
535
  var i;
536
536
  const l = {
537
537
  RGB: () => ({
@@ -562,17 +562,17 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
562
562
  const l = t.shades.find(
563
563
  (i) => i.type === "source color"
564
564
  );
565
- a[t.name] || (a[t.name] = {
565
+ o[t.name] || (o[t.name] = {
566
566
  $type: "color"
567
567
  }), t.shades.forEach((i) => {
568
- !a[t.name][i.name] && l && (a[t.name][i.name] = {
568
+ !o[t.name][i.name] && l && (o[t.name][i.name] = {
569
569
  $type: "color",
570
- $value: i.isTransparent ? o(l, i) : h(i),
570
+ $value: i.isTransparent ? a(l, i) : h(i),
571
571
  $description: t.description !== "" ? t.description + " - " + i.description : i.description,
572
572
  $extensions: {
573
573
  mode: {}
574
574
  }
575
- }), l && (a[t.name][i.name].$extensions.mode[e.name] = i.isTransparent ? o(l, i) : h(i));
575
+ }), l && (o[t.name][i.name].$extensions.mode[e.name] = i.isTransparent ? a(l, i) : h(i));
576
576
  });
577
577
  });
578
578
  }) : s.forEach((e) => {
@@ -580,37 +580,37 @@ $modes: (`), s.filter((e) => e.type === "custom theme").forEach((e, t, l) => {
580
580
  const l = t.shades.find(
581
581
  (i) => i.type === "source color"
582
582
  );
583
- a[t.name] = {}, t.shades.forEach((i) => {
584
- i && l && (a[t.name][i.name] = {
583
+ o[t.name] = {}, t.shades.forEach((i) => {
584
+ i && l && (o[t.name][i.name] = {
585
585
  $type: "color",
586
- $value: i.isTransparent ? o(l, i) : h(i),
586
+ $value: i.isTransparent ? a(l, i) : h(i),
587
587
  $description: t.description !== "" ? t.description + " - " + i.description : i.description
588
588
  });
589
589
  });
590
590
  });
591
- }), JSON.stringify(a, null, " ");
592
- }, N = (c) => {
593
- const r = c.themes.filter((l) => l.type === "custom theme").length === 0 ? c.themes.filter((l) => l.type === "default theme") : c.themes.filter((l) => l.type === "custom theme"), s = [], a = [], h = [], o = [], e = [], t = [];
591
+ }), JSON.stringify(o, null, " ");
592
+ }, j = (c) => {
593
+ const r = c.themes.filter((l) => l.type === "custom theme").length === 0 ? c.themes.filter((l) => l.type === "default theme") : c.themes.filter((l) => l.type === "custom theme"), s = [], o = [], h = [], a = [], e = [], t = [];
594
594
  return r.forEach((l) => {
595
595
  l.colors.forEach((i) => {
596
596
  i.shades.forEach((n) => {
597
- h.push(n.name), o.push(Math.floor(n.lch[0])), e.push(Math.floor(n.lch[1])), t.push(Math.floor(n.lch[2]));
597
+ h.push(n.name), a.push(Math.floor(n.lch[0])), e.push(Math.floor(n.lch[1])), t.push(Math.floor(n.lch[2]));
598
598
  }), s.push({
599
599
  name: i.name,
600
600
  csv: `${i.name},Lightness,Chroma,Hue
601
- ${h.map((n, m) => `${n},${o[m]},${e[m]},${t[m]}`).join(`
601
+ ${h.map((n, m) => `${n},${a[m]},${e[m]},${t[m]}`).join(`
602
602
  `)}`
603
- }), h.splice(0, h.length), o.splice(0, o.length), e.splice(0, e.length), t.splice(0, t.length);
604
- }), a.push({
603
+ }), h.splice(0, h.length), a.splice(0, a.length), e.splice(0, e.length), t.splice(0, t.length);
604
+ }), o.push({
605
605
  name: l.name,
606
606
  colors: s.map((i) => i),
607
607
  type: l.type
608
608
  }), s.splice(0, s.length);
609
- }), a;
609
+ }), o;
610
610
  }, G = (c, r) => {
611
- const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), a = [], h = (e) => {
611
+ const s = c.themes.filter((e) => e.type === "custom theme").length === 0 ? c.themes.filter((e) => e.type === "default theme") : c.themes.filter((e) => e.type === "custom theme"), o = [], h = (e) => {
612
612
  var l;
613
- e.hsl[0] === null && (e.hsl[0] = 0), e.lch[2] === null && (e.lch[2] = 0);
613
+ isNaN(e.hsl[0]) && (e.hsl[0] = 0), isNaN(e.lch[2]) && (e.lch[2] = 0);
614
614
  const t = {
615
615
  RGB: () => `rgb(${Math.floor(e.rgb[0])}, ${Math.floor(
616
616
  e.rgb[1]
@@ -619,15 +619,15 @@ ${h.map((n, m) => `${n},${o[m]},${e[m]},${t[m]}`).join(`
619
619
  HSL: () => `hsl(${Math.floor(e.hsl[0])} ${Math.floor(
620
620
  e.hsl[1] * 100
621
621
  )}% ${Math.floor(e.hsl[2] * 100)}%)`,
622
- LCH: () => `lch(${Math.floor(e.lch[0])}% ${Math.floor(
622
+ LCH: () => (e.lch[2] === null && (e.lch[2] = 0), `lch(${Math.floor(e.lch[0])}% ${Math.floor(
623
623
  e.lch[1]
624
- )} ${Math.floor(e.lch[2])})`,
624
+ )} ${Math.floor(e.lch[2])})`),
625
625
  P3: () => `color(display-p3 ${e.gl[0].toFixed(3)} ${e.gl[1].toFixed(
626
626
  3
627
627
  )} ${e.gl[2].toFixed(3)})`
628
628
  };
629
629
  return (l = t[r ?? "RGB"]) == null ? void 0 : l.call(t);
630
- }, o = (e, t) => {
630
+ }, a = (e, t) => {
631
631
  var i;
632
632
  const l = {
633
633
  RGB: () => {
@@ -664,28 +664,28 @@ ${h.map((n, m) => `${n},${o[m]},${e[m]},${t[m]}`).join(`
664
664
  t.push(`/* ${l.name} */`), l.shades.reverse().forEach((i) => {
665
665
  const n = l.shades.find((m) => m.type === "source color");
666
666
  n && t.push(
667
- `--${new f(l.name).doKebabCase()}-${i.name}: ${i.isTransparent ? o(i, n) : h(i)};`
667
+ `--${new f(l.name).doKebabCase()}-${i.name}: ${i.isTransparent ? a(i, n) : h(i)};`
668
668
  );
669
669
  }), t.push("");
670
- }), t.pop(), a.push(
670
+ }), t.pop(), o.push(
671
671
  `:root${e.type === "custom theme" ? `[data-theme='${new f(e.name).doKebabCase()}']` : ""} {
672
672
  ${t.join(`
673
673
  `)}
674
674
  }`
675
675
  );
676
- }), a.join(`
676
+ }), o.join(`
677
677
 
678
678
  `);
679
679
  }, _ = (c) => {
680
- const r = c.themes.filter((a) => a.type === "custom theme").length === 0 ? c.themes.filter((a) => a.type === "default theme") : c.themes.filter((a) => a.type === "custom theme"), s = [];
681
- return r.forEach((a) => {
682
- a.colors.forEach((h) => {
683
- const o = h.shades.find((t) => t.type === "source color"), e = [];
680
+ const r = c.themes.filter((o) => o.type === "custom theme").length === 0 ? c.themes.filter((o) => o.type === "default theme") : c.themes.filter((o) => o.type === "custom theme"), s = [];
681
+ return r.forEach((o) => {
682
+ o.colors.forEach((h) => {
683
+ const a = h.shades.find((t) => t.type === "source color"), e = [];
684
684
  e.push(
685
- `// ${r[0].type === "custom theme" ? a.name + " - " : ""}${h.name}`
685
+ `// ${r[0].type === "custom theme" ? o.name + " - " : ""}${h.name}`
686
686
  ), h.shades.reverse().forEach((t) => {
687
687
  e.push(
688
- `val ${r[0].type === "custom theme" ? new f(a.name + " " + h.name).doSnakeCase() : new f(h.name).doSnakeCase()}_${t.name} = Color(${t.isTransparent ? p((o == null ? void 0 : o.hex) ?? "#000000").alpha(t.alpha ?? 1).hex().replace("#", "0xFF").toUpperCase() : t.hex.replace("#", "0xFF").toUpperCase()})`
688
+ `val ${r[0].type === "custom theme" ? new f(o.name + " " + h.name).doSnakeCase() : new f(h.name).doSnakeCase()}_${t.name} = Color(${t.isTransparent ? p((a == null ? void 0 : a.hex) ?? "#000000").alpha(t.alpha ?? 1).hex().replace("#", "0xFF").toUpperCase() : t.hex.replace("#", "0xFF").toUpperCase()})`
689
689
  );
690
690
  }), e.push(""), e.forEach((t) => s.push(t));
691
691
  });
@@ -698,7 +698,7 @@ class O {
698
698
  constructor({
699
699
  base: r,
700
700
  themes: s,
701
- meta: a
701
+ meta: o
702
702
  }) {
703
703
  u(this, "base");
704
704
  u(this, "themes");
@@ -713,24 +713,24 @@ class O {
713
713
  colors: [],
714
714
  type: r.type
715
715
  };
716
- this.base.colors.forEach((a) => {
716
+ this.base.colors.forEach((o) => {
717
717
  const h = Object.entries(r.scale).reverse().map((n) => {
718
- if (a.alpha.isEnabled) {
718
+ if (o.alpha.isEnabled) {
719
719
  const m = new d({
720
720
  render: "RGB",
721
721
  sourceColor: [
722
- a.rgb.r * 255,
723
- a.rgb.g * 255,
724
- a.rgb.b * 255
722
+ o.rgb.r * 255,
723
+ o.rgb.g * 255,
724
+ o.rgb.b * 255
725
725
  ],
726
726
  alpha: parseFloat((n[1] / 100).toFixed(2)),
727
- hueShifting: a.hue.shift !== void 0 ? a.hue.shift : 0,
728
- chromaShifting: a.chroma.shift !== void 0 ? a.chroma.shift : 100,
727
+ hueShifting: o.hue.shift !== void 0 ? o.hue.shift : 0,
728
+ chromaShifting: o.chroma.shift !== void 0 ? o.chroma.shift : 100,
729
729
  algorithmVersion: this.base.algorithmVersion,
730
730
  visionSimulationMode: r.visionSimulationMode
731
731
  }), b = new d({
732
732
  render: "RGB",
733
- sourceColor: p(a.alpha.backgroundColor).rgb(),
733
+ sourceColor: p(o.alpha.backgroundColor).rgb(),
734
734
  algorithmVersion: this.base.algorithmVersion,
735
735
  visionSimulationMode: r.visionSimulationMode
736
736
  });
@@ -802,13 +802,13 @@ class O {
802
802
  const m = new d({
803
803
  render: "RGB",
804
804
  sourceColor: [
805
- a.rgb.r * 255,
806
- a.rgb.g * 255,
807
- a.rgb.b * 255
805
+ o.rgb.r * 255,
806
+ o.rgb.g * 255,
807
+ o.rgb.b * 255
808
808
  ],
809
809
  lightness: n[1],
810
- hueShifting: a.hue.shift !== void 0 ? a.hue.shift : 0,
811
- chromaShifting: a.chroma.shift !== void 0 ? a.chroma.shift : 100,
810
+ hueShifting: o.hue.shift !== void 0 ? o.hue.shift : 0,
811
+ chromaShifting: o.chroma.shift !== void 0 ? o.chroma.shift : 100,
812
812
  algorithmVersion: this.base.algorithmVersion,
813
813
  visionSimulationMode: r.visionSimulationMode
814
814
  });
@@ -829,18 +829,18 @@ class O {
829
829
  return [n, [0, 0, 0]];
830
830
  }
831
831
  }
832
- }), o = {
833
- id: a.id,
834
- name: a.name,
835
- description: a.description,
832
+ }), a = {
833
+ id: o.id,
834
+ name: o.name,
835
+ description: o.description,
836
836
  shades: [],
837
837
  type: "color"
838
838
  }, e = [
839
- a.rgb.r * 255,
840
- a.rgb.g * 255,
841
- a.rgb.b * 255
839
+ o.rgb.r * 255,
840
+ o.rgb.g * 255,
841
+ o.rgb.b * 255
842
842
  ], t = new C();
843
- t.rgb_r = a.rgb.r, t.rgb_g = a.rgb.g, t.rgb_b = a.rgb.b, t.rgbToHsluv(), o.shades.push({
843
+ t.rgb_r = o.rgb.r, t.rgb_g = o.rgb.g, t.rgb_b = o.rgb.b, t.rgbToHsluv(), a.shades.push({
844
844
  name: "source",
845
845
  description: "Source color",
846
846
  hex: p(e).hex(),
@@ -881,21 +881,21 @@ class O {
881
881
  sourceColor: p(e).rgb(),
882
882
  visionSimulationMode: r.visionSimulationMode
883
883
  }).setColor();
884
- m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? ($.rgb_r = Number(y[0]) / 255, $.rgb_g = Number(y[1]) / 255, $.rgb_b = Number(y[2]) / 255) : ($.rgb_r = Number(n[1][0]) / 255, $.rgb_g = Number(n[1][1]) / 255, $.rgb_b = Number(n[1][2]) / 255), $.rgbToHsluv(), o.shades.push({
884
+ m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? ($.rgb_r = Number(y[0]) / 255, $.rgb_g = Number(y[1]) / 255, $.rgb_b = Number(y[2]) / 255) : ($.rgb_r = Number(n[1][0]) / 255, $.rgb_g = Number(n[1][1]) / 255, $.rgb_b = Number(n[1][2]) / 255), $.rgbToHsluv(), a.shades.push({
885
885
  name: x,
886
- description: `Shade/Tint color with ${typeof n[0][1] == "number" ? n[0][1].toFixed(1) : n[0][1]}% of ${a.alpha.isEnabled ? "opacity" : "lightness"}`,
887
- hex: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).hex() : p(n[1]).hex(),
888
- rgb: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).rgb() : p(n[1]).rgb(),
889
- gl: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).gl() : p(n[1]).gl(),
890
- lch: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).lch() : p(n[1]).lch(),
891
- oklch: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).oklch() : p(n[1]).oklch(),
892
- lab: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).lab() : p(n[1]).lab(),
893
- oklab: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).oklab() : p(n[1]).oklab(),
894
- hsl: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled ? p(g).hsl() : p(n[1]).hsl(),
886
+ description: `Shade/Tint color with ${typeof n[0][1] == "number" ? n[0][1].toFixed(1) : n[0][1]}% of ${o.alpha.isEnabled ? "opacity" : "lightness"}`,
887
+ hex: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? p(g).hex() : p(n[1]).hex(),
888
+ rgb: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? p(g).rgb() : p(n[1]).rgb(),
889
+ gl: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? p(g).gl() : p(n[1]).gl(),
890
+ lch: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? p(g).lch() : p(n[1]).lch(),
891
+ oklch: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? p(g).oklch() : p(n[1]).oklch(),
892
+ lab: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? p(g).lab() : p(n[1]).lab(),
893
+ oklab: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? p(g).oklab() : p(n[1]).oklab(),
894
+ hsl: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled ? p(g).hsl() : p(n[1]).hsl(),
895
895
  hsluv: [$.hsluv_h, $.hsluv_s, $.hsluv_l],
896
- alpha: a.alpha.isEnabled ? parseFloat((n[0][1] / 100).toFixed(2)) : void 0,
897
- backgroundColor: a.alpha.isEnabled && a.alpha.backgroundColor ? p(n[2]).rgb() : void 0,
898
- mixedColor: a.alpha.isEnabled && a.alpha.backgroundColor ? new d({
896
+ alpha: o.alpha.isEnabled ? parseFloat((n[0][1] / 100).toFixed(2)) : void 0,
897
+ backgroundColor: o.alpha.isEnabled && o.alpha.backgroundColor ? p(n[2]).rgb() : void 0,
898
+ mixedColor: o.alpha.isEnabled && o.alpha.backgroundColor ? new d({
899
899
  visionSimulationMode: r.visionSimulationMode
900
900
  }).mixColorsRgb(
901
901
  [
@@ -907,25 +907,25 @@ class O {
907
907
  [...n[2], 1]
908
908
  ) : void 0,
909
909
  isClosestToRef: b < 4 && !this.base.areSourceColorsLocked,
910
- isSourceColorLocked: m === i && this.base.areSourceColorsLocked && !a.alpha.isEnabled,
911
- isTransparent: a.alpha.isEnabled,
910
+ isSourceColorLocked: m === i && this.base.areSourceColorsLocked && !o.alpha.isEnabled,
911
+ isTransparent: o.alpha.isEnabled,
912
912
  type: "color shade/tint"
913
913
  });
914
- }), s.colors.push(o);
914
+ }), s.colors.push(a);
915
915
  }), this.paletteData.themes.push(s);
916
916
  }), this.paletteData));
917
917
  u(this, "makeLibraryData", (r, s) => {
918
- const a = this.makePaletteData();
919
- return a.themes.flatMap(
920
- (o) => o.colors.flatMap(
918
+ const o = this.makePaletteData();
919
+ return o.themes.flatMap(
920
+ (a) => a.colors.flatMap(
921
921
  (e) => e.shades.flatMap((t) => {
922
- const l = `${o.id}:${e.id}:${t.name}`, i = s == null ? void 0 : s.find(
922
+ const l = `${a.id}:${e.id}:${t.name}`, i = s == null ? void 0 : s.find(
923
923
  (n) => n.id === l
924
924
  );
925
925
  return {
926
926
  id: l,
927
- paletteName: a.name,
928
- themeName: o.name,
927
+ paletteName: o.name,
928
+ themeName: a.name,
929
929
  colorName: e.name,
930
930
  shadeName: t.name,
931
931
  ...(r == null ? void 0 : r.includes("alpha")) && { alpha: t.alpha ?? 1 },
@@ -953,15 +953,15 @@ class O {
953
953
  });
954
954
  u(this, "makeNativeTokens", () => {
955
955
  const r = this.makePaletteData();
956
- return B(r);
956
+ return R(r);
957
957
  });
958
958
  u(this, "makeDtcgTokens", (r = "RGB") => {
959
959
  const s = this.makePaletteData();
960
- return j(s, r);
960
+ return K(s, r);
961
961
  });
962
962
  u(this, "makeStyleDictionaryTokens", () => {
963
963
  const r = this.makePaletteData();
964
- return P(r);
964
+ return H(r);
965
965
  });
966
966
  u(this, "makeUniversalJson", () => {
967
967
  const r = this.makePaletteData();
@@ -971,13 +971,13 @@ class O {
971
971
  const s = this.makePaletteData();
972
972
  return G(s, r);
973
973
  });
974
- u(this, "makeScssVariable", (r = "RGB") => {
974
+ u(this, "makeScssVariables", (r = "RGB") => {
975
975
  const s = this.makePaletteData();
976
- return A(s, r);
976
+ return P(s, r);
977
977
  });
978
978
  u(this, "makeLessVariables", (r = "RGB") => {
979
979
  const s = this.makePaletteData();
980
- return K(s, r);
980
+ return B(s, r);
981
981
  });
982
982
  u(this, "makeTailwindConfig", () => {
983
983
  const r = this.makePaletteData();
@@ -985,7 +985,7 @@ class O {
985
985
  });
986
986
  u(this, "makeSwiftUI", () => {
987
987
  const r = this.makePaletteData();
988
- return H(r);
988
+ return N(r);
989
989
  });
990
990
  u(this, "makeUIKit", () => {
991
991
  const r = this.makePaletteData();
@@ -997,11 +997,11 @@ class O {
997
997
  });
998
998
  u(this, "makeResources", () => {
999
999
  const r = this.makePaletteData();
1000
- return R(r);
1000
+ return A(r);
1001
1001
  });
1002
1002
  u(this, "makeCsv", () => {
1003
1003
  const r = this.makePaletteData();
1004
- return N(r);
1004
+ return j(r);
1005
1005
  });
1006
1006
  u(this, "makePaletteFullData", () => ({
1007
1007
  base: this.base,
@@ -1012,12 +1012,12 @@ class O {
1012
1012
  type: "UI_COLOR_PALETTE"
1013
1013
  }));
1014
1014
  var h;
1015
- this.base = r, this.themes = s, this.meta = a, this.paletteData = {
1015
+ this.base = r, this.themes = s, this.meta = o, this.paletteData = {
1016
1016
  name: r.name ?? "UI Color Palette",
1017
1017
  description: r.description,
1018
1018
  themes: [],
1019
1019
  type: "palette"
1020
- }, this.currentScale = ((h = s.find((o) => o.isEnabled)) == null ? void 0 : h.scale) ?? {};
1020
+ }, this.currentScale = ((h = s.find((a) => a.isEnabled)) == null ? void 0 : h.scale) ?? {};
1021
1021
  }
1022
1022
  }
1023
1023
  export {