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