@everchron/ec-shards 9.8.3 → 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 +35 -10
- package/dist/ec-shards.umd.cjs +1 -1
- package/package.json +1 -1
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
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
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 = {
|