@a_ng_d/utils-ui-color-palette 1.7.6 → 1.7.8

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.
@@ -6,7 +6,6 @@ export default class Data {
6
6
  private themes;
7
7
  private meta?;
8
8
  private paletteData;
9
- private currentScale;
10
9
  constructor({ base, themes, meta, }: {
11
10
  base: BaseConfiguration;
12
11
  themes: Array<ThemeConfiguration>;
@@ -1 +1 @@
1
- {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/modules/data/data.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,WAAW,EAGZ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EAEjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAIjC,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,IAAI,CAAC,CAAmB;IAChC,OAAO,CAAC,WAAW,CAAa;IAChC,OAAO,CAAC,YAAY,CAAoB;gBAE5B,EACV,IAAI,EACJ,MAAM,EACN,IAAI,GACL,EAAE;QACD,IAAI,EAAE,iBAAiB,CAAA;QACvB,MAAM,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACjC,IAAI,CAAC,EAAE,iBAAiB,CAAA;KACzB;IAeD,eAAe,oBAmUd;IAED,eAAe,aACH,KAAK,CACX,eAAe,GACf,SAAS,GACT,aAAa,GACb,UAAU,GACV,IAAI,GACJ,KAAK,GACL,aAAa,GACb,OAAO,CACV,iBACc,KAAK,CAAC,WAAW,CAAC,mBA4ClC;IAED,mBAAmB,0BAWlB;CACF"}
1
+ {"version":3,"file":"data.d.ts","sourceRoot":"","sources":["../../../src/modules/data/data.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,WAAW,EACX,WAAW,EAGZ,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,iBAAiB,EAClB,MAAM,0BAA0B,CAAA;AAIjC,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB,OAAO,CAAC,IAAI,CAAmB;IAC/B,OAAO,CAAC,MAAM,CAA2B;IACzC,OAAO,CAAC,IAAI,CAAC,CAAmB;IAChC,OAAO,CAAC,WAAW,CAAa;gBAEpB,EACV,IAAI,EACJ,MAAM,EACN,IAAI,GACL,EAAE;QACD,IAAI,EAAE,iBAAiB,CAAA;QACvB,MAAM,EAAE,KAAK,CAAC,kBAAkB,CAAC,CAAA;QACjC,IAAI,CAAC,EAAE,iBAAiB,CAAA;KACzB;IAYD,eAAe,oBAkUd;IAED,eAAe,aACH,KAAK,CACX,eAAe,GACf,SAAS,GACT,aAAa,GACb,UAAU,GACV,IAAI,GACJ,KAAK,GACL,aAAa,GACb,OAAO,CACV,iBACc,KAAK,CAAC,WAAW,CAAC,mBA4ClC;IAED,mBAAmB,0BAWlB;CACF"}
@@ -1,21 +1,20 @@
1
1
  var v = Object.defineProperty;
2
- var E = (m, a, h) => a in m ? v(m, a, { enumerable: !0, configurable: !0, writable: !0, value: h }) : m[a] = h;
3
- var d = (m, a, h) => E(m, typeof a != "symbol" ? a + "" : a, h);
4
- import { C as S, H as f } from "../../color-1CXTuV84.js";
2
+ var E = (m, a, b) => a in m ? v(m, a, { enumerable: !0, configurable: !0, writable: !0, value: b }) : m[a] = b;
3
+ var d = (m, a, b) => E(m, typeof a != "symbol" ? a + "" : a, b);
4
+ import { C as g, H as f } from "../../color-1CXTuV84.js";
5
5
  import { c as t } from "../../index-Beb8qoyd.js";
6
6
  class A {
7
7
  constructor({
8
8
  base: a,
9
- themes: h,
9
+ themes: b,
10
10
  meta: r
11
11
  }) {
12
12
  d(this, "base");
13
13
  d(this, "themes");
14
14
  d(this, "meta");
15
15
  d(this, "paletteData");
16
- d(this, "currentScale");
17
16
  d(this, "makePaletteData", () => (this.themes.forEach((a) => {
18
- const h = {
17
+ const b = {
19
18
  id: a.id,
20
19
  name: a.name,
21
20
  description: a.description,
@@ -23,9 +22,9 @@ class A {
23
22
  type: a.type
24
23
  };
25
24
  this.base.colors.forEach((r) => {
26
- const g = Object.entries(a.scale).reverse().map((e) => {
25
+ const S = Object.entries(a.scale).reverse().map((e) => {
27
26
  if (r.alpha.isEnabled) {
28
- const s = new S({
27
+ const s = new g({
29
28
  render: "RGB",
30
29
  sourceColor: [
31
30
  r.rgb.r * 255,
@@ -37,7 +36,7 @@ class A {
37
36
  chromaShifting: r.chroma.shift !== void 0 ? r.chroma.shift : 100,
38
37
  algorithmVersion: this.base.algorithmVersion,
39
38
  visionSimulationMode: a.visionSimulationMode
40
- }), b = new S({
39
+ }), i = new g({
41
40
  render: "RGB",
42
41
  sourceColor: t(r.alpha.backgroundColor).rgb(),
43
42
  algorithmVersion: this.base.algorithmVersion,
@@ -48,67 +47,67 @@ class A {
48
47
  return this.base.areSourceColorsLocked ? [
49
48
  e,
50
49
  s.setColorWithAlpha(),
51
- b.setColorWithAlpha()
50
+ i.setColorWithAlpha()
52
51
  ] : [
53
52
  e,
54
53
  s.lcha(),
55
- b.lcha()
54
+ i.lcha()
56
55
  ];
57
56
  case "OKLCH":
58
57
  return this.base.areSourceColorsLocked ? [
59
58
  e,
60
59
  s.setColorWithAlpha(),
61
- b.setColorWithAlpha()
60
+ i.setColorWithAlpha()
62
61
  ] : [
63
62
  e,
64
63
  s.oklcha(),
65
- b.oklcha()
64
+ i.oklcha()
66
65
  ];
67
66
  case "LAB":
68
67
  return this.base.areSourceColorsLocked ? [
69
68
  e,
70
69
  s.setColorWithAlpha(),
71
- b.setColorWithAlpha()
70
+ i.setColorWithAlpha()
72
71
  ] : [
73
72
  e,
74
73
  s.laba(),
75
- b.laba()
74
+ i.laba()
76
75
  ];
77
76
  case "OKLAB":
78
77
  return this.base.areSourceColorsLocked ? [
79
78
  e,
80
79
  s.setColorWithAlpha(),
81
- b.setColorWithAlpha()
80
+ i.setColorWithAlpha()
82
81
  ] : [
83
82
  e,
84
83
  s.oklaba(),
85
- b.oklaba()
84
+ i.oklaba()
86
85
  ];
87
86
  case "HSL":
88
87
  return this.base.areSourceColorsLocked ? [
89
88
  e,
90
89
  s.setColorWithAlpha(),
91
- b.setColorWithAlpha()
90
+ i.setColorWithAlpha()
92
91
  ] : [
93
92
  e,
94
93
  s.hsla(),
95
- b.hsla()
94
+ i.hsla()
96
95
  ];
97
96
  case "HSLUV":
98
97
  return this.base.areSourceColorsLocked ? [
99
98
  e,
100
99
  s.setColorWithAlpha(),
101
- b.setColorWithAlpha()
100
+ i.setColorWithAlpha()
102
101
  ] : [
103
102
  e,
104
103
  s.hsluva(),
105
- b.hsluva()
104
+ i.hsluva()
106
105
  ];
107
106
  default:
108
107
  return [e, [0, 0, 0], [255, 255, 255]];
109
108
  }
110
109
  } else {
111
- const s = new S({
110
+ const s = new g({
112
111
  render: "RGB",
113
112
  sourceColor: [
114
113
  r.rgb.r * 255,
@@ -138,73 +137,71 @@ class A {
138
137
  return [e, [0, 0, 0]];
139
138
  }
140
139
  }
141
- }), u = {
140
+ }), n = {
142
141
  id: r.id,
143
142
  name: r.name,
144
143
  description: r.description,
145
144
  shades: [],
146
145
  type: "color"
147
- }, i = [
146
+ }, h = [
148
147
  r.rgb.r * 255,
149
148
  r.rgb.g * 255,
150
149
  r.rgb.b * 255
151
- ], c = new f();
152
- c.rgb_r = r.rgb.r, c.rgb_g = r.rgb.g, c.rgb_b = r.rgb.b, c.rgbToHsluv(), u.shades.push({
150
+ ], o = new f();
151
+ o.rgb_r = r.rgb.r, o.rgb_g = r.rgb.g, o.rgb_b = r.rgb.b, o.rgbToHsluv(), n.shades.push({
153
152
  name: "source",
154
153
  description: "Source color",
155
- hex: t(i).hex(),
156
- rgb: i,
157
- gl: t(i).gl(),
158
- lch: t(i).lch(),
159
- oklch: t(i).oklch(),
160
- lab: t(i).lab(),
161
- oklab: t(i).oklab(),
162
- hsl: t(i).hsl(),
154
+ hex: t(h).hex(),
155
+ rgb: h,
156
+ gl: t(h).gl(),
157
+ lch: t(h).lch(),
158
+ oklch: t(h).oklch(),
159
+ lab: t(h).lab(),
160
+ oklab: t(h).oklab(),
161
+ hsl: t(h).hsl(),
163
162
  hsluv: [
164
- c.hsluv_h,
165
- c.hsluv_s,
166
- c.hsluv_l
163
+ o.hsluv_h,
164
+ o.hsluv_s,
165
+ o.hsluv_l
167
166
  ],
168
167
  type: "source color"
169
168
  });
170
- const k = g.map(
169
+ const k = S.map(
171
170
  (e) => t.distance(
172
- t(i).hex(),
171
+ t(h).hex(),
173
172
  t(e[1]).hex(),
174
173
  "rgb"
175
174
  )
176
175
  ), l = k.indexOf(Math.min(...k));
177
- g.forEach((e, s) => {
178
- const b = t.distance(
179
- t(i).hex(),
176
+ S.forEach((e, s) => {
177
+ const i = t.distance(
178
+ t(h).hex(),
180
179
  t(e[1]).hex(),
181
180
  "rgb"
182
- ), L = Object.keys(this.currentScale).find(
183
- (p) => p === e[0][0]
184
- ) ?? "0", o = new f(), C = new S({
181
+ ), L = Object.keys(a.scale).find((p) => p === e[0][0]) ?? "0", u = new f(), C = new g({
185
182
  render: "RGB",
186
- sourceColor: t(i).rgb(),
183
+ sourceColor: t(h).rgb(),
187
184
  visionSimulationMode: a.visionSimulationMode
188
- }).setColor(), n = new S({
185
+ }).setColor(), c = new g({
189
186
  render: "HEX",
190
- sourceColor: t(i).rgb(),
187
+ sourceColor: t(h).rgb(),
191
188
  visionSimulationMode: a.visionSimulationMode
192
189
  }).setColor();
193
- s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? (o.rgb_r = Number(C[0]) / 255, o.rgb_g = Number(C[1]) / 255, o.rgb_b = Number(C[2]) / 255) : (o.rgb_r = Number(e[1][0]) / 255, o.rgb_g = Number(e[1][1]) / 255, o.rgb_b = Number(e[1][2]) / 255), o.rgbToHsluv(), u.shades.push({
190
+ s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? (u.rgb_r = Number(C[0]) / 255, u.rgb_g = Number(C[1]) / 255, u.rgb_b = Number(C[2]) / 255) : (u.rgb_r = Number(e[1][0]) / 255, u.rgb_g = Number(e[1][1]) / 255, u.rgb_b = Number(e[1][2]) / 255), u.rgbToHsluv(), n.shades.push({
194
191
  name: L,
195
192
  description: `Shade/Tint color with ${typeof e[0][1] == "number" ? e[0][1].toFixed(1) : e[0][1]}% of ${r.alpha.isEnabled ? "opacity" : "lightness"}`,
196
- hex: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(n).hex() : t(e[1]).hex(),
197
- rgb: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(n).rgb() : t(e[1]).rgb(),
198
- gl: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(n).gl() : t(e[1]).gl(),
199
- lch: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(n).lch() : t(e[1]).lch(),
200
- oklch: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(n).oklch() : t(e[1]).oklch(),
201
- lab: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(n).lab() : t(e[1]).lab(),
202
- oklab: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(n).oklab() : t(e[1]).oklab(),
203
- hsl: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(n).hsl() : t(e[1]).hsl(),
204
- hsluv: [o.hsluv_h, o.hsluv_s, o.hsluv_l],
193
+ hex: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(c).hex() : t(e[1]).hex(),
194
+ rgb: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(c).rgb() : t(e[1]).rgb(),
195
+ gl: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(c).gl() : t(e[1]).gl(),
196
+ lch: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(c).lch() : t(e[1]).lch(),
197
+ oklch: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(c).oklch() : t(e[1]).oklch(),
198
+ lab: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(c).lab() : t(e[1]).lab(),
199
+ oklab: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(c).oklab() : t(e[1]).oklab(),
200
+ hsl: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled ? t(c).hsl() : t(e[1]).hsl(),
201
+ hsluv: [u.hsluv_h, u.hsluv_s, u.hsluv_l],
205
202
  alpha: r.alpha.isEnabled ? parseFloat((e[0][1] / 100).toFixed(2)) : void 0,
206
203
  backgroundColor: r.alpha.isEnabled && r.alpha.backgroundColor ? t(e[2]).rgb() : void 0,
207
- mixedColor: r.alpha.isEnabled && r.alpha.backgroundColor ? new S({
204
+ mixedColor: r.alpha.isEnabled && r.alpha.backgroundColor ? new g({
208
205
  visionSimulationMode: a.visionSimulationMode
209
206
  }).mixColorsRgb(
210
207
  [
@@ -215,33 +212,33 @@ class A {
215
212
  ],
216
213
  [...e[2], 1]
217
214
  ) : void 0,
218
- isClosestToRef: b < 4 && !this.base.areSourceColorsLocked,
215
+ isClosestToRef: i < 4 && !this.base.areSourceColorsLocked,
219
216
  isSourceColorLocked: s === l && this.base.areSourceColorsLocked && !r.alpha.isEnabled,
220
217
  isTransparent: r.alpha.isEnabled,
221
218
  type: "color shade/tint"
222
219
  });
223
- }), h.colors.push(u);
224
- }), this.paletteData.themes.push(h);
220
+ }), b.colors.push(n);
221
+ }), this.paletteData.themes.push(b);
225
222
  }), this.paletteData));
226
- d(this, "makeLibraryData", (a, h) => {
223
+ d(this, "makeLibraryData", (a, b) => {
227
224
  const r = this.makePaletteData();
228
225
  return r.themes.flatMap(
229
- (u) => u.colors.flatMap(
230
- (i) => i.shades.flatMap((c) => {
231
- const k = `${u.id}:${i.id}:${c.name}`, l = h == null ? void 0 : h.find(
226
+ (n) => n.colors.flatMap(
227
+ (h) => h.shades.flatMap((o) => {
228
+ const k = `${n.id}:${h.id}:${o.name}`, l = b == null ? void 0 : b.find(
232
229
  (e) => e.id === k
233
230
  );
234
231
  return {
235
232
  id: k,
236
233
  paletteName: r.name,
237
- themeName: u.name,
238
- colorName: i.name,
239
- shadeName: c.name,
240
- ...(a == null ? void 0 : a.includes("alpha")) && { alpha: c.alpha ?? 1 },
241
- ...(a == null ? void 0 : a.includes("hex")) && { hex: c.hex },
242
- ...(a == null ? void 0 : a.includes("gl")) && { gl: c.gl },
234
+ themeName: n.name,
235
+ colorName: h.name,
236
+ shadeName: o.name,
237
+ ...(a == null ? void 0 : a.includes("alpha")) && { alpha: o.alpha ?? 1 },
238
+ ...(a == null ? void 0 : a.includes("hex")) && { hex: o.hex },
239
+ ...(a == null ? void 0 : a.includes("gl")) && { gl: o.gl },
243
240
  ...(a == null ? void 0 : a.includes("description")) && {
244
- description: i.description
241
+ description: h.description
245
242
  },
246
243
  ...(a == null ? void 0 : a.includes("collection_id")) && {
247
244
  collectionId: l == null ? void 0 : l.collectionId
@@ -268,13 +265,12 @@ class A {
268
265
  version: "2025.06",
269
266
  type: "UI_COLOR_PALETTE"
270
267
  }));
271
- var g;
272
- this.base = a, this.themes = h, this.meta = r, this.paletteData = {
268
+ this.base = a, this.themes = b, this.meta = r, this.paletteData = {
273
269
  name: a.name ?? "UI Color Palette",
274
270
  description: a.description,
275
271
  themes: [],
276
272
  type: "palette"
277
- }, this.currentScale = ((g = h.find((u) => u.isEnabled)) == null ? void 0 : g.scale) ?? {};
273
+ };
278
274
  }
279
275
  }
280
276
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"data.js","sources":["../../../src/modules/data/data.ts"],"sourcesContent":["import { Hsluv } from 'hsluv'\nimport chroma from 'chroma-js'\nimport {\n LibraryData,\n PaletteData,\n PaletteDataColorItem,\n PaletteDataThemeItem,\n} from '@tps/data.types'\nimport {\n MetaConfiguration,\n BaseConfiguration,\n ScaleConfiguration,\n ThemeConfiguration,\n FullConfiguration,\n} from '@tps/configuration.types'\nimport { Channel, HexModel } from '@tps/color.types'\nimport Color from '@modules/color/color'\n\nexport default class Data {\n private base: BaseConfiguration\n private themes: Array<ThemeConfiguration>\n private meta?: MetaConfiguration\n private paletteData: PaletteData\n private currentScale: ScaleConfiguration\n\n constructor({\n base,\n themes,\n meta,\n }: {\n base: BaseConfiguration\n themes: Array<ThemeConfiguration>\n meta?: MetaConfiguration\n }) {\n this.base = base\n this.themes = themes\n this.meta = meta\n this.paletteData = {\n name: base.name ?? 'UI Color Palette',\n description: base.description,\n themes: [],\n type: 'palette',\n }\n this.currentScale =\n themes.find((theme) => theme.isEnabled)?.scale ??\n ({} as ScaleConfiguration)\n }\n\n makePaletteData = () => {\n this.themes.forEach((theme) => {\n const paletteDataThemeItem: PaletteDataThemeItem = {\n id: theme.id,\n name: theme.name,\n description: theme.description,\n colors: [],\n type: theme.type,\n }\n this.base.colors.forEach((color) => {\n const scaledColors = Object.entries(theme.scale)\n .reverse()\n .map((lightness) => {\n if (color.alpha.isEnabled) {\n const foregroundColorData = new Color({\n render: 'RGB',\n sourceColor: [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ],\n alpha: parseFloat((lightness[1] / 100).toFixed(2)),\n hueShifting:\n color.hue.shift !== undefined ? color.hue.shift : 0,\n chromaShifting:\n color.chroma.shift !== undefined ? color.chroma.shift : 100,\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n const backgroundColorData = new Color({\n render: 'RGB',\n sourceColor: chroma(color.alpha.backgroundColor).rgb(),\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n\n switch (this.base.colorSpace) {\n case 'LCH':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.lcha(),\n backgroundColorData.lcha(),\n ]\n case 'OKLCH':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.oklcha(),\n backgroundColorData.oklcha(),\n ]\n case 'LAB':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.laba(),\n backgroundColorData.laba(),\n ]\n case 'OKLAB':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.oklaba(),\n backgroundColorData.oklaba(),\n ]\n case 'HSL':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.hsla(),\n backgroundColorData.hsla(),\n ]\n case 'HSLUV':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.hsluva(),\n backgroundColorData.hsluva(),\n ]\n default:\n return [lightness, [0, 0, 0], [255, 255, 255]]\n }\n } else {\n const colorData = new Color({\n render: 'RGB',\n sourceColor: [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ],\n lightness: lightness[1],\n hueShifting:\n color.hue.shift !== undefined ? color.hue.shift : 0,\n chromaShifting:\n color.chroma.shift !== undefined ? color.chroma.shift : 100,\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n\n switch (this.base.colorSpace) {\n case 'LCH':\n return [lightness, colorData.lch()]\n case 'OKLCH':\n return [lightness, colorData.oklch()]\n case 'LAB':\n return [lightness, colorData.lab()]\n case 'OKLAB':\n return [lightness, colorData.oklab()]\n case 'HSL':\n return [lightness, colorData.hsl()]\n case 'HSLUV':\n return [lightness, colorData.hsluv()]\n default:\n return [lightness, [0, 0, 0]]\n }\n }\n })\n\n const paletteDataColorItem: PaletteDataColorItem = {\n id: color.id,\n name: color.name,\n description: color.description,\n shades: [],\n type: 'color',\n },\n sourceColor: Channel = [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ]\n\n const sourceHsluv = new Hsluv()\n sourceHsluv.rgb_r = color.rgb.r\n sourceHsluv.rgb_g = color.rgb.g\n sourceHsluv.rgb_b = color.rgb.b\n sourceHsluv.rgbToHsluv()\n\n paletteDataColorItem.shades.push({\n name: 'source',\n description: 'Source color',\n hex: chroma(sourceColor).hex(),\n rgb: sourceColor,\n gl: chroma(sourceColor).gl(),\n lch: chroma(sourceColor).lch(),\n oklch: chroma(sourceColor).oklch(),\n lab: chroma(sourceColor).lab(),\n oklab: chroma(sourceColor).oklab(),\n hsl: chroma(sourceColor).hsl(),\n hsluv: [\n sourceHsluv.hsluv_h,\n sourceHsluv.hsluv_s,\n sourceHsluv.hsluv_l,\n ],\n type: 'source color',\n })\n\n const distances = scaledColors.map((shade) =>\n chroma.distance(\n chroma(sourceColor).hex(),\n chroma(shade[1] as Channel).hex(),\n 'rgb'\n )\n )\n const minDistanceIndex = distances.indexOf(Math.min(...distances))\n\n scaledColors.forEach((scaledColor, index) => {\n const distance: number = chroma.distance(\n chroma(sourceColor).hex(),\n chroma(scaledColor[1] as Channel).hex(),\n 'rgb'\n )\n const scaleName: string =\n Object.keys(this.currentScale).find(\n (key) => key === scaledColor[0][0]\n ) ?? '0'\n const newHsluv = new Hsluv()\n const simulatedSourceColorRgb = new Color({\n render: 'RGB',\n sourceColor: chroma(sourceColor).rgb(),\n visionSimulationMode: theme.visionSimulationMode,\n }).setColor() as Channel\n const simulatedSourceColorHex = new Color({\n render: 'HEX',\n sourceColor: chroma(sourceColor).rgb(),\n visionSimulationMode: theme.visionSimulationMode,\n }).setColor() as HexModel\n\n if (\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ) {\n newHsluv.rgb_r = Number(simulatedSourceColorRgb[0]) / 255\n newHsluv.rgb_g = Number(simulatedSourceColorRgb[1]) / 255\n newHsluv.rgb_b = Number(simulatedSourceColorRgb[2]) / 255\n } else {\n newHsluv.rgb_r = Number(scaledColor[1][0]) / 255\n newHsluv.rgb_g = Number(scaledColor[1][1]) / 255\n newHsluv.rgb_b = Number(scaledColor[1][2]) / 255\n }\n newHsluv.rgbToHsluv()\n\n paletteDataColorItem.shades.push({\n name: scaleName,\n description: `Shade/Tint color with ${typeof scaledColor[0][1] === 'number' ? scaledColor[0][1].toFixed(1) : scaledColor[0][1]}% of ${\n color.alpha.isEnabled ? 'opacity' : 'lightness'\n }`,\n hex:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).hex()\n : chroma(scaledColor[1] as Channel).hex(),\n rgb:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).rgb()\n : chroma(scaledColor[1] as Channel).rgb(),\n gl:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).gl()\n : chroma(scaledColor[1] as Channel).gl(),\n lch:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).lch()\n : chroma(scaledColor[1] as Channel).lch(),\n oklch:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).oklch()\n : chroma(scaledColor[1] as Channel).oklch(),\n lab:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).lab()\n : chroma(scaledColor[1] as Channel).lab(),\n oklab:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).oklab()\n : chroma(scaledColor[1] as Channel).oklab(),\n hsl:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).hsl()\n : chroma(scaledColor[1] as Channel).hsl(),\n hsluv: [newHsluv.hsluv_h, newHsluv.hsluv_s, newHsluv.hsluv_l],\n alpha: color.alpha.isEnabled\n ? parseFloat(((scaledColor[0][1] as number) / 100).toFixed(2))\n : undefined,\n backgroundColor:\n color.alpha.isEnabled && color.alpha.backgroundColor\n ? chroma(scaledColor[2] as Channel).rgb()\n : undefined,\n mixedColor:\n color.alpha.isEnabled && color.alpha.backgroundColor\n ? new Color({\n visionSimulationMode: theme.visionSimulationMode,\n }).mixColorsRgb(\n [\n ...(scaledColor[1] as Channel),\n parseFloat(\n ((scaledColor[0][1] as number) / 100).toFixed(2)\n ),\n ],\n [...(scaledColor[2] as Channel), 1]\n )\n : undefined,\n isClosestToRef: distance < 4 && !this.base.areSourceColorsLocked,\n isSourceColorLocked:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled,\n isTransparent: color.alpha.isEnabled,\n type: 'color shade/tint',\n })\n })\n\n paletteDataThemeItem.colors.push(paletteDataColorItem)\n })\n this.paletteData.themes.push(paletteDataThemeItem)\n })\n\n return this.paletteData\n }\n\n makeLibraryData = (\n options?: Array<\n | 'collection_id'\n | 'mode_id'\n | 'variable_id'\n | 'style_id'\n | 'gl'\n | 'hex'\n | 'description'\n | 'alpha'\n >,\n previousData?: Array<LibraryData>\n ) => {\n const paletteData = this.makePaletteData()\n\n const libraryData: Array<LibraryData> = paletteData.themes.flatMap(\n (theme) => {\n return theme.colors.flatMap((color) =>\n color.shades.flatMap((shade) => {\n const generatedId = `${theme.id}:${color.id}:${shade.name}`\n const previousItem = previousData?.find(\n (item) => item.id === generatedId\n )\n\n return {\n id: generatedId,\n paletteName: paletteData.name,\n themeName: theme.name,\n colorName: color.name,\n shadeName: shade.name,\n ...(options?.includes('alpha') && { alpha: shade.alpha ?? 1 }),\n ...(options?.includes('hex') && { hex: shade.hex }),\n ...(options?.includes('gl') && { gl: shade.gl }),\n ...(options?.includes('description') && {\n description: color.description,\n }),\n ...(options?.includes('collection_id') && {\n collectionId: previousItem?.collectionId,\n }),\n ...(options?.includes('mode_id') && {\n modeId: previousItem?.modeId,\n }),\n ...(options?.includes('variable_id') && {\n variableId: previousItem?.variableId,\n }),\n ...(options?.includes('style_id') && {\n styleId: previousItem?.styleId,\n }),\n }\n })\n )\n }\n )\n\n return libraryData\n }\n\n makePaletteFullData = () => {\n const fullPaletteData = {\n base: this.base,\n themes: this.themes,\n libraryData: this.makeLibraryData(),\n meta: this.meta,\n version: '2025.06',\n type: 'UI_COLOR_PALETTE',\n } as FullConfiguration\n\n return fullPaletteData\n }\n}\n"],"names":["Data","base","themes","meta","__publicField","theme","paletteDataThemeItem","color","scaledColors","lightness","foregroundColorData","Color","backgroundColorData","chroma","colorData","paletteDataColorItem","sourceColor","sourceHsluv","Hsluv","distances","shade","minDistanceIndex","scaledColor","index","distance","scaleName","key","newHsluv","simulatedSourceColorRgb","simulatedSourceColorHex","options","previousData","paletteData","generatedId","previousItem","item","_a"],"mappings":";;;;;AAkBA,MAAqBA,EAAK;AAAA,EAOxB,YAAY;AAAA,IACV,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,EAAA,GAKC;AAdK,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAyBR,IAAAA,EAAA,yBAAkB,OACX,KAAA,OAAO,QAAQ,CAACC,MAAU;AAC7B,YAAMC,IAA6C;AAAA,QACjD,IAAID,EAAM;AAAA,QACV,MAAMA,EAAM;AAAA,QACZ,aAAaA,EAAM;AAAA,QACnB,QAAQ,CAAC;AAAA,QACT,MAAMA,EAAM;AAAA,MACd;AACA,WAAK,KAAK,OAA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S,SAAS,eAAc;AAAA,gBAClC,QAAQI,KAAA,gBAAAA,EAAc;AAAA,cACxB;AAAA,cACA,IAAIJ,KAAA,gBAAAA,EAAS,SAAS,mBAAkB;AAAA,gBACtC,YAAYI,KAAA,gBAAAA,EAAc;AAAA,cAC5B;AAAA,cACA,IAAIJ,KAAA,gBAAAA,EAAS,SAAS,gBAAe;AAAA,gBACnC,SAASI,KAAA,gBAAAA,EAAc;AAAA,cAAA;AAAA,YAE3B;AAAA,UACD,CAAA;AAAA,QACH;AAAA,MAEJ;AAAA,IAGF;AAEA,IAAA9B,EAAA,6BAAsB,OACI;AAAA,MACtB,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,aAAa,KAAK,gBAAgB;AAAA,MAClC,MAAM,KAAK;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,IACR;;AApZA,SAAK,OAAOH,GACZ,KAAK,SAASC,GACd,KAAK,OAAOC,GACZ,KAAK,cAAc;AAAA,MACjB,MAAMF,EAAK,QAAQ;AAAA,MACnB,aAAaA,EAAK;AAAA,MAClB,QAAQ,CAAC;AAAA,MACT,MAAM;AAAA,IACR,GACK,KAAA,iBACHmC,IAAAlC,EAAO,KAAK,CAACG,MAAUA,EAAM,SAAS,MAAtC,gBAAA+B,EAAyC,UACxC,CAAC;AAAA,EAAA;AA6YR;"}
1
+ {"version":3,"file":"data.js","sources":["../../../src/modules/data/data.ts"],"sourcesContent":["import { Hsluv } from 'hsluv'\nimport chroma from 'chroma-js'\nimport {\n LibraryData,\n PaletteData,\n PaletteDataColorItem,\n PaletteDataThemeItem,\n} from '@tps/data.types'\nimport {\n MetaConfiguration,\n BaseConfiguration,\n ThemeConfiguration,\n FullConfiguration,\n} from '@tps/configuration.types'\nimport { Channel, HexModel } from '@tps/color.types'\nimport Color from '@modules/color/color'\n\nexport default class Data {\n private base: BaseConfiguration\n private themes: Array<ThemeConfiguration>\n private meta?: MetaConfiguration\n private paletteData: PaletteData\n\n constructor({\n base,\n themes,\n meta,\n }: {\n base: BaseConfiguration\n themes: Array<ThemeConfiguration>\n meta?: MetaConfiguration\n }) {\n this.base = base\n this.themes = themes\n this.meta = meta\n this.paletteData = {\n name: base.name ?? 'UI Color Palette',\n description: base.description,\n themes: [],\n type: 'palette',\n }\n }\n\n makePaletteData = () => {\n this.themes.forEach((theme) => {\n const paletteDataThemeItem: PaletteDataThemeItem = {\n id: theme.id,\n name: theme.name,\n description: theme.description,\n colors: [],\n type: theme.type,\n }\n this.base.colors.forEach((color) => {\n const scaledColors = Object.entries(theme.scale)\n .reverse()\n .map((lightness) => {\n if (color.alpha.isEnabled) {\n const foregroundColorData = new Color({\n render: 'RGB',\n sourceColor: [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ],\n alpha: parseFloat((lightness[1] / 100).toFixed(2)),\n hueShifting:\n color.hue.shift !== undefined ? color.hue.shift : 0,\n chromaShifting:\n color.chroma.shift !== undefined ? color.chroma.shift : 100,\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n const backgroundColorData = new Color({\n render: 'RGB',\n sourceColor: chroma(color.alpha.backgroundColor).rgb(),\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n\n switch (this.base.colorSpace) {\n case 'LCH':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.lcha(),\n backgroundColorData.lcha(),\n ]\n case 'OKLCH':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.oklcha(),\n backgroundColorData.oklcha(),\n ]\n case 'LAB':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.laba(),\n backgroundColorData.laba(),\n ]\n case 'OKLAB':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.oklaba(),\n backgroundColorData.oklaba(),\n ]\n case 'HSL':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.hsla(),\n backgroundColorData.hsla(),\n ]\n case 'HSLUV':\n return this.base.areSourceColorsLocked\n ? [\n lightness,\n foregroundColorData.setColorWithAlpha(),\n backgroundColorData.setColorWithAlpha(),\n ]\n : [\n lightness,\n foregroundColorData.hsluva(),\n backgroundColorData.hsluva(),\n ]\n default:\n return [lightness, [0, 0, 0], [255, 255, 255]]\n }\n } else {\n const colorData = new Color({\n render: 'RGB',\n sourceColor: [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ],\n lightness: lightness[1],\n hueShifting:\n color.hue.shift !== undefined ? color.hue.shift : 0,\n chromaShifting:\n color.chroma.shift !== undefined ? color.chroma.shift : 100,\n algorithmVersion: this.base.algorithmVersion,\n visionSimulationMode: theme.visionSimulationMode,\n })\n\n switch (this.base.colorSpace) {\n case 'LCH':\n return [lightness, colorData.lch()]\n case 'OKLCH':\n return [lightness, colorData.oklch()]\n case 'LAB':\n return [lightness, colorData.lab()]\n case 'OKLAB':\n return [lightness, colorData.oklab()]\n case 'HSL':\n return [lightness, colorData.hsl()]\n case 'HSLUV':\n return [lightness, colorData.hsluv()]\n default:\n return [lightness, [0, 0, 0]]\n }\n }\n })\n\n const paletteDataColorItem: PaletteDataColorItem = {\n id: color.id,\n name: color.name,\n description: color.description,\n shades: [],\n type: 'color',\n },\n sourceColor: Channel = [\n color.rgb.r * 255,\n color.rgb.g * 255,\n color.rgb.b * 255,\n ]\n\n const sourceHsluv = new Hsluv()\n sourceHsluv.rgb_r = color.rgb.r\n sourceHsluv.rgb_g = color.rgb.g\n sourceHsluv.rgb_b = color.rgb.b\n sourceHsluv.rgbToHsluv()\n\n paletteDataColorItem.shades.push({\n name: 'source',\n description: 'Source color',\n hex: chroma(sourceColor).hex(),\n rgb: sourceColor,\n gl: chroma(sourceColor).gl(),\n lch: chroma(sourceColor).lch(),\n oklch: chroma(sourceColor).oklch(),\n lab: chroma(sourceColor).lab(),\n oklab: chroma(sourceColor).oklab(),\n hsl: chroma(sourceColor).hsl(),\n hsluv: [\n sourceHsluv.hsluv_h,\n sourceHsluv.hsluv_s,\n sourceHsluv.hsluv_l,\n ],\n type: 'source color',\n })\n\n const distances = scaledColors.map((shade) =>\n chroma.distance(\n chroma(sourceColor).hex(),\n chroma(shade[1] as Channel).hex(),\n 'rgb'\n )\n )\n const minDistanceIndex = distances.indexOf(Math.min(...distances))\n\n scaledColors.forEach((scaledColor, index) => {\n const distance: number = chroma.distance(\n chroma(sourceColor).hex(),\n chroma(scaledColor[1] as Channel).hex(),\n 'rgb'\n )\n const scaleName: string =\n Object.keys(theme.scale).find((key) => key === scaledColor[0][0]) ??\n '0'\n const newHsluv = new Hsluv()\n const simulatedSourceColorRgb = new Color({\n render: 'RGB',\n sourceColor: chroma(sourceColor).rgb(),\n visionSimulationMode: theme.visionSimulationMode,\n }).setColor() as Channel\n const simulatedSourceColorHex = new Color({\n render: 'HEX',\n sourceColor: chroma(sourceColor).rgb(),\n visionSimulationMode: theme.visionSimulationMode,\n }).setColor() as HexModel\n\n if (\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ) {\n newHsluv.rgb_r = Number(simulatedSourceColorRgb[0]) / 255\n newHsluv.rgb_g = Number(simulatedSourceColorRgb[1]) / 255\n newHsluv.rgb_b = Number(simulatedSourceColorRgb[2]) / 255\n } else {\n newHsluv.rgb_r = Number(scaledColor[1][0]) / 255\n newHsluv.rgb_g = Number(scaledColor[1][1]) / 255\n newHsluv.rgb_b = Number(scaledColor[1][2]) / 255\n }\n newHsluv.rgbToHsluv()\n\n paletteDataColorItem.shades.push({\n name: scaleName,\n description: `Shade/Tint color with ${typeof scaledColor[0][1] === 'number' ? scaledColor[0][1].toFixed(1) : scaledColor[0][1]}% of ${\n color.alpha.isEnabled ? 'opacity' : 'lightness'\n }`,\n hex:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).hex()\n : chroma(scaledColor[1] as Channel).hex(),\n rgb:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).rgb()\n : chroma(scaledColor[1] as Channel).rgb(),\n gl:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).gl()\n : chroma(scaledColor[1] as Channel).gl(),\n lch:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).lch()\n : chroma(scaledColor[1] as Channel).lch(),\n oklch:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).oklch()\n : chroma(scaledColor[1] as Channel).oklch(),\n lab:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).lab()\n : chroma(scaledColor[1] as Channel).lab(),\n oklab:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).oklab()\n : chroma(scaledColor[1] as Channel).oklab(),\n hsl:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled\n ? chroma(simulatedSourceColorHex).hsl()\n : chroma(scaledColor[1] as Channel).hsl(),\n hsluv: [newHsluv.hsluv_h, newHsluv.hsluv_s, newHsluv.hsluv_l],\n alpha: color.alpha.isEnabled\n ? parseFloat(((scaledColor[0][1] as number) / 100).toFixed(2))\n : undefined,\n backgroundColor:\n color.alpha.isEnabled && color.alpha.backgroundColor\n ? chroma(scaledColor[2] as Channel).rgb()\n : undefined,\n mixedColor:\n color.alpha.isEnabled && color.alpha.backgroundColor\n ? new Color({\n visionSimulationMode: theme.visionSimulationMode,\n }).mixColorsRgb(\n [\n ...(scaledColor[1] as Channel),\n parseFloat(\n ((scaledColor[0][1] as number) / 100).toFixed(2)\n ),\n ],\n [...(scaledColor[2] as Channel), 1]\n )\n : undefined,\n isClosestToRef: distance < 4 && !this.base.areSourceColorsLocked,\n isSourceColorLocked:\n index === minDistanceIndex &&\n this.base.areSourceColorsLocked &&\n !color.alpha.isEnabled,\n isTransparent: color.alpha.isEnabled,\n type: 'color shade/tint',\n })\n })\n\n paletteDataThemeItem.colors.push(paletteDataColorItem)\n })\n this.paletteData.themes.push(paletteDataThemeItem)\n })\n\n return this.paletteData\n }\n\n makeLibraryData = (\n options?: Array<\n | 'collection_id'\n | 'mode_id'\n | 'variable_id'\n | 'style_id'\n | 'gl'\n | 'hex'\n | 'description'\n | 'alpha'\n >,\n previousData?: Array<LibraryData>\n ) => {\n const paletteData = this.makePaletteData()\n\n const libraryData: Array<LibraryData> = paletteData.themes.flatMap(\n (theme) => {\n return theme.colors.flatMap((color) =>\n color.shades.flatMap((shade) => {\n const generatedId = `${theme.id}:${color.id}:${shade.name}`\n const previousItem = previousData?.find(\n (item) => item.id === generatedId\n )\n\n return {\n id: generatedId,\n paletteName: paletteData.name,\n themeName: theme.name,\n colorName: color.name,\n shadeName: shade.name,\n ...(options?.includes('alpha') && { alpha: shade.alpha ?? 1 }),\n ...(options?.includes('hex') && { hex: shade.hex }),\n ...(options?.includes('gl') && { gl: shade.gl }),\n ...(options?.includes('description') && {\n description: color.description,\n }),\n ...(options?.includes('collection_id') && {\n collectionId: previousItem?.collectionId,\n }),\n ...(options?.includes('mode_id') && {\n modeId: previousItem?.modeId,\n }),\n ...(options?.includes('variable_id') && {\n variableId: previousItem?.variableId,\n }),\n ...(options?.includes('style_id') && {\n styleId: previousItem?.styleId,\n }),\n }\n })\n )\n }\n )\n\n return libraryData\n }\n\n makePaletteFullData = () => {\n const fullPaletteData = {\n base: this.base,\n themes: this.themes,\n libraryData: this.makeLibraryData(),\n meta: this.meta,\n version: '2025.06',\n type: 'UI_COLOR_PALETTE',\n } as FullConfiguration\n\n return fullPaletteData\n }\n}\n"],"names":["Data","base","themes","meta","__publicField","theme","paletteDataThemeItem","color","scaledColors","lightness","foregroundColorData","Color","backgroundColorData","chroma","colorData","paletteDataColorItem","sourceColor","sourceHsluv","Hsluv","distances","shade","minDistanceIndex","scaledColor","index","distance","scaleName","key","newHsluv","simulatedSourceColorRgb","simulatedSourceColorHex","options","previousData","paletteData","generatedId","previousItem","item"],"mappings":";;;;;AAiBA,MAAqBA,EAAK;AAAA,EAMxB,YAAY;AAAA,IACV,MAAAC;AAAA,IACA,QAAAC;AAAA,IACA,MAAAC;AAAA,EAAA,GAKC;AAbK,IAAAC,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AACA,IAAAA,EAAA;AAsBR,IAAAA,EAAA,yBAAkB,OACX,KAAA,OAAO,QAAQ,CAACC,MAAU;AAC7B,YAAMC,IAA6C;AAAA,QACjD,IAAID,EAAM;AAAA,QACV,MAAMA,EAAM;AAAA,QACZ,aAAaA,EAAM;AAAA,QACnB,QAAQ,CAAC;AAAA,QACT,MAAMA,EAAM;AAAA,MACd;AACA,WAAK,KAAK,OAAO,QAAQ,CAACE,MAAU;AAC5B,cAAAC,IAAe,OAAO,QAAQH,EAAM,KAAK,EAC5C,QAAQ,EACR,IAAI,CAACI,MAAc;AACd,cAAAF,EAAM,MAAM,WAAW;AACnB,kBAAAG,IAAsB,IAAIC,EAAM;AAAA,cACpC,QAAQ;AAAA,cACR,aAAa;AAAA,gBACXJ,EAAM,IAAI,IAAI;AAAA,gBACdA,EAAM,IAAI,IAAI;AA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AA,YAE3B;AAAA,UACD,CAAA;AAAA,QACH;AAAA,MAEJ;AAAA,IAGF;AAEA,IAAA9B,EAAA,6BAAsB,OACI;AAAA,MACtB,MAAM,KAAK;AAAA,MACX,QAAQ,KAAK;AAAA,MACb,aAAa,KAAK,gBAAgB;AAAA,MAClC,MAAM,KAAK;AAAA,MACX,SAAS;AAAA,MACT,MAAM;AAAA,IACR;AAhZA,SAAK,OAAOH,GACZ,KAAK,SAASC,GACd,KAAK,OAAOC,GACZ,KAAK,cAAc;AAAA,MACjB,MAAMF,EAAK,QAAQ;AAAA,MACnB,aAAaA,EAAK;AAAA,MAClB,QAAQ,CAAC;AAAA,MACT,MAAM;AAAA,IACR;AAAA,EAAA;AA4YJ;"}
package/package.json CHANGED
@@ -1,9 +1,12 @@
1
1
  {
2
2
  "name": "@a_ng_d/utils-ui-color-palette",
3
3
  "private": false,
4
- "version": "1.7.6",
4
+ "version": "1.7.8",
5
5
  "description": "Core utilities library for UI Color Palette - a color management plugin for design tools. This library provides the foundational color manipulation, contrast calculation, and palette generation features used in the plugin.",
6
- "repository": "https://github.com/a-ng-d/utils-ui-color-palette",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/a-ng-d/utils-ui-color-palette.git"
9
+ },
7
10
  "keywords": [
8
11
  "color",
9
12
  "contrast",
@@ -44,7 +47,7 @@
44
47
  "eslint": "^8.57.0",
45
48
  "eslint-config-prettier": "^9.1.0",
46
49
  "eslint-plugin-import": "^2.31.0",
47
- "glob": "^10.3.12",
50
+ "glob": "^12.0.0",
48
51
  "prettier": "^3.2.5",
49
52
  "typescript": "^5.4.3",
50
53
  "vite": "^6.3.5",