dev-classes 1.4.35 → 1.4.36

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.
@@ -76,6 +76,6 @@ export declare class Color {
76
76
  randomize?: boolean;
77
77
  }) => string;
78
78
  neonColor: () => string;
79
- brightColor: typeof Color.brightColor;
79
+ brightColor: (factor?: number) => string;
80
80
  };
81
81
  }
package/dist/index.js CHANGED
@@ -6,15 +6,6 @@ const h = class h {
6
6
  const [t, s, n] = this.hexToRgb(e), o = this.rgbaToHsla(t, s, n, 1);
7
7
  return o.l >= this.MIN_LIGHTNESS && o.s >= this.MIN_SATURATION;
8
8
  }
9
- static brightColor(e = 1.3) {
10
- let t = 0, s;
11
- do {
12
- const [n, o, i] = h.generateRGB();
13
- if (s = `#${n.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}`, s = h.increaseSaturation(s, e), t++, t > 100)
14
- break;
15
- } while (!h.isBrightAndVivid(s));
16
- return s;
17
- }
18
9
  };
19
10
  /*Проверить свои методы и возможно исключить т.к. функционал возможно повторяется */
20
11
  c(h, "componentToHex", (e) => {
@@ -190,7 +181,15 @@ c(h, "mixColors", (e, t, s) => {
190
181
  [e[t], e[s]] = [e[s], e[t]];
191
182
  }
192
183
  return `#${e[0].toString(16).padStart(2, "0")}${e[1].toString(16).padStart(2, "0")}${e[2].toString(16).padStart(2, "0")}`;
193
- }), c(h, "generateRGB", () => Array.from({ length: 3 }, () => Math.floor(Math.random() * 128 + 128))), c(h, "hslToHex", (e, t, s) => {
184
+ }), c(h, "generateRGB", () => Array.from({ length: 3 }, () => Math.floor(Math.random() * 128 + 128))), c(h, "brightColor", (e = 1.3) => {
185
+ let t = 0, s;
186
+ do {
187
+ const [n, o, i] = h.generateRGB();
188
+ if (s = `#${n.toString(16).padStart(2, "0")}${o.toString(16).padStart(2, "0")}${i.toString(16).padStart(2, "0")}`, s = h.increaseSaturation(s, e), t++, t > 100)
189
+ break;
190
+ } while (!h.isBrightAndVivid(s));
191
+ return s;
192
+ }), c(h, "hslToHex", (e, t, s) => {
194
193
  const n = h.hslaToRgba(e, t, s, 1), [o, i, a] = n.slice(0, 3);
195
194
  return h.rgbToHex(o, i, a);
196
195
  }), c(h, "generatePleasantColor", (e = {}) => {
package/package.json CHANGED
@@ -11,7 +11,7 @@
11
11
  "url": "git+https://github.com/SinGlEBW/dev-classes.git"
12
12
  },
13
13
  "license": "MIT",
14
- "version": "1.4.35",
14
+ "version": "1.4.36",
15
15
  "type": "module",
16
16
  "module": "./dist/index.js",
17
17
  "main": "./dist/index.js",