@everchron/ec-shards 9.8.2 → 9.8.4

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/ec-shards.js CHANGED
@@ -6229,16 +6229,41 @@ const ld = /* @__PURE__ */ y(sd, [["render", rd]]), cd = {
6229
6229
  this.colorChange(e);
6230
6230
  },
6231
6231
  inputChange(e) {
6232
- e && (e.hex ? this.isValidHex(e.hex) && this.colorChange({
6233
- hex: e.hex,
6234
- source: "hex"
6235
- }) : (e.r || e.g || e.b || e.a) && this.colorChange({
6236
- r: e.r || this.colors.rgba.r,
6237
- g: e.g || this.colors.rgba.g,
6238
- b: e.b || this.colors.rgba.b,
6239
- a: e.a || this.colors.rgba.a,
6240
- source: "rgba"
6241
- }));
6232
+ if (e) {
6233
+ if (e.hex)
6234
+ this.isValidHex(e.hex) && this.isUsableColor(e.hex) && this.colorChange({
6235
+ hex: e.hex,
6236
+ source: "hex"
6237
+ });
6238
+ else if (e.r || e.g || e.b || e.a) {
6239
+ const s = {
6240
+ r: e.r || this.colors.rgba.r,
6241
+ g: e.g || this.colors.rgba.g,
6242
+ b: e.b || this.colors.rgba.b,
6243
+ a: e.a || this.colors.rgba.a
6244
+ };
6245
+ this.isUsableColor(s) && this.colorChange({
6246
+ ...s,
6247
+ source: "rgba"
6248
+ });
6249
+ }
6250
+ }
6251
+ },
6252
+ isUsableColor(e) {
6253
+ if (!this.preventUnusableColors)
6254
+ return !0;
6255
+ let s;
6256
+ if (typeof e == "string") {
6257
+ const a = e.replace("#", "");
6258
+ s = {
6259
+ r: parseInt(a.slice(0, 2), 16),
6260
+ g: parseInt(a.slice(2, 4), 16),
6261
+ b: parseInt(a.slice(4, 6), 16)
6262
+ };
6263
+ } else
6264
+ s = e;
6265
+ const t = (0.299 * s.r + 0.587 * s.g + 0.114 * s.b) / 255;
6266
+ return t > 0.1 && t < 0.9;
6242
6267
  }
6243
6268
  }
6244
6269
  }, dd = {
@@ -13543,7 +13568,7 @@ function cy(e, s, t, a, n, i) {
13543
13568
  ], 8, oy))), 128))
13544
13569
  ], 2);
13545
13570
  }
13546
- const h_ = /* @__PURE__ */ y(ay, [["render", cy], ["__scopeId", "data-v-0b149ba2"]]), dy = {
13571
+ const h_ = /* @__PURE__ */ y(ay, [["render", cy], ["__scopeId", "data-v-868d7eb4"]]), dy = {
13547
13572
  name: "ecs-select-tile",
13548
13573
  emits: ["click"],
13549
13574
  components: {