@a_ng_d/utils-ui-color-palette 1.4.2 → 1.5.0

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