@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.
- package/README.md +9 -9
- package/dist/formats/makeCssCustomProps.d.ts.map +1 -1
- package/dist/formats/makeDtcgTokens.d.ts.map +1 -1
- package/dist/formats/makeLessVariables.d.ts.map +1 -1
- package/dist/formats/makeScssVariables.d.ts.map +1 -1
- package/dist/formats/makeStyleDictionaryV3Tokens.d.ts +5 -0
- package/dist/formats/makeStyleDictionaryV3Tokens.d.ts.map +1 -0
- package/dist/formats/makeTailwindV3Config.d.ts +7 -0
- package/dist/formats/makeTailwindV3Config.d.ts.map +1 -0
- package/dist/formats/makeTailwindV4Config.d.ts +5 -0
- package/dist/formats/makeTailwindV4Config.d.ts.map +1 -0
- package/dist/modules/data/data.d.ts +4 -3
- package/dist/modules/data/data.d.ts.map +1 -1
- package/dist/modules/data/data.js +585 -531
- package/dist/modules/data/data.js.map +1 -1
- package/package.json +1 -1
- package/dist/formats/makeStyleDictionaryTokens.d.ts +0 -5
- package/dist/formats/makeStyleDictionaryTokens.d.ts.map +0 -1
- package/dist/formats/makeTailwindConfig.d.ts +0 -7
- package/dist/formats/makeTailwindConfig.d.ts.map +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
var
|
|
4
|
-
import { C as
|
|
5
|
-
import { c as
|
|
6
|
-
const
|
|
7
|
-
const r =
|
|
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
|
-
}),
|
|
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
|
|
100
|
-
(
|
|
99
|
+
const o = e.shades.find(
|
|
100
|
+
(c) => c.type === "source color"
|
|
101
101
|
);
|
|
102
|
-
s[a.name][e.name] = {}, e.shades.forEach((
|
|
103
|
-
|
|
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
|
|
109
|
-
(
|
|
108
|
+
const o = e.shades.find(
|
|
109
|
+
(c) => c.type === "source color"
|
|
110
110
|
);
|
|
111
|
-
s[e.name] = {}, e.shades.forEach((
|
|
112
|
-
|
|
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 =
|
|
115
|
+
}), s.description = m.description, s.type = "color palette", JSON.stringify(s, null, " ");
|
|
116
116
|
};
|
|
117
|
-
var
|
|
118
|
-
class
|
|
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
|
-
|
|
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
|
|
124
|
-
const r =
|
|
125
|
-
return r.forEach((
|
|
126
|
-
const
|
|
127
|
-
|
|
128
|
-
const e = a.shades.find((
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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: ${
|
|
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
|
-
`struct ${new
|
|
144
|
-
${
|
|
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(`${
|
|
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
|
-
},
|
|
159
|
-
const r =
|
|
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
|
|
165
|
-
s.theme.colors[new
|
|
166
|
-
}), r[0].type === "custom theme" ? r.forEach((
|
|
167
|
-
|
|
168
|
-
const a =
|
|
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
|
|
172
|
-
s.theme.colors[new
|
|
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((
|
|
176
|
-
|
|
177
|
-
const a =
|
|
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
|
|
181
|
-
s.theme.colors[new
|
|
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
|
-
},
|
|
186
|
-
const r =
|
|
187
|
-
return r.forEach((
|
|
188
|
-
|
|
189
|
-
const a =
|
|
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" ?
|
|
192
|
-
),
|
|
233
|
+
`// ${r[0].type === "custom theme" ? t.name + " - " : ""}${i.name}`
|
|
234
|
+
), i.shades.reverse().forEach((o) => {
|
|
193
235
|
e.push(
|
|
194
|
-
|
|
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: ${
|
|
238
|
+
)}, green: ${a == null ? void 0 : a.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
|
|
197
239
|
3
|
|
198
|
-
)}).opacity(${
|
|
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: ${
|
|
242
|
+
)}, green: ${o.gl[1].toFixed(3)}, blue: ${o.gl[2].toFixed(
|
|
201
243
|
3
|
|
202
244
|
)})`
|
|
203
245
|
);
|
|
204
|
-
}), e.push(""), e.forEach((
|
|
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
|
-
},
|
|
218
|
-
const r =
|
|
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
|
-
},
|
|
262
|
+
}, t = (i, a, e) => ({
|
|
221
263
|
type: "color",
|
|
222
|
-
value: a.isTransparent ?
|
|
223
|
-
comment:
|
|
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
|
|
226
|
-
s.color[
|
|
227
|
-
}), r[0].type === "custom theme" ? r.forEach((
|
|
228
|
-
|
|
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
|
-
(
|
|
272
|
+
(o) => o.type === "source color"
|
|
231
273
|
);
|
|
232
|
-
s.color[a.name][
|
|
233
|
-
|
|
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
|
-
|
|
277
|
+
o,
|
|
236
278
|
e
|
|
237
279
|
));
|
|
238
280
|
});
|
|
239
281
|
});
|
|
240
|
-
}) : r.forEach((
|
|
241
|
-
|
|
282
|
+
}) : r.forEach((i) => {
|
|
283
|
+
i.colors.forEach((a) => {
|
|
242
284
|
const e = a.shades.find(
|
|
243
|
-
(
|
|
285
|
+
(o) => o.type === "source color"
|
|
244
286
|
);
|
|
245
|
-
s.color[a.name] = {}, a.shades.forEach((
|
|
246
|
-
|
|
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 = (
|
|
251
|
-
const s =
|
|
252
|
-
var
|
|
253
|
-
isNaN(
|
|
254
|
-
const
|
|
255
|
-
RGB: () => `rgb(${Math.floor(
|
|
256
|
-
|
|
257
|
-
)}, ${Math.floor(
|
|
258
|
-
HEX: () =>
|
|
259
|
-
HSL: () => `hsl(${Math.floor(
|
|
260
|
-
|
|
261
|
-
)}
|
|
262
|
-
LCH: () => `lch(${Math.floor(
|
|
263
|
-
|
|
264
|
-
)}
|
|
265
|
-
|
|
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 (
|
|
270
|
-
},
|
|
271
|
-
var
|
|
272
|
-
|
|
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
|
|
275
|
-
return `rgba(${Math.floor(
|
|
276
|
-
|
|
277
|
-
)}, ${Math.floor(
|
|
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
|
|
320
|
+
HEX: () => f(p.hex).alpha(n.alpha ?? 1).hex(),
|
|
280
321
|
HSL: () => {
|
|
281
|
-
var
|
|
282
|
-
return `hsla(${Math.floor(
|
|
283
|
-
|
|
284
|
-
)}%, ${Math.floor(
|
|
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
|
|
288
|
-
return `lch(${Math.floor(
|
|
289
|
-
|
|
290
|
-
)} ${Math.floor(
|
|
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
|
-
|
|
293
|
-
var
|
|
294
|
-
return `
|
|
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 (
|
|
300
|
-
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
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
|
-
})
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
const
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
}),
|
|
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
|
-
|
|
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
|
-
},
|
|
337
|
-
const r =
|
|
338
|
-
return r.forEach((
|
|
339
|
-
|
|
340
|
-
const a =
|
|
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" ? `${
|
|
343
|
-
),
|
|
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
|
|
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((
|
|
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
|
-
},
|
|
357
|
-
const r =
|
|
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
|
-
},
|
|
427
|
+
}, t = m.name, i = (a, e, o) => ({
|
|
365
428
|
$type: "color",
|
|
366
|
-
$value: e.isTransparent ?
|
|
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
|
|
372
|
-
(
|
|
434
|
+
const o = e.shades.find(
|
|
435
|
+
(c) => c.type === "source color"
|
|
373
436
|
);
|
|
374
|
-
s[`${a.name}/${e.name}`] = {}, e.shades.forEach((
|
|
375
|
-
|
|
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
|
-
|
|
378
|
-
|
|
440
|
+
c,
|
|
441
|
+
o
|
|
379
442
|
));
|
|
380
443
|
});
|
|
381
444
|
});
|
|
382
445
|
}) : r.forEach((a) => {
|
|
383
446
|
a.colors.forEach((e) => {
|
|
384
|
-
const
|
|
385
|
-
(
|
|
447
|
+
const o = e.shades.find(
|
|
448
|
+
(c) => c.type === "source color"
|
|
386
449
|
);
|
|
387
|
-
s[`${
|
|
388
|
-
|
|
450
|
+
s[`${t}/${e.name}`] = {}, e.shades.forEach((c) => {
|
|
451
|
+
c && o && (s[`${t}/${e.name}`][c.name] = i(
|
|
389
452
|
e,
|
|
390
|
-
|
|
391
|
-
|
|
453
|
+
c,
|
|
454
|
+
o
|
|
392
455
|
));
|
|
393
456
|
});
|
|
394
457
|
});
|
|
395
458
|
}), JSON.stringify(s, null, " ");
|
|
396
|
-
},
|
|
397
|
-
const s =
|
|
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
|
-
|
|
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
|
|
421
|
-
return `rgba(${Math.floor(
|
|
422
|
-
|
|
423
|
-
)}, ${Math.floor(
|
|
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: () =>
|
|
487
|
+
HEX: () => f(h.hex).alpha(l.alpha ?? 1).hex(),
|
|
426
488
|
HSL: () => {
|
|
427
|
-
var
|
|
428
|
-
return `hsla(${Math.floor(
|
|
429
|
-
|
|
430
|
-
)}
|
|
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
|
|
434
|
-
return `lch(${Math.floor(
|
|
435
|
-
|
|
436
|
-
)} ${Math.floor(
|
|
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
|
-
|
|
439
|
-
var
|
|
440
|
-
return `
|
|
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 (
|
|
505
|
+
return (p = n[r ?? "RGB"]) == null ? void 0 : p.call(n);
|
|
446
506
|
}, e = s.find(
|
|
447
|
-
(
|
|
507
|
+
(l) => l.type === "default theme"
|
|
448
508
|
);
|
|
449
509
|
if (e) {
|
|
450
|
-
const
|
|
451
|
-
e.colors.forEach((
|
|
452
|
-
|
|
453
|
-
const
|
|
454
|
-
|
|
455
|
-
`${
|
|
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
|
-
})
|
|
458
|
-
}),
|
|
459
|
-
`))
|
|
517
|
+
});
|
|
518
|
+
}), t.push(l.join(`
|
|
519
|
+
`)), t.join(`
|
|
520
|
+
`);
|
|
460
521
|
}
|
|
461
|
-
|
|
462
|
-
const
|
|
463
|
-
|
|
464
|
-
// ${
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
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
|
-
})
|
|
475
|
-
}),
|
|
476
|
-
`))
|
|
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
|
-
}),
|
|
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
|
-
|
|
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
|
-
},
|
|
510
|
-
const s =
|
|
511
|
-
var
|
|
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
|
|
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 (
|
|
534
|
-
}, a = (e,
|
|
535
|
-
var
|
|
536
|
-
|
|
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:
|
|
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:
|
|
600
|
+
alpha: o.alpha
|
|
556
601
|
})
|
|
557
602
|
};
|
|
558
|
-
return (
|
|
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((
|
|
562
|
-
const
|
|
563
|
-
(
|
|
606
|
+
e.colors.forEach((o) => {
|
|
607
|
+
const c = o.shades.find(
|
|
608
|
+
(l) => l.type === "source color"
|
|
564
609
|
);
|
|
565
|
-
o
|
|
610
|
+
t[o.name] || (t[o.name] = {
|
|
566
611
|
$type: "color"
|
|
567
|
-
}),
|
|
568
|
-
!o
|
|
612
|
+
}), o.shades.forEach((l) => {
|
|
613
|
+
!t[o.name][l.name] && c && (t[o.name][l.name] = {
|
|
569
614
|
$type: "color",
|
|
570
|
-
$value:
|
|
571
|
-
$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
|
-
}),
|
|
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((
|
|
580
|
-
const
|
|
581
|
-
(
|
|
624
|
+
e.colors.forEach((o) => {
|
|
625
|
+
const c = o.shades.find(
|
|
626
|
+
(l) => l.type === "source color"
|
|
582
627
|
);
|
|
583
|
-
o
|
|
584
|
-
|
|
628
|
+
t[o.name] = {}, o.shades.forEach((l) => {
|
|
629
|
+
l && c && (t[o.name][l.name] = {
|
|
585
630
|
$type: "color",
|
|
586
|
-
$value:
|
|
587
|
-
$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(
|
|
592
|
-
},
|
|
593
|
-
const r =
|
|
594
|
-
return r.forEach((
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
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:
|
|
600
|
-
csv: `${
|
|
601
|
-
${
|
|
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
|
-
}),
|
|
604
|
-
}),
|
|
605
|
-
name:
|
|
606
|
-
colors: s.map((
|
|
607
|
-
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
|
-
}),
|
|
610
|
-
},
|
|
611
|
-
const s =
|
|
612
|
-
var
|
|
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
|
|
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: () =>
|
|
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 (
|
|
630
|
-
}, a = (e,
|
|
631
|
-
var
|
|
632
|
-
const
|
|
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
|
|
635
|
-
return `rgb(${Math.floor(
|
|
636
|
-
|
|
637
|
-
)}, ${Math.floor(
|
|
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: () =>
|
|
685
|
+
HEX: () => f(o.hex).alpha(e.alpha ?? 1).hex(),
|
|
640
686
|
HSL: () => {
|
|
641
|
-
var
|
|
642
|
-
return `hsl(${Math.floor(
|
|
643
|
-
|
|
644
|
-
)}% ${Math.floor(
|
|
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
|
|
648
|
-
return `lch(${Math.floor(
|
|
649
|
-
|
|
650
|
-
)} ${Math.floor(
|
|
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
|
|
654
|
-
return `color(display-p3 ${
|
|
703
|
+
var h;
|
|
704
|
+
return `color(display-p3 ${o.gl[0].toFixed(3)} ${o.gl[1].toFixed(
|
|
655
705
|
3
|
|
656
|
-
)} ${
|
|
706
|
+
)} ${o.gl[2].toFixed(3)} / ${((h = e.alpha) == null ? void 0 : h.toFixed(2)) ?? 1})`;
|
|
657
707
|
}
|
|
658
708
|
};
|
|
659
|
-
return (
|
|
709
|
+
return (l = c[r ?? "RGB"]) == null ? void 0 : l.call(c);
|
|
660
710
|
};
|
|
661
711
|
return s.forEach((e) => {
|
|
662
|
-
const
|
|
663
|
-
e.colors.forEach((
|
|
664
|
-
|
|
665
|
-
const
|
|
666
|
-
|
|
667
|
-
`--${new
|
|
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
|
-
}),
|
|
670
|
-
}),
|
|
671
|
-
`:root${e.type === "custom theme" ? `[data-theme='${new
|
|
672
|
-
${
|
|
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
|
-
}),
|
|
726
|
+
}), t.join(`
|
|
677
727
|
|
|
678
728
|
`);
|
|
679
|
-
},
|
|
680
|
-
const r =
|
|
681
|
-
return r.forEach((
|
|
682
|
-
|
|
683
|
-
const a =
|
|
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" ?
|
|
686
|
-
),
|
|
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
|
|
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((
|
|
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
|
|
747
|
+
class J {
|
|
698
748
|
constructor({
|
|
699
749
|
base: r,
|
|
700
750
|
themes: s,
|
|
701
|
-
meta:
|
|
751
|
+
meta: t
|
|
702
752
|
}) {
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
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((
|
|
717
|
-
const
|
|
718
|
-
if (
|
|
719
|
-
const
|
|
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
|
-
|
|
723
|
-
|
|
724
|
-
|
|
772
|
+
t.rgb.r * 255,
|
|
773
|
+
t.rgb.g * 255,
|
|
774
|
+
t.rgb.b * 255
|
|
725
775
|
],
|
|
726
|
-
alpha: parseFloat((
|
|
727
|
-
hueShifting:
|
|
728
|
-
chromaShifting:
|
|
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
|
-
}),
|
|
781
|
+
}), p = new x({
|
|
732
782
|
render: "RGB",
|
|
733
|
-
sourceColor:
|
|
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
|
-
|
|
741
|
-
|
|
742
|
-
|
|
790
|
+
h,
|
|
791
|
+
n.setColorWithAlpha(),
|
|
792
|
+
p.setColorWithAlpha()
|
|
743
793
|
] : [
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
794
|
+
h,
|
|
795
|
+
n.lcha(),
|
|
796
|
+
p.lcha()
|
|
747
797
|
];
|
|
748
798
|
case "OKLCH":
|
|
749
799
|
return this.base.areSourceColorsLocked ? [
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
800
|
+
h,
|
|
801
|
+
n.setColorWithAlpha(),
|
|
802
|
+
p.setColorWithAlpha()
|
|
753
803
|
] : [
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
804
|
+
h,
|
|
805
|
+
n.oklcha(),
|
|
806
|
+
p.oklcha()
|
|
757
807
|
];
|
|
758
808
|
case "LAB":
|
|
759
809
|
return this.base.areSourceColorsLocked ? [
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
810
|
+
h,
|
|
811
|
+
n.setColorWithAlpha(),
|
|
812
|
+
p.setColorWithAlpha()
|
|
763
813
|
] : [
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
814
|
+
h,
|
|
815
|
+
n.laba(),
|
|
816
|
+
p.laba()
|
|
767
817
|
];
|
|
768
818
|
case "OKLAB":
|
|
769
819
|
return this.base.areSourceColorsLocked ? [
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
820
|
+
h,
|
|
821
|
+
n.setColorWithAlpha(),
|
|
822
|
+
p.setColorWithAlpha()
|
|
773
823
|
] : [
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
824
|
+
h,
|
|
825
|
+
n.oklaba(),
|
|
826
|
+
p.oklaba()
|
|
777
827
|
];
|
|
778
828
|
case "HSL":
|
|
779
829
|
return this.base.areSourceColorsLocked ? [
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
830
|
+
h,
|
|
831
|
+
n.setColorWithAlpha(),
|
|
832
|
+
p.setColorWithAlpha()
|
|
783
833
|
] : [
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
834
|
+
h,
|
|
835
|
+
n.hsla(),
|
|
836
|
+
p.hsla()
|
|
787
837
|
];
|
|
788
838
|
case "HSLUV":
|
|
789
839
|
return this.base.areSourceColorsLocked ? [
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
840
|
+
h,
|
|
841
|
+
n.setColorWithAlpha(),
|
|
842
|
+
p.setColorWithAlpha()
|
|
793
843
|
] : [
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
844
|
+
h,
|
|
845
|
+
n.hsluva(),
|
|
846
|
+
p.hsluva()
|
|
797
847
|
];
|
|
798
848
|
default:
|
|
799
|
-
return [
|
|
849
|
+
return [h, [0, 0, 0], [255, 255, 255]];
|
|
800
850
|
}
|
|
801
851
|
} else {
|
|
802
|
-
const
|
|
852
|
+
const n = new x({
|
|
803
853
|
render: "RGB",
|
|
804
854
|
sourceColor: [
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
855
|
+
t.rgb.r * 255,
|
|
856
|
+
t.rgb.g * 255,
|
|
857
|
+
t.rgb.b * 255
|
|
808
858
|
],
|
|
809
|
-
lightness:
|
|
810
|
-
hueShifting:
|
|
811
|
-
chromaShifting:
|
|
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 [
|
|
867
|
+
return [h, n.lch()];
|
|
818
868
|
case "OKLCH":
|
|
819
|
-
return [
|
|
869
|
+
return [h, n.oklch()];
|
|
820
870
|
case "LAB":
|
|
821
|
-
return [
|
|
871
|
+
return [h, n.lab()];
|
|
822
872
|
case "OKLAB":
|
|
823
|
-
return [
|
|
873
|
+
return [h, n.oklab()];
|
|
824
874
|
case "HSL":
|
|
825
|
-
return [
|
|
875
|
+
return [h, n.hsl()];
|
|
826
876
|
case "HSLUV":
|
|
827
|
-
return [
|
|
877
|
+
return [h, n.hsluv()];
|
|
828
878
|
default:
|
|
829
|
-
return [
|
|
879
|
+
return [h, [0, 0, 0]];
|
|
830
880
|
}
|
|
831
881
|
}
|
|
832
882
|
}), a = {
|
|
833
|
-
id:
|
|
834
|
-
name:
|
|
835
|
-
description:
|
|
883
|
+
id: t.id,
|
|
884
|
+
name: t.name,
|
|
885
|
+
description: t.description,
|
|
836
886
|
shades: [],
|
|
837
887
|
type: "color"
|
|
838
888
|
}, e = [
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
],
|
|
843
|
-
|
|
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:
|
|
896
|
+
hex: f(e).hex(),
|
|
847
897
|
rgb: e,
|
|
848
|
-
gl:
|
|
849
|
-
lch:
|
|
850
|
-
oklch:
|
|
851
|
-
lab:
|
|
852
|
-
oklab:
|
|
853
|
-
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
|
-
|
|
856
|
-
|
|
857
|
-
|
|
905
|
+
o.hsluv_h,
|
|
906
|
+
o.hsluv_s,
|
|
907
|
+
o.hsluv_l
|
|
858
908
|
],
|
|
859
909
|
type: "source color"
|
|
860
910
|
});
|
|
861
|
-
const
|
|
862
|
-
(
|
|
863
|
-
|
|
864
|
-
|
|
911
|
+
const c = i.map(
|
|
912
|
+
(h) => f.distance(
|
|
913
|
+
f(e).hex(),
|
|
914
|
+
f(h[1]).hex(),
|
|
865
915
|
"rgb"
|
|
866
916
|
)
|
|
867
|
-
),
|
|
868
|
-
|
|
869
|
-
const
|
|
870
|
-
|
|
871
|
-
|
|
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
|
-
),
|
|
874
|
-
(
|
|
875
|
-
) ?? "0", $ = new
|
|
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:
|
|
927
|
+
sourceColor: f(e).rgb(),
|
|
878
928
|
visionSimulationMode: r.visionSimulationMode
|
|
879
|
-
}).setColor(),
|
|
929
|
+
}).setColor(), d = new x({
|
|
880
930
|
render: "HEX",
|
|
881
|
-
sourceColor:
|
|
931
|
+
sourceColor: f(e).rgb(),
|
|
882
932
|
visionSimulationMode: r.visionSimulationMode
|
|
883
933
|
}).setColor();
|
|
884
|
-
|
|
885
|
-
name:
|
|
886
|
-
description: `Shade/Tint color with ${typeof
|
|
887
|
-
hex:
|
|
888
|
-
rgb:
|
|
889
|
-
gl:
|
|
890
|
-
lch:
|
|
891
|
-
oklch:
|
|
892
|
-
lab:
|
|
893
|
-
oklab:
|
|
894
|
-
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:
|
|
897
|
-
backgroundColor:
|
|
898
|
-
mixedColor:
|
|
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
|
-
...
|
|
952
|
+
...h[1],
|
|
903
953
|
parseFloat(
|
|
904
|
-
(
|
|
954
|
+
(h[0][1] / 100).toFixed(2)
|
|
905
955
|
)
|
|
906
956
|
],
|
|
907
|
-
[...
|
|
957
|
+
[...h[2], 1]
|
|
908
958
|
) : void 0,
|
|
909
|
-
isClosestToRef:
|
|
910
|
-
isSourceColorLocked:
|
|
911
|
-
isTransparent:
|
|
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
|
-
|
|
918
|
-
const
|
|
919
|
-
return
|
|
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((
|
|
922
|
-
const
|
|
923
|
-
(
|
|
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:
|
|
927
|
-
paletteName:
|
|
976
|
+
id: c,
|
|
977
|
+
paletteName: t.name,
|
|
928
978
|
themeName: a.name,
|
|
929
979
|
colorName: e.name,
|
|
930
|
-
shadeName:
|
|
931
|
-
...(r == null ? void 0 : r.includes("alpha")) && { alpha:
|
|
932
|
-
...(r == null ? void 0 : r.includes("hex")) && { hex:
|
|
933
|
-
...(r == null ? void 0 : r.includes("gl")) && { 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:
|
|
988
|
+
collectionId: l == null ? void 0 : l.collectionId
|
|
939
989
|
},
|
|
940
990
|
...(r == null ? void 0 : r.includes("mode_id")) && {
|
|
941
|
-
modeId:
|
|
991
|
+
modeId: l == null ? void 0 : l.modeId
|
|
942
992
|
},
|
|
943
993
|
...(r == null ? void 0 : r.includes("variable_id")) && {
|
|
944
|
-
variableId:
|
|
994
|
+
variableId: l == null ? void 0 : l.variableId
|
|
945
995
|
},
|
|
946
996
|
...(r == null ? void 0 : r.includes("style_id")) && {
|
|
947
|
-
styleId:
|
|
997
|
+
styleId: l == null ? void 0 : l.styleId
|
|
948
998
|
}
|
|
949
999
|
};
|
|
950
1000
|
})
|
|
951
1001
|
)
|
|
952
1002
|
);
|
|
953
1003
|
});
|
|
954
|
-
|
|
1004
|
+
k(this, "makeNativeTokens", () => {
|
|
955
1005
|
const r = this.makePaletteData();
|
|
956
|
-
return
|
|
1006
|
+
return B(r);
|
|
957
1007
|
});
|
|
958
|
-
|
|
1008
|
+
k(this, "makeDtcgTokens", (r = "RGB") => {
|
|
959
1009
|
const s = this.makePaletteData();
|
|
960
|
-
return
|
|
1010
|
+
return G(s, r);
|
|
961
1011
|
});
|
|
962
|
-
|
|
1012
|
+
k(this, "makeStyleDictionaryV3Tokens", () => {
|
|
963
1013
|
const r = this.makePaletteData();
|
|
964
|
-
return
|
|
1014
|
+
return A(r);
|
|
965
1015
|
});
|
|
966
|
-
|
|
1016
|
+
k(this, "makeUniversalJson", () => {
|
|
967
1017
|
const r = this.makePaletteData();
|
|
968
|
-
return
|
|
1018
|
+
return N(r);
|
|
969
1019
|
});
|
|
970
|
-
|
|
1020
|
+
k(this, "makeCssCustomProps", (r = "RGB") => {
|
|
971
1021
|
const s = this.makePaletteData();
|
|
972
|
-
return
|
|
1022
|
+
return _(s, r);
|
|
973
1023
|
});
|
|
974
|
-
|
|
1024
|
+
k(this, "makeScssVariables", (r = "RGB") => {
|
|
975
1025
|
const s = this.makePaletteData();
|
|
976
1026
|
return P(s, r);
|
|
977
1027
|
});
|
|
978
|
-
|
|
1028
|
+
k(this, "makeLessVariables", (r = "RGB") => {
|
|
979
1029
|
const s = this.makePaletteData();
|
|
980
|
-
return
|
|
1030
|
+
return R(s, r);
|
|
981
1031
|
});
|
|
982
|
-
|
|
1032
|
+
k(this, "makeTailwindV3Config", () => {
|
|
983
1033
|
const r = this.makePaletteData();
|
|
984
|
-
return
|
|
1034
|
+
return K(r);
|
|
985
1035
|
});
|
|
986
|
-
|
|
1036
|
+
k(this, "makeTailwindV4Config", () => {
|
|
987
1037
|
const r = this.makePaletteData();
|
|
988
|
-
return
|
|
1038
|
+
return H(r);
|
|
989
1039
|
});
|
|
990
|
-
|
|
1040
|
+
k(this, "makeSwiftUI", () => {
|
|
991
1041
|
const r = this.makePaletteData();
|
|
992
|
-
return
|
|
1042
|
+
return V(r);
|
|
993
1043
|
});
|
|
994
|
-
|
|
1044
|
+
k(this, "makeUIKit", () => {
|
|
995
1045
|
const r = this.makePaletteData();
|
|
996
|
-
return
|
|
1046
|
+
return L(r);
|
|
997
1047
|
});
|
|
998
|
-
|
|
1048
|
+
k(this, "makeCompose", () => {
|
|
999
1049
|
const r = this.makePaletteData();
|
|
1000
|
-
return
|
|
1050
|
+
return U(r);
|
|
1001
1051
|
});
|
|
1002
|
-
|
|
1052
|
+
k(this, "makeResources", () => {
|
|
1003
1053
|
const r = this.makePaletteData();
|
|
1004
1054
|
return j(r);
|
|
1005
1055
|
});
|
|
1006
|
-
|
|
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
|
|
1015
|
-
this.base = r, this.themes = s, this.meta =
|
|
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 = ((
|
|
1074
|
+
}, this.currentScale = ((i = s.find((a) => a.isEnabled)) == null ? void 0 : i.scale) ?? {};
|
|
1021
1075
|
}
|
|
1022
1076
|
}
|
|
1023
1077
|
export {
|
|
1024
|
-
|
|
1078
|
+
J as default
|
|
1025
1079
|
};
|
|
1026
1080
|
//# sourceMappingURL=data.js.map
|