@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.
@@ -6617,8 +6617,6 @@ const Modal = class {
6617
6617
  return sortedColors;
6618
6618
  }
6619
6619
  getColorHueGroup(hex) {
6620
- if (!hex || !chroma.valid(hex))
6621
- return 'other';
6622
6620
  const color = chroma(hex);
6623
6621
  const hue = color.get('hsl.h');
6624
6622
  const saturation = color.get('hsl.s');
@@ -6649,9 +6647,6 @@ const Modal = class {
6649
6647
  sortColorsByHueAndSimilarity(colors) {
6650
6648
  if ((colors === null || colors === void 0 ? void 0 : colors.length) <= 1)
6651
6649
  return colors;
6652
- // Separate valid and invalid hex colors
6653
- const validColors = colors.filter(c => typeof c.hex === 'string' && c.hex && chroma.valid(c.hex));
6654
- const invalidColors = colors.filter(c => !c.hex || !chroma.valid(c.hex));
6655
6650
  // Group valid colors by their hue family
6656
6651
  const colorGroups = {
6657
6652
  red: [],
@@ -6665,7 +6660,7 @@ const Modal = class {
6665
6660
  white: [],
6666
6661
  other: [],
6667
6662
  };
6668
- validColors.forEach(color => {
6663
+ colors.forEach(color => {
6669
6664
  const group = this.getColorHueGroup(color.hex);
6670
6665
  colorGroups[group].push(color);
6671
6666
  });
@@ -6678,10 +6673,10 @@ const Modal = class {
6678
6673
  }
6679
6674
  });
6680
6675
  // Combine all sorted groups, then append invalid colors at the end
6681
- return [...sortedGroups.flat(), ...invalidColors];
6676
+ return sortedGroups.flat();
6682
6677
  }
6683
6678
  async fetchColorsData({ reset = false } = {}) {
6684
- if (this.loading)
6679
+ if (this.loading && !reset)
6685
6680
  return;
6686
6681
  this.loading = true;
6687
6682
  try {