toosoon-utils 1.4.0 → 2.0.0

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.
Files changed (50) hide show
  1. package/README.md +27 -23
  2. package/package.json +8 -4
  3. package/tsconfig.json +1 -3
  4. package/lib/classes/_pool.d.ts +0 -56
  5. package/lib/classes/_pool.js +0 -92
  6. package/lib/classes/color-scale.d.ts +0 -52
  7. package/lib/classes/color-scale.js +0 -160
  8. package/lib/classes/frame-rate.d.ts +0 -25
  9. package/lib/classes/frame-rate.js +0 -48
  10. package/lib/colors.d.ts +0 -155
  11. package/lib/colors.js +0 -367
  12. package/lib/constants.d.ts +0 -162
  13. package/lib/constants.js +0 -170
  14. package/lib/dom.d.ts +0 -25
  15. package/lib/dom.js +0 -47
  16. package/lib/files.d.ts +0 -14
  17. package/lib/files.js +0 -38
  18. package/lib/functions.d.ts +0 -22
  19. package/lib/functions.js +0 -53
  20. package/lib/geometry.d.ts +0 -89
  21. package/lib/geometry.js +0 -128
  22. package/lib/index.d.ts +0 -10
  23. package/lib/index.js +0 -39
  24. package/lib/maths.d.ts +0 -161
  25. package/lib/maths.js +0 -219
  26. package/lib/now.d.ts +0 -5
  27. package/lib/now.js +0 -28
  28. package/lib/prng.d.ts +0 -124
  29. package/lib/prng.js +0 -234
  30. package/lib/random.d.ts +0 -91
  31. package/lib/random.js +0 -162
  32. package/lib/strings.d.ts +0 -14
  33. package/lib/strings.js +0 -18
  34. package/lib/tsconfig.tsbuildinfo +0 -1
  35. package/lib/types.d.ts +0 -18
  36. package/lib/types.js +0 -1
  37. package/src/classes/_pool.ts +0 -92
  38. package/src/classes/color-scale.ts +0 -181
  39. package/src/classes/frame-rate.ts +0 -49
  40. package/src/colors.ts +0 -389
  41. package/src/constants.ts +0 -172
  42. package/src/dom.ts +0 -50
  43. package/src/files.ts +0 -42
  44. package/src/functions.ts +0 -56
  45. package/src/geometry.ts +0 -160
  46. package/src/maths.ts +0 -241
  47. package/src/prng.ts +0 -250
  48. package/src/random.ts +0 -162
  49. package/src/strings.ts +0 -19
  50. package/src/types.ts +0 -33
