@a_ng_d/utils-ui-color-palette 1.5.4 → 1.5.6

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