toosoon-utils 1.5.0 → 2.1.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.
- package/package.json +9 -6
- package/tsconfig.json +1 -3
- package/lib/classes/_pool.d.ts +0 -56
- package/lib/classes/_pool.js +0 -92
- package/lib/classes/color-scale.d.ts +0 -52
- package/lib/classes/color-scale.js +0 -160
- package/lib/classes/frame-rate.d.ts +0 -25
- package/lib/classes/frame-rate.js +0 -48
- package/lib/colors.d.ts +0 -155
- package/lib/colors.js +0 -367
- package/lib/constants.d.ts +0 -162
- package/lib/constants.js +0 -170
- package/lib/dom.d.ts +0 -25
- package/lib/dom.js +0 -47
- package/lib/files.d.ts +0 -14
- package/lib/files.js +0 -38
- package/lib/functions.d.ts +0 -22
- package/lib/functions.js +0 -53
- package/lib/geometry.d.ts +0 -89
- package/lib/geometry.js +0 -128
- package/lib/index.d.ts +0 -10
- package/lib/index.js +0 -39
- package/lib/maths.d.ts +0 -161
- package/lib/maths.js +0 -219
- package/lib/now.d.ts +0 -5
- package/lib/now.js +0 -28
- package/lib/prng.d.ts +0 -124
- package/lib/prng.js +0 -234
- package/lib/random.d.ts +0 -91
- package/lib/random.js +0 -162
- package/lib/strings.d.ts +0 -14
- package/lib/strings.js +0 -18
- package/lib/tsconfig.tsbuildinfo +0 -1
- package/lib/types.d.ts +0 -18
- package/lib/types.js +0 -1
- package/src/classes/_pool.ts +0 -92
- package/src/classes/color-scale.ts +0 -181
- package/src/classes/frame-rate.ts +0 -49
- package/src/colors.ts +0 -389
- package/src/constants.ts +0 -172
- package/src/dom.ts +0 -50
- package/src/files.ts +0 -42
- package/src/functions.ts +0 -56
- package/src/geometry.ts +0 -160
- package/src/maths.ts +0 -241
- package/src/prng.ts +0 -249
- package/src/random.ts +0 -162
- package/src/strings.ts +0 -19
- package/src/types.ts +0 -33
package/lib/random.js
DELETED
|
@@ -1,162 +0,0 @@
|
|
|
1
|
-
import { radToSphere } from './geometry';
|
|
2
|
-
/**
|
|
3
|
-
* Generate a random boolean (true or false)
|
|
4
|
-
*
|
|
5
|
-
* @param {number} [probability=0.5] Probability to get true
|
|
6
|
-
* @returns {boolean} Either `true` or `false`
|
|
7
|
-
*/
|
|
8
|
-
export function randomBoolean(probability) {
|
|
9
|
-
if (probability === void 0) { probability = 0.5; }
|
|
10
|
-
return Math.random() < probability;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* Generate a random sign (1 or -1)
|
|
14
|
-
*
|
|
15
|
-
* @param {number} [probability=0.5] Probability to get 1
|
|
16
|
-
* @returns {number} Either 1 or -1
|
|
17
|
-
*/
|
|
18
|
-
export function randomSign(probability) {
|
|
19
|
-
if (probability === void 0) { probability = 0.5; }
|
|
20
|
-
return randomBoolean(probability) ? 1 : -1;
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Generate a random floating-point number within a specified range
|
|
24
|
-
*
|
|
25
|
-
* @param {number} [min=0] Minimum boundary
|
|
26
|
-
* @param {number} [max=1] Maximum boundary
|
|
27
|
-
* @param {number} [precision=2] Number of digits after the decimal point
|
|
28
|
-
* @returns {number} Generated float
|
|
29
|
-
*/
|
|
30
|
-
export function randomFloat(min, max, precision) {
|
|
31
|
-
if (min === void 0) { min = 0; }
|
|
32
|
-
if (max === void 0) { max = 1; }
|
|
33
|
-
if (precision === void 0) { precision = 2; }
|
|
34
|
-
return parseFloat(Math.min(min + Math.random() * (max - min), max).toFixed(precision));
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Generate a random integer number within a specified range
|
|
38
|
-
*
|
|
39
|
-
* @param {number} min Minimum boundary
|
|
40
|
-
* @param {number} max Maximum boundary
|
|
41
|
-
* @returns {number} Generated integer
|
|
42
|
-
*/
|
|
43
|
-
export function randomInt(min, max) {
|
|
44
|
-
return Math.floor(Math.random() * (max - min + 1) + min);
|
|
45
|
-
}
|
|
46
|
-
/**
|
|
47
|
-
* Generate a random hexadecimal color
|
|
48
|
-
*
|
|
49
|
-
* @returns {string} Generated hexadecimal color
|
|
50
|
-
*/
|
|
51
|
-
export function randomHexColor() {
|
|
52
|
-
return '#' + ('00000' + ((Math.random() * (1 << 24)) | 0).toString(16)).slice(-6);
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Pick a random item from a given array
|
|
56
|
-
*
|
|
57
|
-
* @param {T[]} array Array to pick the item from
|
|
58
|
-
* @returns {T|undefined} Random item picked
|
|
59
|
-
*/
|
|
60
|
-
export function randomItem(array) {
|
|
61
|
-
if (array.length === 0)
|
|
62
|
-
return undefined;
|
|
63
|
-
return array[randomInt(0, array.length - 1)];
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Pick a random property value from a given object
|
|
67
|
-
*
|
|
68
|
-
* @param {object} object Object to pick the property from
|
|
69
|
-
* @returns {T|undefined} Random item picked
|
|
70
|
-
*/
|
|
71
|
-
export function randomObjectProperty(object) {
|
|
72
|
-
var keys = Object.keys(object);
|
|
73
|
-
var key = randomItem(keys);
|
|
74
|
-
if (key && object.hasOwnProperty(key)) {
|
|
75
|
-
return object[key];
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Select a random index from an array of weighted items
|
|
80
|
-
*
|
|
81
|
-
* @param {number[]} weights Array of weights
|
|
82
|
-
* @returns {number} Random index based on weights
|
|
83
|
-
*/
|
|
84
|
-
export function randomIndex(weights) {
|
|
85
|
-
if (weights.length === 0)
|
|
86
|
-
return -1;
|
|
87
|
-
var totalWeight = 0;
|
|
88
|
-
for (var _i = 0, weights_1 = weights; _i < weights_1.length; _i++) {
|
|
89
|
-
var weight_1 = weights_1[_i];
|
|
90
|
-
totalWeight += weight_1;
|
|
91
|
-
}
|
|
92
|
-
if (totalWeight <= 0) {
|
|
93
|
-
console.warn('randomIndex()', 'Weights must sum to > 0', totalWeight);
|
|
94
|
-
}
|
|
95
|
-
var weight = Math.random() * totalWeight;
|
|
96
|
-
for (var i = 0; i < weights.length; i++) {
|
|
97
|
-
if (weight < weights[i])
|
|
98
|
-
return i;
|
|
99
|
-
weight -= weights[i];
|
|
100
|
-
}
|
|
101
|
-
return 0;
|
|
102
|
-
}
|
|
103
|
-
// *********************
|
|
104
|
-
// Geometry
|
|
105
|
-
// *********************
|
|
106
|
-
/**
|
|
107
|
-
* Produce a random 2D point around the perimiter of a unit circle
|
|
108
|
-
*
|
|
109
|
-
* @param {number} [radius=1] Radius of the circle
|
|
110
|
-
* @param {Vector2} [target] Target vector
|
|
111
|
-
* @returns {Vector2} Random 2D point on circle
|
|
112
|
-
*/
|
|
113
|
-
export function onCircle(radius, target) {
|
|
114
|
-
if (radius === void 0) { radius = 1; }
|
|
115
|
-
if (target === void 0) { target = { x: 0, y: 0 }; }
|
|
116
|
-
var angle = Math.random() * 2.0 * Math.PI;
|
|
117
|
-
target.x = radius * Math.cos(angle);
|
|
118
|
-
target.y = radius * Math.sin(angle);
|
|
119
|
-
return target;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* Produce a random 2D point inside a unit circle
|
|
123
|
-
*
|
|
124
|
-
* @param {number} [radius=1] Radius of the circle
|
|
125
|
-
* @param {Vector2} [target] Target vector
|
|
126
|
-
* @returns {Vector2} Random 2D point inside circle
|
|
127
|
-
*/
|
|
128
|
-
export function insideCircle(radius, target) {
|
|
129
|
-
if (radius === void 0) { radius = 1; }
|
|
130
|
-
if (target === void 0) { target = { x: 0, y: 0 }; }
|
|
131
|
-
radius *= Math.random();
|
|
132
|
-
return onCircle(radius, target);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Produce a random 3D point on the surface of a unit sphere
|
|
136
|
-
*
|
|
137
|
-
* @param {number} [radius=1] Radius of the sphere
|
|
138
|
-
* @param {Vector3} [target] Target vector
|
|
139
|
-
* @returns {Vector3} Random 3D point on sphere
|
|
140
|
-
*/
|
|
141
|
-
export function onSphere(radius, target) {
|
|
142
|
-
if (radius === void 0) { radius = 1; }
|
|
143
|
-
if (target === void 0) { target = { x: 0, y: 0, z: 0 }; }
|
|
144
|
-
var u = Math.random() * Math.PI * 2;
|
|
145
|
-
var v = Math.random() * 2 - 1;
|
|
146
|
-
var phi = u;
|
|
147
|
-
var theta = Math.acos(v);
|
|
148
|
-
return radToSphere(radius, phi, theta, target);
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* Produce a random 3D point inside a unit sphere
|
|
152
|
-
*
|
|
153
|
-
* @param {number} [radius=1] Radius of the sphere
|
|
154
|
-
* @param {Vector3} [target] Target vector
|
|
155
|
-
* @returns {Vector3} Random 3D point inside sphere
|
|
156
|
-
*/
|
|
157
|
-
export function insideSphere(radius, target) {
|
|
158
|
-
if (radius === void 0) { radius = 1; }
|
|
159
|
-
if (target === void 0) { target = { x: 0, y: 0, z: 0 }; }
|
|
160
|
-
radius *= Math.random();
|
|
161
|
-
return onSphere(radius, target);
|
|
162
|
-
}
|
package/lib/strings.d.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capitalize a string
|
|
3
|
-
*
|
|
4
|
-
* @param {string} string String to capitalize
|
|
5
|
-
* @returns {string} Capitalized string
|
|
6
|
-
*/
|
|
7
|
-
export declare function capitalize(string: string): string;
|
|
8
|
-
/**
|
|
9
|
-
* Clean a path by removing params
|
|
10
|
-
*
|
|
11
|
-
* @param {string} path Path to clean
|
|
12
|
-
* @returns {string} Cleaned path
|
|
13
|
-
*/
|
|
14
|
-
export declare function cleanPath(path: string): string;
|
package/lib/strings.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Capitalize a string
|
|
3
|
-
*
|
|
4
|
-
* @param {string} string String to capitalize
|
|
5
|
-
* @returns {string} Capitalized string
|
|
6
|
-
*/
|
|
7
|
-
export function capitalize(string) {
|
|
8
|
-
return string.charAt(0).toUpperCase() + string.slice(1);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Clean a path by removing params
|
|
12
|
-
*
|
|
13
|
-
* @param {string} path Path to clean
|
|
14
|
-
* @returns {string} Cleaned path
|
|
15
|
-
*/
|
|
16
|
-
export function cleanPath(path) {
|
|
17
|
-
return path.split('#')[0].split('?')[0];
|
|
18
|
-
}
|
package/lib/tsconfig.tsbuildinfo
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.es2021.d.ts","../node_modules/typescript/lib/lib.es2022.d.ts","../node_modules/typescript/lib/lib.es2023.d.ts","../node_modules/typescript/lib/lib.esnext.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.date.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2019.intl.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.es2021.promise.d.ts","../node_modules/typescript/lib/lib.es2021.string.d.ts","../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../node_modules/typescript/lib/lib.es2021.intl.d.ts","../node_modules/typescript/lib/lib.es2022.array.d.ts","../node_modules/typescript/lib/lib.es2022.error.d.ts","../node_modules/typescript/lib/lib.es2022.intl.d.ts","../node_modules/typescript/lib/lib.es2022.object.d.ts","../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2022.string.d.ts","../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../node_modules/typescript/lib/lib.es2023.array.d.ts","../node_modules/typescript/lib/lib.es2023.collection.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.d.ts","../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../src/constants.ts","../src/types.ts","../src/geometry.ts","../src/maths.ts","../src/colors.ts","../src/dom.ts","../src/files.ts","../src/functions.ts","../src/prng.ts","../src/random.ts","../src/strings.ts","../src/classes/_pool.ts","../src/classes/color-scale.ts","../src/classes/frame-rate.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/undici-types/header.d.ts","../node_modules/undici-types/readable.d.ts","../node_modules/undici-types/file.d.ts","../node_modules/undici-types/fetch.d.ts","../node_modules/undici-types/formdata.d.ts","../node_modules/undici-types/connector.d.ts","../node_modules/undici-types/client.d.ts","../node_modules/undici-types/errors.d.ts","../node_modules/undici-types/dispatcher.d.ts","../node_modules/undici-types/global-dispatcher.d.ts","../node_modules/undici-types/global-origin.d.ts","../node_modules/undici-types/pool-stats.d.ts","../node_modules/undici-types/pool.d.ts","../node_modules/undici-types/handlers.d.ts","../node_modules/undici-types/balanced-pool.d.ts","../node_modules/undici-types/agent.d.ts","../node_modules/undici-types/mock-interceptor.d.ts","../node_modules/undici-types/mock-agent.d.ts","../node_modules/undici-types/mock-client.d.ts","../node_modules/undici-types/mock-pool.d.ts","../node_modules/undici-types/mock-errors.d.ts","../node_modules/undici-types/proxy-agent.d.ts","../node_modules/undici-types/api.d.ts","../node_modules/undici-types/cookies.d.ts","../node_modules/undici-types/patch.d.ts","../node_modules/undici-types/filereader.d.ts","../node_modules/undici-types/diagnostics-channel.d.ts","../node_modules/undici-types/websocket.d.ts","../node_modules/undici-types/content-type.d.ts","../node_modules/undici-types/cache.d.ts","../node_modules/undici-types/interceptors.d.ts","../node_modules/undici-types/index.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/dom-events.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/readline/promises.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/test.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts"],"fileInfos":[{"version":"f33e5332b24c3773e930e212cbb8b6867c8ba3ec4492064ea78e55a524d57450","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","26f2f787e82c4222710f3b676b4d83eb5ad0a72fa7b746f03449e7a026ce5073","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","bed7b7ba0eb5a160b69af72814b4dde371968e40b6c5e73d3a9f7bee407d158c",{"version":"21e41a76098aa7a191028256e52a726baafd45a925ea5cf0222eb430c96c1d83","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"e0275cd0e42990dc3a16f0b7c8bca3efe87f1c8ad404f80c6db1c7c0b828c59f","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"acae90d417bee324b1372813b5a00829d31c7eb670d299cd7f8f9a648ac05688","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"62a4966981264d1f04c44eb0f4b5bdc3d81c1a54725608861e44755aa24ad6a5","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"86a34c7a13de9cabc43161348f663624b56871ed80986e41d214932ddd8d6719","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"4350e5922fecd4bedda2964d69c213a1436349d0b8d260dd902795f5b94dc74b","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"45cf2eb6cd6d7189ff80c87564aaa4fea53eb4c3da65d5e641127373de571cd9","signature":"0b4eec0a8599d6713095e0af18ab7e6204b675cd9fe8b2d02d04d66746e586e1"},{"version":"afcdcf3d0d1bb3289b5b7e7f9279e29ddee9ff9204376cf3d61636fe739f34ac","signature":"cf619c5895f1094521348154ca64a0c7b2f27aae89224981a63aee81ec835745"},{"version":"26337136ebd1ad61e045cf60e54556c56f64d69c0c3ab3567a04c48223c3d607","signature":"b2257f8c6c1893a598e6ab1109ae8af08dc4f44e220e04bc24d9e41e3252d8c1"},{"version":"ac3ceb54ea53cf59c64876bd639f29f36a971be7dd80d8cac3714e771ce3ae83","signature":"1ae451b9641fbf2f2fe337265830a61d9acd7b23f97ff3596e1c1e8030cebc6f"},{"version":"aa631ccb764e10001e746490f52eef2f129fd73c41aee0e95f9a9964544c92e1","signature":"ca745f3cebda4c4e91b00575b1cb2512df09c3f167b186b6f6fb5e8a9dec338e"},{"version":"56e06e465410f22645dca5fb7e640d2cf69004507af83364f1cc409297718adb","signature":"c1628eb24e9fb865d784112e7d6fd6c3c2a9af35c2947f3f7814a61f987f55a1"},{"version":"d52ff004bb7cd1c00d0a179f4b0893ddf84cdafc6830b2ceafc814804dfff9a5","signature":"4d71e33886aa72fef5fe425d76a3557f6553ee0b08863733656d58b91b8a6e77"},{"version":"de35f6a8eedc2a21a0e673f456cb55419da3985c321b19f3f1c81f37cb2f3013","signature":"61f803248f1cb85557eaa016fe19620e5a390cf87abba42ec793afda3a65f3be"},{"version":"ca87695cf624ac3810968c444fd07b7b6370b0df199304530ecfe7373cdad5c7","signature":"bfbf0986270057216327e240d192582c2e1ad64f995251a8e99ef655ae3174f9"},{"version":"9c870b7ab6fbcf9491ff24997ad32d113b1d15ee21dc3b3a29c53f3979f12677","signature":"898901974d793c87194bd6b9b5e80cb5e1462113da0a76649d2b9c83a1820934"},{"version":"7ff1ac0e7aebca773d04dda761bca41d14320e0622ef69f6f2447e7b000f4fa7","signature":"399d115998e6ee77790354467a58babe1c7ee7caba7eed1bf471f4ec8a9a365f"},{"version":"4d7527ca5cc5b43998dea53a70b01fcae3f3ddcfdd570d8f677813107d198b4f","signature":"d0e23e1faa28d5e2cd295e0ee3348313884513c7db2e17609664c01a95228ba3"},{"version":"34ffa94ce2d61b3c97797c9616213b9bd810adc4ecfccfafc5e0369ef6346749","signature":"fcb413aaae0549c5b6b386263f6452910271db6cd6bc712098c37324b8910d84"},{"version":"562abb83a49d3112664e50077ea0b0b68e7714258a2961f47ee6c79117eeb153","signature":"93bd4de4b789d580460b72635bcfff03bf58797ef8c581c5de815f429c5115a9"},"efc7d584a33fe3422847783d228f315c4cd1afe74bd7cf8e3f0e4c1125129fef","7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","7180c03fd3cb6e22f911ce9ba0f8a7008b1a6ddbe88ccf16a9c8140ef9ac1686","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","54cb85a47d760da1c13c00add10d26b5118280d44d58e6908d8e89abbd9d7725","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","a967bfe3ad4e62243eb604bf956101e4c740f5921277c60debaf325c1320bf88","e9775e97ac4877aebf963a0289c81abe76d1ec9a2a7778dbe637e5151f25c5f3","471e1da5a78350bc55ef8cef24eb3aca6174143c281b8b214ca2beda51f5e04a","cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","db3435f3525cd785bf21ec6769bf8da7e8a776be1a99e2e7efb5f244a2ef5fee","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","40383ebef22b943d503c6ce2cb2e060282936b952a01bea5f9f493d5fb487cc7","4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","3a84b7cb891141824bd00ef8a50b6a44596aded4075da937f180c90e362fe5f6","13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","33203609eba548914dc83ddf6cadbc0bcb6e8ef89f6d648ca0908ae887f9fcc5","0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","9f0a92164925aa37d4a5d9dd3e0134cff8177208dba55fd2310cd74beea40ee2","8bfdb79bf1a9d435ec48d9372dc93291161f152c0865b81fc0b2694aedb4578d","2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","d32275be3546f252e3ad33976caf8c5e842c09cb87d468cb40d5f4cf092d1acc","4a0c3504813a3289f7fb1115db13967c8e004aa8e4f8a9021b95285502221bd1",{"version":"a14ed46fa3f5ffc7a8336b497cd07b45c2084213aaca933a22443fcb2eef0d07","affectsGlobalScope":true},"cce1f5f86974c1e916ec4a8cab6eec9aa8e31e8148845bf07fbaa8e1d97b1a2c",{"version":"e2eb1ce13a9c0fa7ab62c63909d81973ef4b707292667c64f1e25e6e53fa7afa","affectsGlobalScope":true},"16d74fe4d8e183344d3beb15d48b123c5980ff32ff0cc8c3b96614ddcdf9b239","7b43160a49cf2c6082da0465876c4a0b164e160b81187caeb0a6ca7a281e85ba",{"version":"41fb2a1c108fbf46609ce5a451b7ec78eb9b5ada95fd5b94643e4b26397de0b3","affectsGlobalScope":true},"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb",{"version":"a1d2988ad9d2aef7b9915a22b5e52c165c83a878f2851c35621409046bbe3c05","affectsGlobalScope":true},"bd3f5d05b6b5e4bfcea7739a45f3ffb4a7f4a3442ba7baf93e0200799285b8f1","4c775c2fccabf49483c03cd5e3673f87c1ffb6079d98e7b81089c3def79e29c6","8806ae97308ef26363bd7ec8071bca4d07fb575f905ee3d8a91aff226df6d618","af5bf1db6f1804fb0069039ae77a05d60133c77a2158d9635ea27b6bb2828a8f","b7fe70be794e13d1b7940e318b8770cd1fb3eced7707805318a2e3aaac2c3e9e",{"version":"2c71199d1fc83bf17636ad5bf63a945633406b7b94887612bba4ef027c662b3e","affectsGlobalScope":true},{"version":"7ae9dc7dbb58cd843065639707815df85c044babaa0947116f97bdb824d07204","affectsGlobalScope":true},"fe1fd6afdfe77976d4c702f3746c05fb05a7e566845c890e0e970fe9376d6a90","313a0b063f5188037db113509de1b934a0e286f14e9479af24fada241435e707","f1ace2d2f98429e007d017c7a445efad2aaebf8233135abdb2c88b8c0fef91ab","87ef1a23caa071b07157c72077fa42b86d30568f9dc9e31eed24d5d14fc30ba8","396a8939b5e177542bdf9b5262b4eee85d29851b2d57681fa9d7eae30e225830","21773f5ac69ddf5a05636ba1f50b5239f4f2d27e4420db147fc2f76a5ae598ac",{"version":"ea455cc68871b049bcecd9f56d4cf27b852d6dafd5e3b54468ca87cc11604e4d","affectsGlobalScope":true},"c07146dbbbd8b347241b5df250a51e48f2d7bef19b1e187b1a3f20c849988ff1","45b1053e691c5af9bfe85060a3e1542835f8d84a7e6e2e77ca305251eda0cb3c","0f05c06ff6196958d76b865ae17245b52d8fe01773626ac3c43214a2458ea7b7",{"version":"ae5507fc333d637dec9f37c6b3f4d423105421ea2820a64818de55db85214d66","affectsGlobalScope":true},{"version":"0666f4c99b8688c7be5956df8fecf5d1779d3b22f8f2a88258ae7072c7b6026f","affectsGlobalScope":true},"8abd0566d2854c4bd1c5e48e05df5c74927187f1541e6770001d9637ac41542e","54e854615c4eafbdd3fd7688bd02a3aafd0ccf0e87c98f79d3e9109f047ce6b8","d8dba11dc34d50cb4202de5effa9a1b296d7a2f4a029eec871f894bddfb6430d","8b71dd18e7e63b6f991b511a201fad7c3bf8d1e0dd98acb5e3d844f335a73634","01d8e1419c84affad359cc240b2b551fb9812b450b4d3d456b64cda8102d4f60","8221b00f271cf7f535a8eeec03b0f80f0929c7a16116e2d2df089b41066de69b","269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","7424817d5eb498771e6d1808d726ec38f75d2eaf3fa359edd5c0c540c52725c1","9a9634296cca836c3308923ba7aa094fa6ed76bb1e366d8ddcf5c65888ab1024",{"version":"bddce945d552a963c9733db106b17a25474eefcab7fc990157a2134ef55d4954","affectsGlobalScope":true},{"version":"7052b7b0c3829df3b4985bab2fd74531074b4835d5a7b263b75c82f0916ad62f","affectsGlobalScope":true},"aa34c3aa493d1c699601027c441b9664547c3024f9dbab1639df7701d63d18fa","4b55240c2a03b2c71e98a7fc528b16136faa762211c92e781a01c37821915ea6","7c651f8dce91a927ab62925e73f190763574c46098f2b11fb8ddc1b147a6709a","7440ab60f4cb031812940cc38166b8bb6fbf2540cfe599f87c41c08011f0c1df",{"version":"94c086dff8dbc5998749326bc69b520e8e4273fb5b7b58b50e0210e0885dfcde","affectsGlobalScope":true},{"version":"f5b5dc128973498b75f52b1b8c2d5f8629869104899733ae485100c2309b4c12","affectsGlobalScope":true},"ebe5facd12fd7745cda5f4bc3319f91fb29dc1f96e57e9c6f8b260a7cc5b67ee","79bad8541d5779c85e82a9fb119c1fe06af77a71cc40f869d62ad379473d4b75","37dc027f781c75f0f546e329cfac7cf92a6b289f42458f47a9adc25e516b6839",{"version":"629d20681ca284d9e38c0a019f647108f5fe02f9c59ac164d56f5694fc3faf4d","affectsGlobalScope":true},"e7dbf5716d76846c7522e910896c5747b6df1abd538fee8f5291bdc843461795",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b510d0a18e3db42ac9765d26711083ec1e8b4e21caaca6dc4d25ae6e8623f447"],"root":[[65,78]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":99,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","skipLibCheck":true,"strict":true,"target":1},"fileIdsList":[[79],[114],[115,120,148],[116,127,128,135,145,156],[116,117,127,135],[118,157],[119,120,128,136],[120,145,153],[121,123,127,135],[114,122],[123,124],[127],[125,127],[114,127],[127,128,129,145,156],[127,128,129,142,145,148],[112,115,161],[123,127,130,135,145,156],[127,128,130,131,135,145,153,156],[130,132,145,153,156],[79,80,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163],[127,133],[134,156,161],[123,127,135,145],[136],[137],[114,138],[139,155,161],[140],[141],[127,142,143],[142,144,157,159],[115,127,145,146,147,148],[115,145,147],[145,146],[148],[149],[114,145],[127,151,152],[151,152],[120,135,145,153],[154],[135,155],[115,130,141,156],[120,157],[145,158],[134,159],[160],[115,120,127,129,138,145,156,159,161],[145,162],[89,93,156],[89,145,156],[84],[86,89,153,156],[135,153],[164],[84,164],[86,89,135,156],[81,82,85,88,115,127,145,156],[81,87],[85,89,115,148,156,164],[115,164],[105,115,164],[83,84,164],[89],[83,84,85,86,87,88,89,90,91,93,94,95,96,97,98,99,100,101,102,103,104,106,107,108,109,110,111],[89,96,97],[87,89,97,98],[88],[81,84,89],[89,93,97,98],[93],[87,89,92,156],[81,86,87,89,93,96],[115,145],[84,89,105,115,161,164],[66,68,69],[72],[65,66,67,68],[66],[65,66],[66,67],[65]],"referencedMap":[[79,1],[80,1],[114,2],[115,3],[116,4],[117,5],[118,6],[119,7],[120,8],[121,9],[122,10],[123,11],[124,11],[126,12],[125,13],[127,14],[128,15],[129,16],[113,17],[130,18],[131,19],[132,20],[164,21],[133,22],[134,23],[135,24],[136,25],[137,26],[138,27],[139,28],[140,29],[141,30],[142,31],[143,31],[144,32],[145,33],[147,34],[146,35],[148,36],[149,37],[150,38],[151,39],[152,40],[153,41],[154,42],[155,43],[156,44],[157,45],[158,46],[159,47],[160,48],[161,49],[162,50],[96,51],[103,52],[95,51],[110,53],[87,54],[86,55],[109,56],[104,57],[107,58],[89,59],[88,60],[84,61],[83,62],[106,63],[85,64],[90,65],[94,65],[112,66],[111,65],[98,67],[99,68],[101,69],[97,70],[100,71],[105,56],[92,72],[93,73],[102,74],[82,75],[108,76],[77,77],[78,78],[69,79],[72,80],[67,81],[74,82],[66,83]],"exportedModulesMap":[[79,1],[80,1],[114,2],[115,3],[116,4],[117,5],[118,6],[119,7],[120,8],[121,9],[122,10],[123,11],[124,11],[126,12],[125,13],[127,14],[128,15],[129,16],[113,17],[130,18],[131,19],[132,20],[164,21],[133,22],[134,23],[135,24],[136,25],[137,26],[138,27],[139,28],[140,29],[141,30],[142,31],[143,31],[144,32],[145,33],[147,34],[146,35],[148,36],[149,37],[150,38],[151,39],[152,40],[153,41],[154,42],[155,43],[156,44],[157,45],[158,46],[159,47],[160,48],[161,49],[162,50],[96,51],[103,52],[95,51],[110,53],[87,54],[86,55],[109,56],[104,57],[107,58],[89,59],[88,60],[84,61],[83,62],[106,63],[85,64],[90,65],[94,65],[112,66],[111,65],[98,67],[99,68],[101,69],[97,70],[100,71],[105,56],[92,72],[93,73],[102,74],[82,75],[108,76],[77,80],[69,80],[72,80],[67,80],[74,80],[66,83]],"semanticDiagnosticsPerFile":[79,80,114,115,116,117,118,119,120,121,122,123,124,126,125,127,128,129,113,163,130,131,132,164,133,134,135,136,137,138,139,140,141,142,143,144,145,147,146,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,63,64,12,14,13,2,15,16,17,18,19,20,21,22,3,4,23,27,24,25,26,28,29,30,5,31,32,33,34,6,38,35,36,37,39,7,40,45,46,41,42,43,44,8,50,47,48,49,51,9,52,53,54,57,55,56,58,59,10,1,11,62,61,60,96,103,95,110,87,86,109,104,107,89,88,84,83,106,85,90,91,94,81,112,111,98,99,101,97,100,105,92,93,102,82,108,76,77,78,69,65,70,71,72,67,68,73,74,75,66]},"version":"5.3.3"}
|
package/lib/types.d.ts
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { W3CX11 } from './constants';
|
|
2
|
-
export type ColorName = keyof typeof W3CX11;
|
|
3
|
-
export type ColorRepresentation = ColorName | string | number | [number, number, number];
|
|
4
|
-
export interface Deferred<T> {
|
|
5
|
-
promise: Promise<T>;
|
|
6
|
-
resolve: (value: T | PromiseLike<T>) => void;
|
|
7
|
-
reject: (reason?: unknown) => void;
|
|
8
|
-
}
|
|
9
|
-
export interface Vector2 {
|
|
10
|
-
x: number;
|
|
11
|
-
y: number;
|
|
12
|
-
}
|
|
13
|
-
export interface Vector3 extends Vector2 {
|
|
14
|
-
z: number;
|
|
15
|
-
}
|
|
16
|
-
export interface Vector4 extends Vector3 {
|
|
17
|
-
w: number;
|
|
18
|
-
}
|
package/lib/types.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/src/classes/_pool.ts
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
// *********************
|
|
2
|
-
// WIP
|
|
3
|
-
// *********************
|
|
4
|
-
|
|
5
|
-
export type PoolSettings = {
|
|
6
|
-
max?: number;
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export const defaultSettings: Required<PoolSettings> = {
|
|
10
|
-
max: Infinity
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
interface PoolItem {
|
|
14
|
-
setup?: () => void;
|
|
15
|
-
reset?: () => void;
|
|
16
|
-
dispose?: () => void;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Abstract class for manipulating pool items
|
|
21
|
-
*
|
|
22
|
-
* @exports
|
|
23
|
-
* @class Pool
|
|
24
|
-
*/
|
|
25
|
-
export default abstract class Pool<I extends PoolItem> {
|
|
26
|
-
public items: I[] = [];
|
|
27
|
-
public pool: I[] = [];
|
|
28
|
-
|
|
29
|
-
settings: Required<PoolSettings> = { ...defaultSettings };
|
|
30
|
-
|
|
31
|
-
constructor(settings: PoolSettings = { ...defaultSettings }) {
|
|
32
|
-
this.settings = Object.assign(this.settings, settings);
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* Abstract method to implement custom item creation
|
|
37
|
-
*
|
|
38
|
-
* @returns {PoolItem}
|
|
39
|
-
*/
|
|
40
|
-
protected abstract create(): I;
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Add an item to the active items
|
|
44
|
-
*
|
|
45
|
-
* @param {PoolItem} item Item to add to the active items
|
|
46
|
-
*/
|
|
47
|
-
protected add(item: I): void {
|
|
48
|
-
this.items.push(item);
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Remove an item from the active items
|
|
53
|
-
*
|
|
54
|
-
* @param {PoolItem} item Item to remove from the active items
|
|
55
|
-
*/
|
|
56
|
-
protected remove(item: I): void {
|
|
57
|
-
this.items = this.items.filter((_item) => _item !== item);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Return an item from pool or create a new one
|
|
62
|
-
*
|
|
63
|
-
* @returns {PoolItem|undefined}
|
|
64
|
-
*/
|
|
65
|
-
public get(): I | undefined {
|
|
66
|
-
if (this.items.length >= this.settings.max) return;
|
|
67
|
-
const item = this.pool.pop() ?? this.create();
|
|
68
|
-
item.setup?.();
|
|
69
|
-
this.add(item);
|
|
70
|
-
return item;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Release an item from the active items and add it to the pool
|
|
75
|
-
*
|
|
76
|
-
* @param {PoolItem} item Item to release
|
|
77
|
-
*/
|
|
78
|
-
public release(item: I): void {
|
|
79
|
-
this.pool.push(item);
|
|
80
|
-
item.reset?.();
|
|
81
|
-
this.remove(item);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
/**
|
|
85
|
-
* Dispose all items
|
|
86
|
-
*/
|
|
87
|
-
public dispose(): void {
|
|
88
|
-
[...this.items, ...this.pool].forEach((item: I) => item.dispose?.());
|
|
89
|
-
this.items = [];
|
|
90
|
-
this.pool = [];
|
|
91
|
-
}
|
|
92
|
-
}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { lerp, triLerp } from '../maths';
|
|
2
|
-
import { hclToRgb, hsbToRgb, hslToRgb, normalizeColor, rgbToHcl, rgbToHsb, rgbToHsl } from '../colors';
|
|
3
|
-
import { ColorRepresentation } from '../types';
|
|
4
|
-
|
|
5
|
-
export type ColorScaleSettings =
|
|
6
|
-
| {
|
|
7
|
-
colorSpace: 'rgb' | 'hsl' | 'hsb';
|
|
8
|
-
}
|
|
9
|
-
| {
|
|
10
|
-
colorSpace: 'hcl';
|
|
11
|
-
mode?: 'qualitative' | 'sequential' | 'diverging';
|
|
12
|
-
triangular?: number;
|
|
13
|
-
powerStrength?: number;
|
|
14
|
-
hueOffset?: number;
|
|
15
|
-
chromaOffset?: number;
|
|
16
|
-
luminanceOffset?: number;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export const defaultSettings: Required<ColorScaleSettings> = {
|
|
20
|
-
colorSpace: 'rgb'
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
* Utility class for generating color scales and interpolating between colors
|
|
25
|
-
*
|
|
26
|
-
* @exports
|
|
27
|
-
* @class ColorScale
|
|
28
|
-
*/
|
|
29
|
-
export default class ColorScale {
|
|
30
|
-
/**
|
|
31
|
-
* Array of colors composing the color scale
|
|
32
|
-
*/
|
|
33
|
-
public colors: Array<[number, number, number]> = [];
|
|
34
|
-
|
|
35
|
-
/**
|
|
36
|
-
* @param {ColorRepresentation} input Input color representation
|
|
37
|
-
* @param {ColorRepresentation} target Target color representation
|
|
38
|
-
* @param {number} [length=5] Amount of colors composing the color scale
|
|
39
|
-
* @param {ColorScaleSettings} [settings] Color scale generation settings
|
|
40
|
-
*/
|
|
41
|
-
constructor(
|
|
42
|
-
input: ColorRepresentation,
|
|
43
|
-
target: ColorRepresentation,
|
|
44
|
-
length: number = 5,
|
|
45
|
-
settings: ColorScaleSettings = { ...defaultSettings }
|
|
46
|
-
) {
|
|
47
|
-
this.colors = ColorScale.generate(input, target, length, settings);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
/**
|
|
51
|
-
* Static method for generating a color scale
|
|
52
|
-
*
|
|
53
|
-
* @param {ColorRepresentation} input Input color representation
|
|
54
|
-
* @param {ColorRepresentation} target Target color representation
|
|
55
|
-
* @param {number} length Amount of colors composing the color scale
|
|
56
|
-
* @param {ColorScaleSettings} [settings] Color scale generation settings
|
|
57
|
-
* @returns {Array<[number, number, number]>} Color scale colors
|
|
58
|
-
*/
|
|
59
|
-
static generate(
|
|
60
|
-
input: ColorRepresentation,
|
|
61
|
-
target: ColorRepresentation,
|
|
62
|
-
length: number,
|
|
63
|
-
settings: ColorScaleSettings = { ...defaultSettings }
|
|
64
|
-
): Array<[number, number, number]> {
|
|
65
|
-
const colors: Array<[number, number, number]> = [];
|
|
66
|
-
|
|
67
|
-
const inputColor = normalizeColor(input);
|
|
68
|
-
const targetColor = normalizeColor(target);
|
|
69
|
-
|
|
70
|
-
for (let i = 0; i < length; i++) {
|
|
71
|
-
const value = i / Math.floor(length);
|
|
72
|
-
colors.push(ColorScale.interpolate(inputColor, targetColor, value, settings));
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
return colors;
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
* Static method for interpolating between colors
|
|
80
|
-
*
|
|
81
|
-
* @param {[number,number,number]} inputColor Input color
|
|
82
|
-
* @param {[number,number,number]} targetColor Target color
|
|
83
|
-
* @param {number} value Interpolation normalized value
|
|
84
|
-
* @param {ColorScaleSettings} [settings] Color scale settings
|
|
85
|
-
* @returns {[number,number,number]} Interpolated color
|
|
86
|
-
*/
|
|
87
|
-
static interpolate(
|
|
88
|
-
inputColor: [number, number, number],
|
|
89
|
-
targetColor: [number, number, number],
|
|
90
|
-
value: number,
|
|
91
|
-
settings: ColorScaleSettings = { ...defaultSettings }
|
|
92
|
-
): [number, number, number] {
|
|
93
|
-
switch (settings.colorSpace) {
|
|
94
|
-
case 'rgb': {
|
|
95
|
-
const r = lerp(value, inputColor[0], targetColor[0]);
|
|
96
|
-
const g = lerp(value, inputColor[1], targetColor[1]);
|
|
97
|
-
const b = lerp(value, inputColor[2], targetColor[2]);
|
|
98
|
-
return [r, g, b];
|
|
99
|
-
}
|
|
100
|
-
case 'hsl': {
|
|
101
|
-
const inputHsl = rgbToHsl(inputColor);
|
|
102
|
-
const targetHsl = rgbToHsl(targetColor);
|
|
103
|
-
const h = lerp(value, inputHsl[0], targetHsl[0]);
|
|
104
|
-
const s = lerp(value, inputHsl[1], targetHsl[1]);
|
|
105
|
-
const l = lerp(value, inputHsl[2], targetHsl[2]);
|
|
106
|
-
return hslToRgb([h, s, l]);
|
|
107
|
-
}
|
|
108
|
-
case 'hsb': {
|
|
109
|
-
const inputHsb = rgbToHsb(inputColor);
|
|
110
|
-
const targetHsb = rgbToHsb(targetColor);
|
|
111
|
-
const h = lerp(value, inputHsb[0], targetHsb[0]);
|
|
112
|
-
const s = lerp(value, inputHsb[1], targetHsb[1]);
|
|
113
|
-
const b = lerp(value, inputHsb[2], targetHsb[2]);
|
|
114
|
-
return hsbToRgb([h, s, b]);
|
|
115
|
-
}
|
|
116
|
-
case 'hcl':
|
|
117
|
-
const inputHcl = rgbToHcl(inputColor);
|
|
118
|
-
const targetHcl = rgbToHcl(targetColor);
|
|
119
|
-
const powerValue = Math.pow(value, settings.powerStrength ?? 1);
|
|
120
|
-
|
|
121
|
-
const h1 = inputHcl[0];
|
|
122
|
-
const c1 = inputHcl[1];
|
|
123
|
-
const l1 = inputHcl[2];
|
|
124
|
-
const h2 = targetHcl[0] + (settings.hueOffset ?? 0);
|
|
125
|
-
const c2 = targetHcl[1] + (settings.chromaOffset ?? 0);
|
|
126
|
-
const l2 = targetHcl[2] + (settings.luminanceOffset ?? 0);
|
|
127
|
-
|
|
128
|
-
let h, c, l;
|
|
129
|
-
|
|
130
|
-
// HCL color palettes
|
|
131
|
-
// -> https://colorspace.r-forge.r-project.org/articles/hcl_palettes.html
|
|
132
|
-
if (settings.mode === 'qualitative') {
|
|
133
|
-
/**
|
|
134
|
-
* Qualitative
|
|
135
|
-
* Designed for coding categorical information,
|
|
136
|
-
* where no particular ordering of categories is available
|
|
137
|
-
* and every color should receive the same perceptual weight.
|
|
138
|
-
*
|
|
139
|
-
* - Hue: Linear
|
|
140
|
-
* - Chroma: Constant
|
|
141
|
-
* - Luminance: Constant
|
|
142
|
-
*/
|
|
143
|
-
h = lerp(value, h1, h2);
|
|
144
|
-
c = c1;
|
|
145
|
-
l = l1;
|
|
146
|
-
} else if (settings.mode === 'sequential') {
|
|
147
|
-
/**
|
|
148
|
-
* Sequential
|
|
149
|
-
* Designed for coding ordered/numeric information,
|
|
150
|
-
* going from high to low (or vice versa).
|
|
151
|
-
*
|
|
152
|
-
* - Hue: Constant | Linear
|
|
153
|
-
* - Chroma: Linear (+power) | Triangular (+power)
|
|
154
|
-
* - Luminance: Linear (+power)
|
|
155
|
-
*/
|
|
156
|
-
h = lerp(value, h1, h2);
|
|
157
|
-
c = settings.triangular ? triLerp(powerValue, c1, c2, settings.triangular) : lerp(powerValue, c1, c2);
|
|
158
|
-
l = lerp(powerValue, l1, l2);
|
|
159
|
-
} else if (settings.mode === 'diverging') {
|
|
160
|
-
/**
|
|
161
|
-
* Diverging
|
|
162
|
-
* Designed for coding ordered/numeric information around a central neutral value,
|
|
163
|
-
* where colors diverge from neutral to two extremes.
|
|
164
|
-
*
|
|
165
|
-
* - Hue: Constants (x2)
|
|
166
|
-
* - Chroma: Linear (+power) | Triangular (+power)
|
|
167
|
-
* - Luminance: Linear (+power)
|
|
168
|
-
*/
|
|
169
|
-
h = value < 0.5 ? h1 : value > 0.5 ? h2 : lerp(0.5, h1, h2);
|
|
170
|
-
c = settings.triangular ? triLerp(powerValue, c1, c2, settings.triangular) : lerp(powerValue, c1, c2);
|
|
171
|
-
l = lerp(powerValue, l1, l2);
|
|
172
|
-
} else {
|
|
173
|
-
h = lerp(value, h1, h2);
|
|
174
|
-
c = lerp(value, c1, c2);
|
|
175
|
-
l = lerp(value, l1, l2);
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return hclToRgb([h, c, l]);
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { now } from '../functions';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Utility class for controlling FPS calls
|
|
5
|
-
*
|
|
6
|
-
* @exports
|
|
7
|
-
* @class FrameRate
|
|
8
|
-
*/
|
|
9
|
-
export default class FrameRate {
|
|
10
|
-
private _fps: number;
|
|
11
|
-
private interval = 0;
|
|
12
|
-
private time = 0;
|
|
13
|
-
private elapsedTime = 0;
|
|
14
|
-
private lastUpdate = 0;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @param {number} [fps=30] Frame per second limit
|
|
18
|
-
*/
|
|
19
|
-
constructor(fps: number = 30) {
|
|
20
|
-
this._fps = fps;
|
|
21
|
-
this.fps = fps;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Return true if elapsed time since last update is higher than current FPS
|
|
26
|
-
*
|
|
27
|
-
* @returns {boolean}
|
|
28
|
-
*/
|
|
29
|
-
update(): boolean {
|
|
30
|
-
this.time = now();
|
|
31
|
-
this.elapsedTime = this.time - this.lastUpdate;
|
|
32
|
-
|
|
33
|
-
if (this.elapsedTime < this.interval) {
|
|
34
|
-
return false;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
this.lastUpdate = this.time - (this.elapsedTime % this.interval);
|
|
38
|
-
return true;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
get fps(): number {
|
|
42
|
-
return this._fps;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
set fps(fps: number) {
|
|
46
|
-
this._fps = fps;
|
|
47
|
-
this.interval = 1000 / fps;
|
|
48
|
-
}
|
|
49
|
-
}
|