package/lib/colors.d.ts DELETED
@@ -1,155 +0,0 @@
1
- import { ColorRepresentation } from './types';
2
- /**
3
- * Normalize a color representation into RGB
4
- *
5
- * @param {ColorRepresentation} color Color representation
6
- * @returns {[number,number,number]} Normalized RGB color
7
- */
8
- export declare function normalizeColor(color: ColorRepresentation): [number, number, number];
9
- /**
10
- * Normalize an hexadecimal string
11
- *
12
- * @param {string} hex Hexadecimal string
13
- * @returns {string} Normalized hexadecimal string
14
- */
15
- export declare function normalizeHexString(hex: string): string;
16
- /**
17
- * Convert RGB to hexadecimal
18
- * Note: rgb values are contained in the interval [0, 1]
19
- *
20
- * @param {[number, number, number]} rgb RGB color
21
- * @returns {number} Hexadecimal color
22
- */
23
- export declare function rgbToHex([r, g, b]: [number, number, number]): number;
24
- /**
25
- * Convert RGB to hexadecimal string
26
- * Note: rgb values are contained in the interval [0, 1]
27
- *
28
- * @param {[number, number, number]} rgb RGB color
29
- * @returns {string} Hexadecimal string
30
- */
31
- export declare function rgbToHexString([r, g, b]: [number, number, number]): string;
32
- /**
33
- * Convert hexadecimal to RGB
34
- * Note: rgb values are contained in the interval [0, 1]
35
- *
36
- * @param {(number|string)} hex Hexadecimal color
37
- * @returns {[number, number, number]} RGB color
38
- */
39
- export declare function hexToRgb(hex: number | string): [number, number, number];
40
- /**
41
- * Lighten a color
42
- *
43
- * @param {string} hex Hexadecimal string
44
- * @param {number} [amount=0] Amount of the color offset
45
- * @returns {string} Computed hexadecimal
46
- */
47
- export declare function lighten(hex: string, amount?: number): string;
48
- /**
49
- * Darken a color
50
- *
51
- * @param {string} hex Hexadecimal string
52
- * @param {number} [amount=0] Amount of the color offset
53
- * @returns {string} Computed hexadecimal
54
- */
55
- export declare function darken(hex: string, amount?: number): string;
56
- /**
57
- * Normalize an HSL string
58
- * Note: hsl values are contained in the intervals H: [0, 360], S: [0, 1], L: [0, 1]
59
- *
60
- * @param {string} hsl HSL string (format: 'hsl(360, 100%, 100%)')
61
- * @returns {[number, number, number]} Normalized HSL color
62
- */
63
- export declare function normalizeHslString(hsl: string): [number, number, number];
64
- /**
65
- * Convert RGB to HSL
66
- * Notes:
67
- * - rgb values are contained in the interval [0, 1]
68
- * - hsl values are contained in the intervals H: [0, 360], S: [0, 1], L: [0, 1]
69
- *
70
- * @param {[number, number, number]} rgb RGB color
71
- * @returns {[number, number, number]} HSL color
72
- */
73
- export declare function rgbToHsl([r, g, b]: [number, number, number]): [number, number, number];
74
- /**
75
- * Convert HSL to RGB
76
- * Notes:
77
- * - rgb values are contained in the interval [0, 1]
78
- * - hsl values are contained in the intervals H: [0, 360], S: [0, 1], L: [0, 1]
79
- *
80
- * @param {[number, number, number]} hsl HSL color
81
- * @returns {[number, number, number]} RGB color
82
- */
83
- export declare function hslToRgb([h, s, l]: [number, number, number]): [number, number, number];
84
- /**
85
- * Convert RGB to HSB
86
- * Notes:
87
- * - rgb values are contained in the interval [0, 1]
88
- * - hsb values are contained in the intervals H: [0, 360], S: [0, 1], B: [0, 1]
89
- *
90
- * @param {[number, number, number]} rgb RGB color
91
- * @returns {[number, number, number]} HSB color
92
- */
93
- export declare function rgbToHsb([r, g, b]: [number, number, number]): [number, number, number];
94
- /**
95
- * Convert HSB to RGB
96
- * Notes:
97
- * - rgb values are contained in the interval [0, 1]
98
- * - hsb values are contained in the intervals H: [0, 360], S: [0, 1], B: [0, 1]
99
- *
100
- * @param {[number, number, number]} hsb HSB color
101
- * @returns {[number, number, number]} RGB color
102
- */
103
- export declare function hsbToRgb([h, s, b]: [number, number, number]): [number, number, number];
104
- /**
105
- * Convert LAB to HCL
106
- * -> http://www.brucelindbloom.com/index.html?Eqn_Lab_to_LCH.html
107
- *
108
- * @param {[number, number, number]} lab LAB color
109
- * @returns {[number, number, number]} HCL color
110
- */
111
- export declare function labToHcl([l, a, b]: [number, number, number]): [number, number, number];
112
- /**
113
- * Convert HCL to LAB
114
- * -> http://www.brucelindbloom.com/index.html?Eqn_LCH_to_Lab.html
115
- *
116
- * @param {[number, number, number]} hcl HCL color
117
- * @returns {[number, number, number]} LAB color space
118
- */
119
- export declare function hclToLab([h, c, l]: [number, number, number]): [number, number, number];
120
- /**
121
- * Converts LAB to RGB
122
- *
123
- * @param {[number, number, number]} lab LAB color
124
- * @returns {[number, number, number]} RGB color
125
- */
126
- export declare function labToRgb([l, a, b]: [number, number, number]): [number, number, number];
127
- /**
128
- * Converts RGB to LAB
129
- *
130
- * @param {[number, number, number]} rgb RGB color
131
- * @returns {[number, number, number]} LAB color
132
- */
133
- export declare function rgbToLab([r, g, b]: [number, number, number]): [number, number, number];
134
- /**
135
- * Get the delta from two LAB colors
136
- *
137
- * @param {[number, number, number]} labA First LAB color
138
- * @param {[number, number, number]} labB Second LAB color
139
- * @returns {number} Delta
140
- */
141
- export declare function deltaE(labA: [number, number, number], labB: [number, number, number]): number;
142
- /**
143
- * Convert RGB to HCL
144
- *
145
- * @param {[number, number, number]} rgb RGB color
146
- * @returns {[number, number, number]} HCL color
147
- */
148
- export declare function rgbToHcl([r, g, b]: [number, number, number]): [number, number, number];
149
- /**
150
- * Converts HCL to RGB
151
- *
152
- * @param {[number, number, number]} hcl RGB color
153
- * @returns {[number, number, number]} RGB color
154
- */
155
- export declare function hclToRgb([h, c, l]: [number, number, number]): [number, number, number];
package/lib/colors.js DELETED
@@ -1,367 +0,0 @@
1
- import { W3CX11 } from './constants';
2
- import { toDegrees, toRadians } from './geometry';
3
- import { clamp } from './maths';
4
- /**
5
- * Normalize a color representation into RGB
6
- *
7
- * @param {ColorRepresentation} color Color representation
8
- * @returns {[number,number,number]} Normalized RGB color
9
- */
10
- export function normalizeColor(color) {
11
- var _a;
12
- if (typeof color === 'string') {
13
- return hexToRgb((_a = W3CX11[color]) !== null && _a !== void 0 ? _a : color);
14
- }
15
- else if (typeof color === 'number') {
16
- return hexToRgb(color);
17
- }
18
- else {
19
- return color;
20
- }
21
- }
22
- // ******************************************
23
- // RGB & Hexadecimal color spaces
24
- // ******************************************
25
- /**
26
- * Normalize an hexadecimal string
27
- *
28
- * @param {string} hex Hexadecimal string
29
- * @returns {string} Normalized hexadecimal string
30
- */
31
- export function normalizeHexString(hex) {
32
- var match;
33
- var result = '000000';
34
- hex = hex.toLocaleLowerCase();
35
- if ((match = hex.match(/(#|0x)?([a-f0-9]{6})/i))) {
36
- result = match[2];
37
- }
38
- else if ((match = hex.match(/^#?([a-f0-9])([a-f0-9])([a-f0-9])$/i))) {
39
- result = match[1] + match[1] + match[2] + match[2] + match[3] + match[3];
40
- }
41
- else if ((match = hex.match(/rgb\(\s*(\d*)\s*,\s*(\d*)\s*,\s*(\d*)\s*\)/))) {
42
- result =
43
- parseInt(match[1]).toString(16).padStart(2, '0') +
44
- parseInt(match[2]).toString(16).padStart(2, '0') +
45
- parseInt(match[3]).toString(16).padStart(2, '0');
46
- }
47
- return "#".concat(result);
48
- }
49
- /**
50
- * Convert RGB to hexadecimal
51
- * Note: rgb values are contained in the interval [0, 1]
52
- *
53
- * @param {[number, number, number]} rgb RGB color
54
- * @returns {number} Hexadecimal color
55
- */
56
- export function rgbToHex(_a) {
57
- var r = _a[0], g = _a[1], b = _a[2];
58
- return ((r * 255) << 16) ^ ((g * 255) << 8) ^ ((b * 255) << 0);
59
- }
60
- /**
61
- * Convert RGB to hexadecimal string
62
- * Note: rgb values are contained in the interval [0, 1]
63
- *
64
- * @param {[number, number, number]} rgb RGB color
65
- * @returns {string} Hexadecimal string
66
- */
67
- export function rgbToHexString(_a) {
68
- var r = _a[0], g = _a[1], b = _a[2];
69
- r = clamp(Math.round(r * 255), 0, 255);
70
- g = clamp(Math.round(g * 255), 0, 255);
71
- b = clamp(Math.round(b * 255), 0, 255);
72
- var result = (b | (g << 8) | (r << 16) | (1 << 24)).toString(16).slice(1);
73
- return "#".concat(result);
74
- }
75
- /**
76
- * Convert hexadecimal to RGB
77
- * Note: rgb values are contained in the interval [0, 1]
78
- *
79
- * @param {(number|string)} hex Hexadecimal color
80
- * @returns {[number, number, number]} RGB color
81
- */
82
- export function hexToRgb(hex) {
83
- if (typeof hex === 'number') {
84
- hex = Math.floor(hex);
85
- }
86
- else if (typeof hex === 'string') {
87
- hex = normalizeHexString(hex).replace(/^#/, '');
88
- hex = parseInt(hex, 16);
89
- }
90
- var r = ((hex >> 16) & 255) / 255;
91
- var g = ((hex >> 8) & 255) / 255;
92
- var b = (hex & 255) / 255;
93
- return [r, g, b];
94
- }
95
- /**
96
- * Lighten a color
97
- *
98
- * @param {string} hex Hexadecimal string
99
- * @param {number} [amount=0] Amount of the color offset
100
- * @returns {string} Computed hexadecimal
101
- */
102
- export function lighten(hex, amount) {
103
- if (amount === void 0) { amount = 0; }
104
- var prefix = '';
105
- if (hex[0] === '#') {
106
- hex = hex.slice(1);
107
- prefix = '#';
108
- }
109
- var value = parseInt(hex, 16);
110
- var r = clamp((value >> 16) + amount, 0, 255);
111
- var b = clamp(((value >> 8) & 0x00ff) + amount, 0, 255);
112
- var g = clamp((value & 0x0000ff) + amount, 0, 255);
113
- var result = g | (b << 8) | (r << 16);
114
- if (r === 0 && g === 0 && b === 0 && amount !== 0) {
115
- result = '000000';
116
- }
117
- return prefix + result.toString(16);
118
- }
119
- /**
120
- * Darken a color
121
- *
122
- * @param {string} hex Hexadecimal string
123
- * @param {number} [amount=0] Amount of the color offset
124
- * @returns {string} Computed hexadecimal
125
- */
126
- export function darken(hex, amount) {
127
- if (amount === void 0) { amount = 0; }
128
- return lighten(hex, -amount);
129
- }
130
- // ***************************************************
131
- // RGB & Hue-Saturation-Lightness (HSL) color spaces
132
- // ***************************************************
133
- /**
134
- * Normalize an HSL string
135
- * Note: hsl values are contained in the intervals H: [0, 360], S: [0, 1], L: [0, 1]
136
- *
137
- * @param {string} hsl HSL string (format: 'hsl(360, 100%, 100%)')
138
- * @returns {[number, number, number]} Normalized HSL color
139
- */
140
- export function normalizeHslString(hsl) {
141
- var _a, _b;
142
- var _c = (_b = (_a = hsl.match(/\d+/g)) === null || _a === void 0 ? void 0 : _a.map(Number)) !== null && _b !== void 0 ? _b : [0, 0, 0], h = _c[0], s = _c[1], l = _c[2];
143
- return [h, s / 100, l / 100];
144
- }
145
- /**
146
- * Convert RGB to HSL
147
- * Notes:
148
- * - rgb values are contained in the interval [0, 1]
149
- * - hsl values are contained in the intervals H: [0, 360], S: [0, 1], L: [0, 1]
150
- *
151
- * @param {[number, number, number]} rgb RGB color
152
- * @returns {[number, number, number]} HSL color
153
- */
154
- export function rgbToHsl(_a) {
155
- var r = _a[0], g = _a[1], b = _a[2];
156
- var l = Math.max(r, g, b);
157
- var s = l - Math.min(r, g, b);
158
- var h = s ? (l === r ? (g - b) / s : l === g ? 2 + (b - r) / s : 4 + (r - g) / s) : 0;
159
- return [
160
- 60 * h < 0 ? 60 * h + 360 : 60 * h,
161
- s ? (l <= 0.5 ? s / (2 * l - s) : s / (2 - (2 * l - s))) : 0,
162
- (2 * l - s) / 2
163
- ];
164
- }
165
- /**
166
- * Convert HSL to RGB
167
- * Notes:
168
- * - rgb values are contained in the interval [0, 1]
169
- * - hsl values are contained in the intervals H: [0, 360], S: [0, 1], L: [0, 1]
170
- *
171
- * @param {[number, number, number]} hsl HSL color
172
- * @returns {[number, number, number]} RGB color
173
- */
174
- export function hslToRgb(_a) {
175
- var h = _a[0], s = _a[1], l = _a[2];
176
- var a = s * Math.min(l, 1 - l);
177
- var k = function (v) { return (v + h / 30) % 12; };
178
- var f = function (v) { return l - a * Math.max(-1, Math.min(k(v) - 3, Math.min(9 - k(v), 1))); };
179
- return [f(0), f(8), f(4)];
180
- }
181
- // ***************************************************
182
- // RGB & Hue-Saturation-Brightness (HSB) color spaces
183
- // ***************************************************
184
- /**
185
- * Convert RGB to HSB
186
- * Notes:
187
- * - rgb values are contained in the interval [0, 1]
188
- * - hsb values are contained in the intervals H: [0, 360], S: [0, 1], B: [0, 1]
189
- *
190
- * @param {[number, number, number]} rgb RGB color
191
- * @returns {[number, number, number]} HSB color
192
- */
193
- export function rgbToHsb(_a) {
194
- var r = _a[0], g = _a[1], b = _a[2];
195
- var max = Math.max(r, g, b);
196
- var min = Math.min(r, g, b);
197
- var delta = max - min;
198
- var h = delta === 0 ? 0 : delta && max === r ? (g - b) / delta : max === g ? 2 + (b - r) / delta : 4 + (r - g) / delta;
199
- return [60 * (h < 0 ? h + 6 : h), max && delta / max, max];
200
- }
201
- /**
202
- * Convert HSB to RGB
203
- * Notes:
204
- * - rgb values are contained in the interval [0, 1]
205
- * - hsb values are contained in the intervals H: [0, 360], S: [0, 1], B: [0, 1]
206
- *
207
- * @param {[number, number, number]} hsb HSB color
208
- * @returns {[number, number, number]} RGB color
209
- */
210
- export function hsbToRgb(_a) {
211
- var h = _a[0], s = _a[1], b = _a[2];
212
- var k = function (v) { return (v + h / 60) % 6; };
213
- var f = function (v) { return b * (1 - s * Math.max(0, Math.min(k(v), 4 - k(v), 1))); };
214
- return [f(5), f(3), f(1)];
215
- }
216
- // *********************************************
217
- // LAB & Hue-Chroma-Luminance (HCL) color spaces
218
- // *********************************************
219
- /**
220
- * Convert LAB to HCL
221
- * -> http://www.brucelindbloom.com/index.html?Eqn_Lab_to_LCH.html
222
- *
223
- * @param {[number, number, number]} lab LAB color
224
- * @returns {[number, number, number]} HCL color
225
- */
226
- export function labToHcl(_a) {
227
- var l = _a[0], a = _a[1], b = _a[2];
228
- var c = Math.sqrt(a * a + b * b);
229
- var h = abToHue(a, b);
230
- return [h, c, l];
231
- }
232
- /**
233
- * Convert HCL to LAB
234
- * -> http://www.brucelindbloom.com/index.html?Eqn_LCH_to_Lab.html
235
- *
236
- * @param {[number, number, number]} hcl HCL color
237
- * @returns {[number, number, number]} LAB color space
238
- */
239
- export function hclToLab(_a) {
240
- var h = _a[0], c = _a[1], l = _a[2];
241
- var a = c * Math.cos(toRadians(h));
242
- var b = c * Math.sin(toRadians(h));
243
- return [l, a, b];
244
- }
245
- /**
246
- * Convert A and B of LAB to Hue of LCH
247
- * -> https://stackoverflow.com/questions/53733379/conversion-of-cielab-to-cielchab-not-yielding-correct-result
248
- *
249
- * @param {number} a A value of LAB color
250
- * @param {number} b B value of LAB color
251
- * @returns {number} Hue value
252
- */
253
- function abToHue(a, b) {
254
- if (a >= 0 && b === 0) {
255
- return 0;
256
- }
257
- if (a < 0 && b === 0) {
258
- return 180;
259
- }
260
- if (a === 0 && b > 0) {
261
- return 90;
262
- }
263
- if (a === 0 && b < 0) {
264
- return 270;
265
- }
266
- var xBias = 0;
267
- if (a > 0 && b > 0) {
268
- xBias = 0;
269
- }
270
- else if (a < 0) {
271
- xBias = 180;
272
- }
273
- else if (a > 0 && b < 0) {
274
- xBias = 360;
275
- }
276
- return toDegrees(Math.atan(b / a)) + xBias;
277
- }
278
- // ******************************************
279
- // LAB & RGB color spaces
280
- // ******************************************
281
- var f1 = function (v) { return (v * v * v > 0.008856 ? v * v * v : (v - 16 / 116) / 7.787); };
282
- var f2 = function (v) { return (v > 0.0031308 ? 1.055 * Math.pow(v, 1 / 2.4) - 0.055 : 12.92 * v); };
283
- var f3 = function (v) { return (v > 0.04045 ? Math.pow((v + 0.055) / 1.055, 2.4) : v / 12.92); };
284
- var f4 = function (v) { return (v > 0.008856 ? Math.pow(v, 1 / 3) : 7.787 * v + 16 / 116); };
285
- /**
286
- * Converts LAB to RGB
287
- *
288
- * @param {[number, number, number]} lab LAB color
289
- * @returns {[number, number, number]} RGB color
290
- */
291
- export function labToRgb(_a) {
292
- var l = _a[0], a = _a[1], b = _a[2];
293
- var y = (l + 16) / 116;
294
- var x = a / 500 + y;
295
- var z = y - b / 200;
296
- x = 0.95047 * f1(x);
297
- y = 1.0 * f1(y);
298
- z = 1.08883 * f1(z);
299
- return [
300
- clamp(f2(x * 3.2406 + y * -1.5372 + z * -0.4986)),
301
- clamp(f2(x * -0.9689 + y * 1.8758 + z * 0.0415)),
302
- clamp(f2(x * 0.0557 + y * -0.204 + z * 1.057))
303
- ];
304
- }
305
- /**
306
- * Converts RGB to LAB
307
- *
308
- * @param {[number, number, number]} rgb RGB color
309
- * @returns {[number, number, number]} LAB color
310
- */
311
- export function rgbToLab(_a) {
312
- var r = _a[0], g = _a[1], b = _a[2];
313
- r = f3(r);
314
- g = f3(g);
315
- b = f3(b);
316
- var x = f4((r * 0.4124 + g * 0.3576 + b * 0.1805) / 0.95047);
317
- var y = f4((r * 0.2126 + g * 0.7152 + b * 0.0722) / 1);
318
- var z = f4((r * 0.0193 + g * 0.1192 + b * 0.9505) / 1.08883);
319
- return [116 * y - 16, 500 * (x - y), 200 * (y - z)];
320
- }
321
- /**
322
- * Get the delta from two LAB colors
323
- *
324
- * @param {[number, number, number]} labA First LAB color
325
- * @param {[number, number, number]} labB Second LAB color
326
- * @returns {number} Delta
327
- */
328
- export function deltaE(labA, labB) {
329
- var deltaL = labA[0] - labB[0];
330
- var deltaA = labA[1] - labB[1];
331
- var deltaB = labA[2] - labB[2];
332
- var c1 = Math.sqrt(labA[1] * labA[1] + labA[2] * labA[2]);
333
- var c2 = Math.sqrt(labB[1] * labB[1] + labB[2] * labB[2]);
334
- var deltaC = c1 - c2;
335
- var deltaH = deltaA * deltaA + deltaB * deltaB - deltaC * deltaC;
336
- deltaH = deltaH < 0 ? 0 : Math.sqrt(deltaH);
337
- var sc = 1.0 + 0.045 * c1;
338
- var sh = 1.0 + 0.015 * c1;
339
- var deltaLKlsl = deltaL / 1;
340
- var deltaCkcsc = deltaC / sc;
341
- var deltaHkhsh = deltaH / sh;
342
- var i = deltaLKlsl * deltaLKlsl + deltaCkcsc * deltaCkcsc + deltaHkhsh * deltaHkhsh;
343
- return i < 0 ? 0 : Math.sqrt(i);
344
- }
345
- // *********************************************
346
- // RGB & Hue-Chroma-Luminance (HCL) color spaces
347
- // *********************************************
348
- /**
349
- * Convert RGB to HCL
350
- *
351
- * @param {[number, number, number]} rgb RGB color
352
- * @returns {[number, number, number]} HCL color
353
- */
354
- export function rgbToHcl(_a) {
355
- var r = _a[0], g = _a[1], b = _a[2];
356
- return labToHcl(rgbToLab([r, g, b]));
357
- }
358
- /**
359
- * Converts HCL to RGB
360
- *
361
- * @param {[number, number, number]} hcl RGB color
362
- * @returns {[number, number, number]} RGB color
363
- */
364
- export function hclToRgb(_a) {
365
- var h = _a[0], c = _a[1], l = _a[2];
366
- return labToRgb(hclToLab([h, c, l]));
367
- }
@@ -1,162 +0,0 @@
1
- export declare const EPSILON = 1e-10;
2
- export declare const PI: number;
3
- export declare const TWO_PI: number;
4
- export declare const HALF_PI: number;
5
- export declare const QUARTER_PI: number;
6
- export declare const W3CX11: {
7
- aliceblue: number;
8
- antiquewhite: number;
9
- aqua: number;
10
- aquamarine: number;
11
- azure: number;
12
- beige: number;
13
- bisque: number;
14
- black: number;
15
- blanchedalmond: number;
16
- blue: number;
17
- blueviolet: number;
18
- brown: number;
19
- burlywood: number;
20
- cadetblue: number;
21
- chartreuse: number;
22
- chocolate: number;
23
- coral: number;
24
- cornflower: number;
25
- cornflowerblue: number;
26
- cornsilk: number;
27
- crimson: number;
28
- cyan: number;
29
- darkblue: number;
30
- darkcyan: number;
31
- darkgoldenrod: number;
32
- darkgray: number;
33
- darkgreen: number;
34
- darkgrey: number;
35
- darkkhaki: number;
36
- darkmagenta: number;
37
- darkolivegreen: number;
38
- darkorange: number;
39
- darkorchid: number;
40
- darkred: number;
41
- darksalmon: number;
42
- darkseagreen: number;
43
- darkslateblue: number;
44
- darkslategray: number;
45
- darkslategrey: number;
46
- darkturquoise: number;
47
- darkviolet: number;
48
- deeppink: number;
49
- deepskyblue: number;
50
- dimgray: number;
51
- dimgrey: number;
52
- dodgerblue: number;
53
- firebrick: number;
54
- floralwhite: number;
55
- forestgreen: number;
56
- fuchsia: number;
57
- gainsboro: number;
58
- ghostwhite: number;
59
- gold: number;
60
- goldenrod: number;
61
- gray: number;
62
- green: number;
63
- greenyellow: number;
64
- grey: number;
65
- honeydew: number;
66
- hotpink: number;
67
- indianred: number;
68
- indigo: number;
69
- ivory: number;
70
- khaki: number;
71
- laserlemon: number;
72
- lavender: number;
73
- lavenderblush: number;
74
- lawngreen: number;
75
- lemonchiffon: number;
76
- lightblue: number;
77
- lightcoral: number;
78
- lightcyan: number;
79
- lightgoldenrod: number;
80
- lightgoldenrodyellow: number;
81
- lightgray: number;
82
- lightgreen: number;
83
- lightgrey: number;
84
- lightpink: number;
85
- lightsalmon: number;
86
- lightseagreen: number;
87
- lightskyblue: number;
88
- lightslategray: number;
89
- lightslategrey: number;
90
- lightsteelblue: number;
91
- lightyellow: number;
92
- lime: number;
93
- limegreen: number;
94
- linen: number;
95
- magenta: number;
96
- maroon: number;
97
- maroon2: number;
98
- maroon3: number;
99
- mediumaquamarine: number;
100
- mediumblue: number;
101
- mediumorchid: number;
102
- mediumpurple: number;
103
- mediumseagreen: number;
104
- mediumslateblue: number;
105
- mediumspringgreen: number;
106
- mediumturquoise: number;
107
- mediumvioletred: number;
108
- midnightblue: number;
109
- mintcream: number;
110
- mistyrose: number;
111
- moccasin: number;
112
- navajowhite: number;
113
- navy: number;
114
- oldlace: number;
115
- olive: number;
116
- olivedrab: number;
117
- orange: number;
118
- orangered: number;
119
- orchid: number;
120
- palegoldenrod: number;
121
- palegreen: number;
122
- paleturquoise: number;
123
- palevioletred: number;
124
- papayawhip: number;
125
- peachpuff: number;
126
- peru: number;
127
- pink: number;
128
- plum: number;
129
- powderblue: number;
130
- purple: number;
131
- purple2: number;
132
- purple3: number;
133
- rebeccapurple: number;
134
- red: number;
135
- rosybrown: number;
136
- royalblue: number;
137
- saddlebrown: number;
138
- salmon: number;
139
- sandybrown: number;
140
- seagreen: number;
141
- seashell: number;
142
- sienna: number;
143
- silver: number;
144
- skyblue: number;
145
- slateblue: number;
146
- slategray: number;
147
- slategrey: number;
148
- snow: number;
149
- springgreen: number;
150
- steelblue: number;
151
- tan: number;
152
- teal: number;
153
- thistle: number;
154
- tomato: number;
155
- turquoise: number;
156
- violet: number;
157
- wheat: number;
158
- white: number;
159
- whitesmoke: number;
160
- yellow: number;
161
- yellowgreen: number;
162
- };