@ppg_pl/tinting 0.0.2 → 0.0.3
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/dist/cjs/modal-header_9.cjs.entry.js +3 -8
- package/dist/cjs/modal-header_9.cjs.entry.js.map +1 -1
- package/dist/collection/components/modal/index.js +3 -8
- package/dist/collection/components/modal/index.js.map +1 -1
- package/dist/components/index10.js +3 -8
- package/dist/components/index10.js.map +1 -1
- package/dist/esm/modal-header_9.entry.js +3 -8
- package/dist/esm/modal-header_9.entry.js.map +1 -1
- package/dist/tinting/{p-cd431d43.entry.js → p-1028bea2.entry.js} +2 -2
- package/dist/tinting/p-1028bea2.entry.js.map +1 -0
- package/dist/tinting/tinting.esm.js +1 -1
- package/package.json +1 -1
- package/www/build/{p-cd431d43.entry.js → p-1028bea2.entry.js} +2 -2
- package/www/build/p-1028bea2.entry.js.map +1 -0
- package/www/build/tinting.esm.js +1 -1
- package/dist/tinting/p-cd431d43.entry.js.map +0 -1
- package/www/build/p-cd431d43.entry.js.map +0 -1
|
@@ -6613,8 +6613,6 @@ const Modal = class {
|
|
|
6613
6613
|
return sortedColors;
|
|
6614
6614
|
}
|
|
6615
6615
|
getColorHueGroup(hex) {
|
|
6616
|
-
if (!hex || !chroma.valid(hex))
|
|
6617
|
-
return 'other';
|
|
6618
6616
|
const color = chroma(hex);
|
|
6619
6617
|
const hue = color.get('hsl.h');
|
|
6620
6618
|
const saturation = color.get('hsl.s');
|
|
@@ -6645,9 +6643,6 @@ const Modal = class {
|
|
|
6645
6643
|
sortColorsByHueAndSimilarity(colors) {
|
|
6646
6644
|
if ((colors === null || colors === void 0 ? void 0 : colors.length) <= 1)
|
|
6647
6645
|
return colors;
|
|
6648
|
-
// Separate valid and invalid hex colors
|
|
6649
|
-
const validColors = colors.filter(c => typeof c.hex === 'string' && c.hex && chroma.valid(c.hex));
|
|
6650
|
-
const invalidColors = colors.filter(c => !c.hex || !chroma.valid(c.hex));
|
|
6651
6646
|
// Group valid colors by their hue family
|
|
6652
6647
|
const colorGroups = {
|
|
6653
6648
|
red: [],
|
|
@@ -6661,7 +6656,7 @@ const Modal = class {
|
|
|
6661
6656
|
white: [],
|
|
6662
6657
|
other: [],
|
|
6663
6658
|
};
|
|
6664
|
-
|
|
6659
|
+
colors.forEach(color => {
|
|
6665
6660
|
const group = this.getColorHueGroup(color.hex);
|
|
6666
6661
|
colorGroups[group].push(color);
|
|
6667
6662
|
});
|
|
@@ -6674,10 +6669,10 @@ const Modal = class {
|
|
|
6674
6669
|
}
|
|
6675
6670
|
});
|
|
6676
6671
|
// Combine all sorted groups, then append invalid colors at the end
|
|
6677
|
-
return
|
|
6672
|
+
return sortedGroups.flat();
|
|
6678
6673
|
}
|
|
6679
6674
|
async fetchColorsData({ reset = false } = {}) {
|
|
6680
|
-
if (this.loading)
|
|
6675
|
+
if (this.loading && !reset)
|
|
6681
6676
|
return;
|
|
6682
6677
|
this.loading = true;
|
|
6683
6678
|
try {
|