@mkbabb/value.js 0.1.0 → 0.2.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/README.md +33 -0
- package/dist/value.cjs +8 -0
- package/dist/value.d.ts +1753 -0
- package/dist/value.js +3781 -0
- package/package.json +51 -40
- package/dist/index.cjs +0 -13792
- package/dist/index.cjs.map +0 -1
- package/dist/index.js +0 -13791
- package/dist/index.js.map +0 -1
package/dist/value.d.ts
ADDED
|
@@ -0,0 +1,1753 @@
|
|
|
1
|
+
import { Parser } from '@mkbabb/parse-that';
|
|
2
|
+
|
|
3
|
+
export declare const ABSOLUTE_LENGTH_UNITS: readonly ["px", "cm", "mm", "Q", "in", "pc", "pt"];
|
|
4
|
+
|
|
5
|
+
export declare function adobeRgb2xyz({ r, g, b, alpha }: AdobeRGBColor): XYZColor;
|
|
6
|
+
|
|
7
|
+
export declare class AdobeRGBColor<T = number> extends Color<T> {
|
|
8
|
+
constructor(r: T, g: T, b: T, alpha?: T);
|
|
9
|
+
get r(): T;
|
|
10
|
+
set r(value: T);
|
|
11
|
+
get g(): T;
|
|
12
|
+
set g(value: T);
|
|
13
|
+
get b(): T;
|
|
14
|
+
set b(value: T);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export declare function adobeRgbToLinear(c: number): number;
|
|
18
|
+
|
|
19
|
+
export declare const ALPHA_DENORM_UNIT = "%";
|
|
20
|
+
|
|
21
|
+
export declare const ALPHA_RANGE: {
|
|
22
|
+
readonly "%": {
|
|
23
|
+
readonly min: 0;
|
|
24
|
+
readonly max: 100;
|
|
25
|
+
};
|
|
26
|
+
readonly number: {
|
|
27
|
+
readonly min: 0;
|
|
28
|
+
readonly max: 1;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export declare const ANGLE_UNITS: readonly ["deg", "rad", "grad", "turn"];
|
|
33
|
+
|
|
34
|
+
export declare const arrayEquals: (a: any[], b: any[]) => boolean;
|
|
35
|
+
|
|
36
|
+
export declare const BLACKLISTED_COALESCE_UNITS: readonly ["string", "var", "calc"];
|
|
37
|
+
|
|
38
|
+
export declare function camelCaseToHyphen(str: string): string;
|
|
39
|
+
|
|
40
|
+
declare function cancelAnimationFrame_2(handle: number | undefined | null | any): void;
|
|
41
|
+
export { cancelAnimationFrame_2 as cancelAnimationFrame }
|
|
42
|
+
|
|
43
|
+
export declare function clamp(value: number, min: number, max: number): number;
|
|
44
|
+
|
|
45
|
+
export declare function clone(obj: any): any;
|
|
46
|
+
|
|
47
|
+
export declare abstract class Color<T = number> {
|
|
48
|
+
readonly colorSpace: ColorSpace;
|
|
49
|
+
alpha: T;
|
|
50
|
+
[key: string]: any;
|
|
51
|
+
protected components: Map<string, T>;
|
|
52
|
+
constructor(colorSpace: ColorSpace, alpha?: T);
|
|
53
|
+
toString(): string;
|
|
54
|
+
toFormattedString(digits?: number): string;
|
|
55
|
+
valueOf(): T[];
|
|
56
|
+
toJSON(): Record<string, T>;
|
|
57
|
+
clone(): this;
|
|
58
|
+
keys(): string[];
|
|
59
|
+
values(): T[];
|
|
60
|
+
entries(): [string, T][];
|
|
61
|
+
protected getComponent(key: string): T | undefined;
|
|
62
|
+
protected setComponent(key: string, value: T): void;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export declare function color2<T, C extends ColorSpace>(color: Color<T>, to: C): Color<T>;
|
|
66
|
+
|
|
67
|
+
export declare const COLOR_NAMES: {
|
|
68
|
+
readonly aliceblue: "#f0f8ff";
|
|
69
|
+
readonly antiquewhite: "#faebd7";
|
|
70
|
+
readonly aqua: "#00ffff";
|
|
71
|
+
readonly aquamarine: "#7fffd4";
|
|
72
|
+
readonly azure: "#f0ffff";
|
|
73
|
+
readonly beige: "#f5f5dc";
|
|
74
|
+
readonly bisque: "#ffe4c4";
|
|
75
|
+
readonly black: "#000000";
|
|
76
|
+
readonly blanchedalmond: "#ffebcd";
|
|
77
|
+
readonly blue: "#0000ff";
|
|
78
|
+
readonly blueviolet: "#8a2be2";
|
|
79
|
+
readonly brown: "#a52a2a";
|
|
80
|
+
readonly burlywood: "#deb887";
|
|
81
|
+
readonly cadetblue: "#5f9ea0";
|
|
82
|
+
readonly chartreuse: "#7fff00";
|
|
83
|
+
readonly chocolate: "#d2691e";
|
|
84
|
+
readonly coral: "#ff7f50";
|
|
85
|
+
readonly cornflowerblue: "#6495ed";
|
|
86
|
+
readonly cornsilk: "#fff8dc";
|
|
87
|
+
readonly crimson: "#dc143c";
|
|
88
|
+
readonly cyan: "#00ffff";
|
|
89
|
+
readonly darkblue: "#00008b";
|
|
90
|
+
readonly darkcyan: "#008b8b";
|
|
91
|
+
readonly darkgoldenrod: "#b8860b";
|
|
92
|
+
readonly darkgray: "#a9a9a9";
|
|
93
|
+
readonly darkgreen: "#006400";
|
|
94
|
+
readonly darkgrey: "#a9a9a9";
|
|
95
|
+
readonly darkkhaki: "#bdb76b";
|
|
96
|
+
readonly darkmagenta: "#8b008b";
|
|
97
|
+
readonly darkolivegreen: "#556b2f";
|
|
98
|
+
readonly darkorange: "#ff8c00";
|
|
99
|
+
readonly darkorchid: "#9932cc";
|
|
100
|
+
readonly darkred: "#8b0000";
|
|
101
|
+
readonly darksalmon: "#e9967a";
|
|
102
|
+
readonly darkseagreen: "#8fbc8f";
|
|
103
|
+
readonly darkslateblue: "#483d8b";
|
|
104
|
+
readonly darkslategray: "#2f4f4f";
|
|
105
|
+
readonly darkslategrey: "#2f4f4f";
|
|
106
|
+
readonly darkturquoise: "#00ced1";
|
|
107
|
+
readonly darkviolet: "#9400d3";
|
|
108
|
+
readonly deeppink: "#ff1493";
|
|
109
|
+
readonly deepskyblue: "#00bfff";
|
|
110
|
+
readonly dimgray: "#696969";
|
|
111
|
+
readonly dimgrey: "#696969";
|
|
112
|
+
readonly dodgerblue: "#1e90ff";
|
|
113
|
+
readonly firebrick: "#b22222";
|
|
114
|
+
readonly floralwhite: "#fffaf0";
|
|
115
|
+
readonly forestgreen: "#228b22";
|
|
116
|
+
readonly fuchsia: "#ff00ff";
|
|
117
|
+
readonly gainsboro: "#dcdcdc";
|
|
118
|
+
readonly ghostwhite: "#f8f8ff";
|
|
119
|
+
readonly gold: "#ffd700";
|
|
120
|
+
readonly goldenrod: "#daa520";
|
|
121
|
+
readonly gray: "#808080";
|
|
122
|
+
readonly green: "#008000";
|
|
123
|
+
readonly greenyellow: "#adff2f";
|
|
124
|
+
readonly grey: "#808080";
|
|
125
|
+
readonly honeydew: "#f0fff0";
|
|
126
|
+
readonly hotpink: "#ff69b4";
|
|
127
|
+
readonly indianred: "#cd5c5c";
|
|
128
|
+
readonly indigo: "#4b0082";
|
|
129
|
+
readonly ivory: "#fffff0";
|
|
130
|
+
readonly khaki: "#f0e68c";
|
|
131
|
+
readonly lavender: "#e6e6fa";
|
|
132
|
+
readonly lavenderblush: "#fff0f5";
|
|
133
|
+
readonly lawngreen: "#7cfc00";
|
|
134
|
+
readonly lemonchiffon: "#fffacd";
|
|
135
|
+
readonly lightblue: "#add8e6";
|
|
136
|
+
readonly lightcoral: "#f08080";
|
|
137
|
+
readonly lightcyan: "#e0ffff";
|
|
138
|
+
readonly lightgoldenrodyellow: "#fafad2";
|
|
139
|
+
readonly lightgray: "#d3d3d3";
|
|
140
|
+
readonly lightgreen: "#90ee90";
|
|
141
|
+
readonly lightgrey: "#d3d3d3";
|
|
142
|
+
readonly lightpink: "#ffb6c1";
|
|
143
|
+
readonly lightsalmon: "#ffa07a";
|
|
144
|
+
readonly lightseagreen: "#20b2aa";
|
|
145
|
+
readonly lightskyblue: "#87cefa";
|
|
146
|
+
readonly lightslategray: "#778899";
|
|
147
|
+
readonly lightslategrey: "#778899";
|
|
148
|
+
readonly lightsteelblue: "#b0c4de";
|
|
149
|
+
readonly lightyellow: "#ffffe0";
|
|
150
|
+
readonly lime: "#00ff00";
|
|
151
|
+
readonly limegreen: "#32cd32";
|
|
152
|
+
readonly linen: "#faf0e6";
|
|
153
|
+
readonly magenta: "#ff00ff";
|
|
154
|
+
readonly maroon: "#800000";
|
|
155
|
+
readonly mediumaquamarine: "#66cdaa";
|
|
156
|
+
readonly mediumblue: "#0000cd";
|
|
157
|
+
readonly mediumorchid: "#ba55d3";
|
|
158
|
+
readonly mediumpurple: "#9370db";
|
|
159
|
+
readonly mediumseagreen: "#3cb371";
|
|
160
|
+
readonly mediumslateblue: "#7b68ee";
|
|
161
|
+
readonly mediumspringgreen: "#00fa9a";
|
|
162
|
+
readonly mediumturquoise: "#48d1cc";
|
|
163
|
+
readonly mediumvioletred: "#c71585";
|
|
164
|
+
readonly midnightblue: "#191970";
|
|
165
|
+
readonly mintcream: "#f5fffa";
|
|
166
|
+
readonly mistyrose: "#ffe4e1";
|
|
167
|
+
readonly moccasin: "#ffe4b5";
|
|
168
|
+
readonly navajowhite: "#ffdead";
|
|
169
|
+
readonly navy: "#000080";
|
|
170
|
+
readonly oldlace: "#fdf5e6";
|
|
171
|
+
readonly olive: "#808000";
|
|
172
|
+
readonly olivedrab: "#6b8e23";
|
|
173
|
+
readonly orange: "#ffa500";
|
|
174
|
+
readonly orangered: "#ff4500";
|
|
175
|
+
readonly orchid: "#da70d6";
|
|
176
|
+
readonly palegoldenrod: "#eee8aa";
|
|
177
|
+
readonly palegreen: "#98fb98";
|
|
178
|
+
readonly paleturquoise: "#afeeee";
|
|
179
|
+
readonly palevioletred: "#db7093";
|
|
180
|
+
readonly papayawhip: "#ffefd5";
|
|
181
|
+
readonly peachpuff: "#ffdab9";
|
|
182
|
+
readonly peru: "#cd853f";
|
|
183
|
+
readonly pink: "#ffc0cb";
|
|
184
|
+
readonly plum: "#dda0dd";
|
|
185
|
+
readonly powderblue: "#b0e0e6";
|
|
186
|
+
readonly purple: "#800080";
|
|
187
|
+
readonly rebeccapurple: "#663399";
|
|
188
|
+
readonly red: "#ff0000";
|
|
189
|
+
readonly rosybrown: "#bc8f8f";
|
|
190
|
+
readonly royalblue: "#4169e1";
|
|
191
|
+
readonly saddlebrown: "#8b4513";
|
|
192
|
+
readonly salmon: "#fa8072";
|
|
193
|
+
readonly sandybrown: "#f4a460";
|
|
194
|
+
readonly seagreen: "#2e8b57";
|
|
195
|
+
readonly seashell: "#fff5ee";
|
|
196
|
+
readonly sienna: "#a0522d";
|
|
197
|
+
readonly silver: "#c0c0c0";
|
|
198
|
+
readonly skyblue: "#87ceeb";
|
|
199
|
+
readonly slateblue: "#6a5acd";
|
|
200
|
+
readonly slategray: "#708090";
|
|
201
|
+
readonly slategrey: "#708090";
|
|
202
|
+
readonly snow: "#fffafa";
|
|
203
|
+
readonly springgreen: "#00ff7f";
|
|
204
|
+
readonly steelblue: "#4682b4";
|
|
205
|
+
readonly tan: "#d2b48c";
|
|
206
|
+
readonly teal: "#008080";
|
|
207
|
+
readonly thistle: "#d8bfd8";
|
|
208
|
+
readonly tomato: "#ff6347";
|
|
209
|
+
readonly turquoise: "#40e0d0";
|
|
210
|
+
readonly violet: "#ee82ee";
|
|
211
|
+
readonly wheat: "#f5deb3";
|
|
212
|
+
readonly white: "#ffffff";
|
|
213
|
+
readonly whitesmoke: "#f5f5f5";
|
|
214
|
+
readonly yellow: "#ffff00";
|
|
215
|
+
readonly yellowgreen: "#9acd32";
|
|
216
|
+
readonly padaleckipink: "oklch(100% 0.42 360deg / 71.70%)";
|
|
217
|
+
readonly "lodge-blu-color": "rgb(53\t101\t144)";
|
|
218
|
+
readonly lavendi: "oklch(79.90% 0.11 318.24deg / 100%)";
|
|
219
|
+
readonly shadyshroom: "oklch(53% 0.07 21.60deg / 100%)";
|
|
220
|
+
readonly patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)";
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
export declare const COLOR_SPACE_DENORM_UNITS: {
|
|
224
|
+
readonly rgb: {
|
|
225
|
+
readonly r: "";
|
|
226
|
+
readonly g: "";
|
|
227
|
+
readonly b: "";
|
|
228
|
+
readonly alpha: "%";
|
|
229
|
+
};
|
|
230
|
+
readonly hsl: {
|
|
231
|
+
readonly h: "deg";
|
|
232
|
+
readonly s: "%";
|
|
233
|
+
readonly l: "%";
|
|
234
|
+
readonly alpha: "%";
|
|
235
|
+
};
|
|
236
|
+
readonly hsv: {
|
|
237
|
+
readonly h: "deg";
|
|
238
|
+
readonly s: "%";
|
|
239
|
+
readonly v: "%";
|
|
240
|
+
readonly alpha: "%";
|
|
241
|
+
};
|
|
242
|
+
readonly hwb: {
|
|
243
|
+
readonly h: "deg";
|
|
244
|
+
readonly w: "%";
|
|
245
|
+
readonly b: "%";
|
|
246
|
+
readonly alpha: "%";
|
|
247
|
+
};
|
|
248
|
+
readonly lab: {
|
|
249
|
+
readonly l: "%";
|
|
250
|
+
readonly a: "";
|
|
251
|
+
readonly b: "";
|
|
252
|
+
readonly alpha: "%";
|
|
253
|
+
};
|
|
254
|
+
readonly lch: {
|
|
255
|
+
readonly l: "%";
|
|
256
|
+
readonly c: "";
|
|
257
|
+
readonly h: "deg";
|
|
258
|
+
readonly alpha: "%";
|
|
259
|
+
};
|
|
260
|
+
readonly oklab: {
|
|
261
|
+
readonly l: "%";
|
|
262
|
+
readonly a: "";
|
|
263
|
+
readonly b: "";
|
|
264
|
+
readonly alpha: "%";
|
|
265
|
+
};
|
|
266
|
+
readonly oklch: {
|
|
267
|
+
readonly l: "%";
|
|
268
|
+
readonly c: "";
|
|
269
|
+
readonly h: "deg";
|
|
270
|
+
readonly alpha: "%";
|
|
271
|
+
};
|
|
272
|
+
readonly xyz: {
|
|
273
|
+
readonly x: "%";
|
|
274
|
+
readonly y: "%";
|
|
275
|
+
readonly z: "%";
|
|
276
|
+
readonly alpha: "%";
|
|
277
|
+
};
|
|
278
|
+
readonly kelvin: {
|
|
279
|
+
readonly kelvin: "K";
|
|
280
|
+
readonly alpha: "%";
|
|
281
|
+
};
|
|
282
|
+
readonly "srgb-linear": {
|
|
283
|
+
readonly r: "";
|
|
284
|
+
readonly g: "";
|
|
285
|
+
readonly b: "";
|
|
286
|
+
readonly alpha: "%";
|
|
287
|
+
};
|
|
288
|
+
readonly "display-p3": {
|
|
289
|
+
readonly r: "";
|
|
290
|
+
readonly g: "";
|
|
291
|
+
readonly b: "";
|
|
292
|
+
readonly alpha: "%";
|
|
293
|
+
};
|
|
294
|
+
readonly "a98-rgb": {
|
|
295
|
+
readonly r: "";
|
|
296
|
+
readonly g: "";
|
|
297
|
+
readonly b: "";
|
|
298
|
+
readonly alpha: "%";
|
|
299
|
+
};
|
|
300
|
+
readonly "prophoto-rgb": {
|
|
301
|
+
readonly r: "";
|
|
302
|
+
readonly g: "";
|
|
303
|
+
readonly b: "";
|
|
304
|
+
readonly alpha: "%";
|
|
305
|
+
};
|
|
306
|
+
readonly rec2020: {
|
|
307
|
+
readonly r: "";
|
|
308
|
+
readonly g: "";
|
|
309
|
+
readonly b: "";
|
|
310
|
+
readonly alpha: "%";
|
|
311
|
+
};
|
|
312
|
+
};
|
|
313
|
+
|
|
314
|
+
export declare const COLOR_SPACE_NAMES: {
|
|
315
|
+
readonly rgb: "RGB";
|
|
316
|
+
readonly hsl: "HSL";
|
|
317
|
+
readonly hsv: "HSV";
|
|
318
|
+
readonly hwb: "HWB";
|
|
319
|
+
readonly lab: "Lab";
|
|
320
|
+
readonly lch: "LCh";
|
|
321
|
+
readonly oklab: "OKLab";
|
|
322
|
+
readonly oklch: "OKLCh";
|
|
323
|
+
readonly xyz: "XYZ";
|
|
324
|
+
readonly kelvin: "Kelvin";
|
|
325
|
+
readonly "srgb-linear": "sRGB Linear";
|
|
326
|
+
readonly "display-p3": "Display P3";
|
|
327
|
+
readonly "a98-rgb": "Adobe RGB";
|
|
328
|
+
readonly "prophoto-rgb": "ProPhoto RGB";
|
|
329
|
+
readonly rec2020: "Rec. 2020";
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
export declare const COLOR_SPACE_RANGES: {
|
|
333
|
+
readonly rgb: {
|
|
334
|
+
readonly r: {
|
|
335
|
+
readonly "%": {
|
|
336
|
+
readonly min: 0;
|
|
337
|
+
readonly max: 100;
|
|
338
|
+
};
|
|
339
|
+
readonly number: {
|
|
340
|
+
readonly min: 0;
|
|
341
|
+
readonly max: 255;
|
|
342
|
+
};
|
|
343
|
+
};
|
|
344
|
+
readonly g: {
|
|
345
|
+
readonly "%": {
|
|
346
|
+
readonly min: 0;
|
|
347
|
+
readonly max: 100;
|
|
348
|
+
};
|
|
349
|
+
readonly number: {
|
|
350
|
+
readonly min: 0;
|
|
351
|
+
readonly max: 255;
|
|
352
|
+
};
|
|
353
|
+
};
|
|
354
|
+
readonly b: {
|
|
355
|
+
readonly "%": {
|
|
356
|
+
readonly min: 0;
|
|
357
|
+
readonly max: 100;
|
|
358
|
+
};
|
|
359
|
+
readonly number: {
|
|
360
|
+
readonly min: 0;
|
|
361
|
+
readonly max: 255;
|
|
362
|
+
};
|
|
363
|
+
};
|
|
364
|
+
readonly alpha: {
|
|
365
|
+
readonly "%": {
|
|
366
|
+
readonly min: 0;
|
|
367
|
+
readonly max: 100;
|
|
368
|
+
};
|
|
369
|
+
readonly number: {
|
|
370
|
+
readonly min: 0;
|
|
371
|
+
readonly max: 1;
|
|
372
|
+
};
|
|
373
|
+
};
|
|
374
|
+
};
|
|
375
|
+
readonly hsl: {
|
|
376
|
+
readonly h: {
|
|
377
|
+
readonly deg: {
|
|
378
|
+
readonly min: 0;
|
|
379
|
+
readonly max: 360;
|
|
380
|
+
};
|
|
381
|
+
readonly number: {
|
|
382
|
+
readonly min: 0;
|
|
383
|
+
readonly max: 360;
|
|
384
|
+
};
|
|
385
|
+
readonly "%": {
|
|
386
|
+
readonly min: 0;
|
|
387
|
+
readonly max: 100;
|
|
388
|
+
};
|
|
389
|
+
};
|
|
390
|
+
readonly s: {
|
|
391
|
+
readonly "%": {
|
|
392
|
+
readonly min: 0;
|
|
393
|
+
readonly max: 100;
|
|
394
|
+
};
|
|
395
|
+
readonly number: {
|
|
396
|
+
readonly min: 0;
|
|
397
|
+
readonly max: 1;
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
readonly l: {
|
|
401
|
+
readonly "%": {
|
|
402
|
+
readonly min: 0;
|
|
403
|
+
readonly max: 100;
|
|
404
|
+
};
|
|
405
|
+
readonly number: {
|
|
406
|
+
readonly min: 0;
|
|
407
|
+
readonly max: 1;
|
|
408
|
+
};
|
|
409
|
+
};
|
|
410
|
+
readonly alpha: {
|
|
411
|
+
readonly "%": {
|
|
412
|
+
readonly min: 0;
|
|
413
|
+
readonly max: 100;
|
|
414
|
+
};
|
|
415
|
+
readonly number: {
|
|
416
|
+
readonly min: 0;
|
|
417
|
+
readonly max: 1;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
};
|
|
421
|
+
readonly hsv: {
|
|
422
|
+
readonly h: {
|
|
423
|
+
readonly deg: {
|
|
424
|
+
readonly min: 0;
|
|
425
|
+
readonly max: 360;
|
|
426
|
+
};
|
|
427
|
+
readonly number: {
|
|
428
|
+
readonly min: 0;
|
|
429
|
+
readonly max: 360;
|
|
430
|
+
};
|
|
431
|
+
readonly "%": {
|
|
432
|
+
readonly min: 0;
|
|
433
|
+
readonly max: 100;
|
|
434
|
+
};
|
|
435
|
+
};
|
|
436
|
+
readonly s: {
|
|
437
|
+
readonly "%": {
|
|
438
|
+
readonly min: 0;
|
|
439
|
+
readonly max: 100;
|
|
440
|
+
};
|
|
441
|
+
readonly number: {
|
|
442
|
+
readonly min: 0;
|
|
443
|
+
readonly max: 1;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
readonly v: {
|
|
447
|
+
readonly "%": {
|
|
448
|
+
readonly min: 0;
|
|
449
|
+
readonly max: 100;
|
|
450
|
+
};
|
|
451
|
+
readonly number: {
|
|
452
|
+
readonly min: 0;
|
|
453
|
+
readonly max: 1;
|
|
454
|
+
};
|
|
455
|
+
};
|
|
456
|
+
readonly alpha: {
|
|
457
|
+
readonly "%": {
|
|
458
|
+
readonly min: 0;
|
|
459
|
+
readonly max: 100;
|
|
460
|
+
};
|
|
461
|
+
readonly number: {
|
|
462
|
+
readonly min: 0;
|
|
463
|
+
readonly max: 1;
|
|
464
|
+
};
|
|
465
|
+
};
|
|
466
|
+
};
|
|
467
|
+
readonly hwb: {
|
|
468
|
+
readonly h: {
|
|
469
|
+
readonly deg: {
|
|
470
|
+
readonly min: 0;
|
|
471
|
+
readonly max: 360;
|
|
472
|
+
};
|
|
473
|
+
readonly number: {
|
|
474
|
+
readonly min: 0;
|
|
475
|
+
readonly max: 360;
|
|
476
|
+
};
|
|
477
|
+
readonly "%": {
|
|
478
|
+
readonly min: 0;
|
|
479
|
+
readonly max: 100;
|
|
480
|
+
};
|
|
481
|
+
};
|
|
482
|
+
readonly w: {
|
|
483
|
+
readonly "%": {
|
|
484
|
+
readonly min: 0;
|
|
485
|
+
readonly max: 100;
|
|
486
|
+
};
|
|
487
|
+
readonly number: {
|
|
488
|
+
readonly min: 0;
|
|
489
|
+
readonly max: 1;
|
|
490
|
+
};
|
|
491
|
+
};
|
|
492
|
+
readonly b: {
|
|
493
|
+
readonly "%": {
|
|
494
|
+
readonly min: 0;
|
|
495
|
+
readonly max: 100;
|
|
496
|
+
};
|
|
497
|
+
readonly number: {
|
|
498
|
+
readonly min: 0;
|
|
499
|
+
readonly max: 1;
|
|
500
|
+
};
|
|
501
|
+
};
|
|
502
|
+
readonly alpha: {
|
|
503
|
+
readonly "%": {
|
|
504
|
+
readonly min: 0;
|
|
505
|
+
readonly max: 100;
|
|
506
|
+
};
|
|
507
|
+
readonly number: {
|
|
508
|
+
readonly min: 0;
|
|
509
|
+
readonly max: 1;
|
|
510
|
+
};
|
|
511
|
+
};
|
|
512
|
+
};
|
|
513
|
+
readonly lab: {
|
|
514
|
+
readonly l: {
|
|
515
|
+
readonly "%": {
|
|
516
|
+
readonly min: 0;
|
|
517
|
+
readonly max: 100;
|
|
518
|
+
};
|
|
519
|
+
readonly number: {
|
|
520
|
+
readonly min: 0;
|
|
521
|
+
readonly max: 100;
|
|
522
|
+
};
|
|
523
|
+
};
|
|
524
|
+
readonly a: {
|
|
525
|
+
readonly number: {
|
|
526
|
+
readonly min: -125;
|
|
527
|
+
readonly max: 125;
|
|
528
|
+
};
|
|
529
|
+
readonly "%": {
|
|
530
|
+
readonly min: -100;
|
|
531
|
+
readonly max: 100;
|
|
532
|
+
};
|
|
533
|
+
};
|
|
534
|
+
readonly b: {
|
|
535
|
+
readonly number: {
|
|
536
|
+
readonly min: -125;
|
|
537
|
+
readonly max: 125;
|
|
538
|
+
};
|
|
539
|
+
readonly "%": {
|
|
540
|
+
readonly min: -100;
|
|
541
|
+
readonly max: 100;
|
|
542
|
+
};
|
|
543
|
+
};
|
|
544
|
+
readonly alpha: {
|
|
545
|
+
readonly "%": {
|
|
546
|
+
readonly min: 0;
|
|
547
|
+
readonly max: 100;
|
|
548
|
+
};
|
|
549
|
+
readonly number: {
|
|
550
|
+
readonly min: 0;
|
|
551
|
+
readonly max: 1;
|
|
552
|
+
};
|
|
553
|
+
};
|
|
554
|
+
};
|
|
555
|
+
readonly lch: {
|
|
556
|
+
readonly l: {
|
|
557
|
+
readonly "%": {
|
|
558
|
+
readonly min: 0;
|
|
559
|
+
readonly max: 100;
|
|
560
|
+
};
|
|
561
|
+
readonly number: {
|
|
562
|
+
readonly min: 0;
|
|
563
|
+
readonly max: 100;
|
|
564
|
+
};
|
|
565
|
+
};
|
|
566
|
+
readonly c: {
|
|
567
|
+
readonly number: {
|
|
568
|
+
readonly min: 0;
|
|
569
|
+
readonly max: 150;
|
|
570
|
+
};
|
|
571
|
+
readonly "%": {
|
|
572
|
+
readonly min: 0;
|
|
573
|
+
readonly max: 100;
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
readonly h: {
|
|
577
|
+
readonly deg: {
|
|
578
|
+
readonly min: 0;
|
|
579
|
+
readonly max: 360;
|
|
580
|
+
};
|
|
581
|
+
readonly number: {
|
|
582
|
+
readonly min: 0;
|
|
583
|
+
readonly max: 360;
|
|
584
|
+
};
|
|
585
|
+
readonly "%": {
|
|
586
|
+
readonly min: 0;
|
|
587
|
+
readonly max: 100;
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
readonly alpha: {
|
|
591
|
+
readonly "%": {
|
|
592
|
+
readonly min: 0;
|
|
593
|
+
readonly max: 100;
|
|
594
|
+
};
|
|
595
|
+
readonly number: {
|
|
596
|
+
readonly min: 0;
|
|
597
|
+
readonly max: 1;
|
|
598
|
+
};
|
|
599
|
+
};
|
|
600
|
+
};
|
|
601
|
+
readonly oklab: {
|
|
602
|
+
readonly l: {
|
|
603
|
+
readonly "%": {
|
|
604
|
+
readonly min: 0;
|
|
605
|
+
readonly max: 100;
|
|
606
|
+
};
|
|
607
|
+
readonly number: {
|
|
608
|
+
readonly min: 0;
|
|
609
|
+
readonly max: 100;
|
|
610
|
+
};
|
|
611
|
+
};
|
|
612
|
+
readonly a: {
|
|
613
|
+
readonly number: {
|
|
614
|
+
readonly min: -0.4;
|
|
615
|
+
readonly max: 0.4;
|
|
616
|
+
};
|
|
617
|
+
readonly "%": {
|
|
618
|
+
readonly min: -100;
|
|
619
|
+
readonly max: 100;
|
|
620
|
+
};
|
|
621
|
+
};
|
|
622
|
+
readonly b: {
|
|
623
|
+
readonly number: {
|
|
624
|
+
readonly min: -0.4;
|
|
625
|
+
readonly max: 0.4;
|
|
626
|
+
};
|
|
627
|
+
readonly "%": {
|
|
628
|
+
readonly min: -100;
|
|
629
|
+
readonly max: 100;
|
|
630
|
+
};
|
|
631
|
+
};
|
|
632
|
+
readonly alpha: {
|
|
633
|
+
readonly "%": {
|
|
634
|
+
readonly min: 0;
|
|
635
|
+
readonly max: 100;
|
|
636
|
+
};
|
|
637
|
+
readonly number: {
|
|
638
|
+
readonly min: 0;
|
|
639
|
+
readonly max: 1;
|
|
640
|
+
};
|
|
641
|
+
};
|
|
642
|
+
};
|
|
643
|
+
readonly oklch: {
|
|
644
|
+
readonly l: {
|
|
645
|
+
readonly "%": {
|
|
646
|
+
readonly min: 0;
|
|
647
|
+
readonly max: 100;
|
|
648
|
+
};
|
|
649
|
+
readonly number: {
|
|
650
|
+
readonly min: 0;
|
|
651
|
+
readonly max: 100;
|
|
652
|
+
};
|
|
653
|
+
};
|
|
654
|
+
readonly c: {
|
|
655
|
+
readonly number: {
|
|
656
|
+
readonly min: 0;
|
|
657
|
+
readonly max: 0.5;
|
|
658
|
+
};
|
|
659
|
+
readonly "%": {
|
|
660
|
+
readonly min: 0;
|
|
661
|
+
readonly max: 100;
|
|
662
|
+
};
|
|
663
|
+
};
|
|
664
|
+
readonly h: {
|
|
665
|
+
readonly deg: {
|
|
666
|
+
readonly min: 0;
|
|
667
|
+
readonly max: 360;
|
|
668
|
+
};
|
|
669
|
+
readonly number: {
|
|
670
|
+
readonly min: 0;
|
|
671
|
+
readonly max: 360;
|
|
672
|
+
};
|
|
673
|
+
readonly "%": {
|
|
674
|
+
readonly min: 0;
|
|
675
|
+
readonly max: 100;
|
|
676
|
+
};
|
|
677
|
+
};
|
|
678
|
+
readonly alpha: {
|
|
679
|
+
readonly "%": {
|
|
680
|
+
readonly min: 0;
|
|
681
|
+
readonly max: 100;
|
|
682
|
+
};
|
|
683
|
+
readonly number: {
|
|
684
|
+
readonly min: 0;
|
|
685
|
+
readonly max: 1;
|
|
686
|
+
};
|
|
687
|
+
};
|
|
688
|
+
};
|
|
689
|
+
readonly xyz: {
|
|
690
|
+
readonly x: {
|
|
691
|
+
readonly "%": {
|
|
692
|
+
readonly min: 0;
|
|
693
|
+
readonly max: 100;
|
|
694
|
+
};
|
|
695
|
+
readonly number: {
|
|
696
|
+
readonly min: 0;
|
|
697
|
+
readonly max: 1;
|
|
698
|
+
};
|
|
699
|
+
};
|
|
700
|
+
readonly y: {
|
|
701
|
+
readonly "%": {
|
|
702
|
+
readonly min: 0;
|
|
703
|
+
readonly max: 100;
|
|
704
|
+
};
|
|
705
|
+
readonly number: {
|
|
706
|
+
readonly min: 0;
|
|
707
|
+
readonly max: 1;
|
|
708
|
+
};
|
|
709
|
+
};
|
|
710
|
+
readonly z: {
|
|
711
|
+
readonly "%": {
|
|
712
|
+
readonly min: 0;
|
|
713
|
+
readonly max: 100;
|
|
714
|
+
};
|
|
715
|
+
readonly number: {
|
|
716
|
+
readonly min: 0;
|
|
717
|
+
readonly max: 1;
|
|
718
|
+
};
|
|
719
|
+
};
|
|
720
|
+
readonly alpha: {
|
|
721
|
+
readonly "%": {
|
|
722
|
+
readonly min: 0;
|
|
723
|
+
readonly max: 100;
|
|
724
|
+
};
|
|
725
|
+
readonly number: {
|
|
726
|
+
readonly min: 0;
|
|
727
|
+
readonly max: 1;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
};
|
|
731
|
+
readonly kelvin: {
|
|
732
|
+
readonly kelvin: {
|
|
733
|
+
readonly number: {
|
|
734
|
+
readonly min: 1000;
|
|
735
|
+
readonly max: 40000;
|
|
736
|
+
};
|
|
737
|
+
};
|
|
738
|
+
readonly alpha: {
|
|
739
|
+
readonly "%": {
|
|
740
|
+
readonly min: 0;
|
|
741
|
+
readonly max: 100;
|
|
742
|
+
};
|
|
743
|
+
readonly number: {
|
|
744
|
+
readonly min: 0;
|
|
745
|
+
readonly max: 1;
|
|
746
|
+
};
|
|
747
|
+
};
|
|
748
|
+
};
|
|
749
|
+
readonly "srgb-linear": {
|
|
750
|
+
readonly r: {
|
|
751
|
+
readonly "%": {
|
|
752
|
+
readonly min: 0;
|
|
753
|
+
readonly max: 100;
|
|
754
|
+
};
|
|
755
|
+
readonly number: {
|
|
756
|
+
readonly min: 0;
|
|
757
|
+
readonly max: 1;
|
|
758
|
+
};
|
|
759
|
+
};
|
|
760
|
+
readonly g: {
|
|
761
|
+
readonly "%": {
|
|
762
|
+
readonly min: 0;
|
|
763
|
+
readonly max: 100;
|
|
764
|
+
};
|
|
765
|
+
readonly number: {
|
|
766
|
+
readonly min: 0;
|
|
767
|
+
readonly max: 1;
|
|
768
|
+
};
|
|
769
|
+
};
|
|
770
|
+
readonly b: {
|
|
771
|
+
readonly "%": {
|
|
772
|
+
readonly min: 0;
|
|
773
|
+
readonly max: 100;
|
|
774
|
+
};
|
|
775
|
+
readonly number: {
|
|
776
|
+
readonly min: 0;
|
|
777
|
+
readonly max: 1;
|
|
778
|
+
};
|
|
779
|
+
};
|
|
780
|
+
readonly alpha: {
|
|
781
|
+
readonly "%": {
|
|
782
|
+
readonly min: 0;
|
|
783
|
+
readonly max: 100;
|
|
784
|
+
};
|
|
785
|
+
readonly number: {
|
|
786
|
+
readonly min: 0;
|
|
787
|
+
readonly max: 1;
|
|
788
|
+
};
|
|
789
|
+
};
|
|
790
|
+
};
|
|
791
|
+
readonly "display-p3": {
|
|
792
|
+
readonly r: {
|
|
793
|
+
readonly "%": {
|
|
794
|
+
readonly min: 0;
|
|
795
|
+
readonly max: 100;
|
|
796
|
+
};
|
|
797
|
+
readonly number: {
|
|
798
|
+
readonly min: 0;
|
|
799
|
+
readonly max: 1;
|
|
800
|
+
};
|
|
801
|
+
};
|
|
802
|
+
readonly g: {
|
|
803
|
+
readonly "%": {
|
|
804
|
+
readonly min: 0;
|
|
805
|
+
readonly max: 100;
|
|
806
|
+
};
|
|
807
|
+
readonly number: {
|
|
808
|
+
readonly min: 0;
|
|
809
|
+
readonly max: 1;
|
|
810
|
+
};
|
|
811
|
+
};
|
|
812
|
+
readonly b: {
|
|
813
|
+
readonly "%": {
|
|
814
|
+
readonly min: 0;
|
|
815
|
+
readonly max: 100;
|
|
816
|
+
};
|
|
817
|
+
readonly number: {
|
|
818
|
+
readonly min: 0;
|
|
819
|
+
readonly max: 1;
|
|
820
|
+
};
|
|
821
|
+
};
|
|
822
|
+
readonly alpha: {
|
|
823
|
+
readonly "%": {
|
|
824
|
+
readonly min: 0;
|
|
825
|
+
readonly max: 100;
|
|
826
|
+
};
|
|
827
|
+
readonly number: {
|
|
828
|
+
readonly min: 0;
|
|
829
|
+
readonly max: 1;
|
|
830
|
+
};
|
|
831
|
+
};
|
|
832
|
+
};
|
|
833
|
+
readonly "a98-rgb": {
|
|
834
|
+
readonly r: {
|
|
835
|
+
readonly "%": {
|
|
836
|
+
readonly min: 0;
|
|
837
|
+
readonly max: 100;
|
|
838
|
+
};
|
|
839
|
+
readonly number: {
|
|
840
|
+
readonly min: 0;
|
|
841
|
+
readonly max: 1;
|
|
842
|
+
};
|
|
843
|
+
};
|
|
844
|
+
readonly g: {
|
|
845
|
+
readonly "%": {
|
|
846
|
+
readonly min: 0;
|
|
847
|
+
readonly max: 100;
|
|
848
|
+
};
|
|
849
|
+
readonly number: {
|
|
850
|
+
readonly min: 0;
|
|
851
|
+
readonly max: 1;
|
|
852
|
+
};
|
|
853
|
+
};
|
|
854
|
+
readonly b: {
|
|
855
|
+
readonly "%": {
|
|
856
|
+
readonly min: 0;
|
|
857
|
+
readonly max: 100;
|
|
858
|
+
};
|
|
859
|
+
readonly number: {
|
|
860
|
+
readonly min: 0;
|
|
861
|
+
readonly max: 1;
|
|
862
|
+
};
|
|
863
|
+
};
|
|
864
|
+
readonly alpha: {
|
|
865
|
+
readonly "%": {
|
|
866
|
+
readonly min: 0;
|
|
867
|
+
readonly max: 100;
|
|
868
|
+
};
|
|
869
|
+
readonly number: {
|
|
870
|
+
readonly min: 0;
|
|
871
|
+
readonly max: 1;
|
|
872
|
+
};
|
|
873
|
+
};
|
|
874
|
+
};
|
|
875
|
+
readonly "prophoto-rgb": {
|
|
876
|
+
readonly r: {
|
|
877
|
+
readonly "%": {
|
|
878
|
+
readonly min: 0;
|
|
879
|
+
readonly max: 100;
|
|
880
|
+
};
|
|
881
|
+
readonly number: {
|
|
882
|
+
readonly min: 0;
|
|
883
|
+
readonly max: 1;
|
|
884
|
+
};
|
|
885
|
+
};
|
|
886
|
+
readonly g: {
|
|
887
|
+
readonly "%": {
|
|
888
|
+
readonly min: 0;
|
|
889
|
+
readonly max: 100;
|
|
890
|
+
};
|
|
891
|
+
readonly number: {
|
|
892
|
+
readonly min: 0;
|
|
893
|
+
readonly max: 1;
|
|
894
|
+
};
|
|
895
|
+
};
|
|
896
|
+
readonly b: {
|
|
897
|
+
readonly "%": {
|
|
898
|
+
readonly min: 0;
|
|
899
|
+
readonly max: 100;
|
|
900
|
+
};
|
|
901
|
+
readonly number: {
|
|
902
|
+
readonly min: 0;
|
|
903
|
+
readonly max: 1;
|
|
904
|
+
};
|
|
905
|
+
};
|
|
906
|
+
readonly alpha: {
|
|
907
|
+
readonly "%": {
|
|
908
|
+
readonly min: 0;
|
|
909
|
+
readonly max: 100;
|
|
910
|
+
};
|
|
911
|
+
readonly number: {
|
|
912
|
+
readonly min: 0;
|
|
913
|
+
readonly max: 1;
|
|
914
|
+
};
|
|
915
|
+
};
|
|
916
|
+
};
|
|
917
|
+
readonly rec2020: {
|
|
918
|
+
readonly r: {
|
|
919
|
+
readonly "%": {
|
|
920
|
+
readonly min: 0;
|
|
921
|
+
readonly max: 100;
|
|
922
|
+
};
|
|
923
|
+
readonly number: {
|
|
924
|
+
readonly min: 0;
|
|
925
|
+
readonly max: 1;
|
|
926
|
+
};
|
|
927
|
+
};
|
|
928
|
+
readonly g: {
|
|
929
|
+
readonly "%": {
|
|
930
|
+
readonly min: 0;
|
|
931
|
+
readonly max: 100;
|
|
932
|
+
};
|
|
933
|
+
readonly number: {
|
|
934
|
+
readonly min: 0;
|
|
935
|
+
readonly max: 1;
|
|
936
|
+
};
|
|
937
|
+
};
|
|
938
|
+
readonly b: {
|
|
939
|
+
readonly "%": {
|
|
940
|
+
readonly min: 0;
|
|
941
|
+
readonly max: 100;
|
|
942
|
+
};
|
|
943
|
+
readonly number: {
|
|
944
|
+
readonly min: 0;
|
|
945
|
+
readonly max: 1;
|
|
946
|
+
};
|
|
947
|
+
};
|
|
948
|
+
readonly alpha: {
|
|
949
|
+
readonly "%": {
|
|
950
|
+
readonly min: 0;
|
|
951
|
+
readonly max: 100;
|
|
952
|
+
};
|
|
953
|
+
readonly number: {
|
|
954
|
+
readonly min: 0;
|
|
955
|
+
readonly max: 1;
|
|
956
|
+
};
|
|
957
|
+
};
|
|
958
|
+
};
|
|
959
|
+
};
|
|
960
|
+
|
|
961
|
+
export declare const COLOR_UNITS: readonly ["color"];
|
|
962
|
+
|
|
963
|
+
export declare type ColorSpace = keyof typeof COLOR_SPACE_RANGES;
|
|
964
|
+
|
|
965
|
+
export declare type ColorSpaceMap<T> = {
|
|
966
|
+
rgb: RGBColor<T>;
|
|
967
|
+
hsl: HSLColor<T>;
|
|
968
|
+
hsv: HSVColor<T>;
|
|
969
|
+
hwb: HWBColor<T>;
|
|
970
|
+
lab: LABColor<T>;
|
|
971
|
+
lch: LCHColor<T>;
|
|
972
|
+
oklab: OKLABColor<T>;
|
|
973
|
+
oklch: OKLCHColor<T>;
|
|
974
|
+
kelvin: KelvinColor<T>;
|
|
975
|
+
xyz: XYZColor<T>;
|
|
976
|
+
"srgb-linear": LinearSRGBColor<T>;
|
|
977
|
+
"display-p3": DisplayP3Color<T>;
|
|
978
|
+
"a98-rgb": AdobeRGBColor<T>;
|
|
979
|
+
"prophoto-rgb": ProPhotoRGBColor<T>;
|
|
980
|
+
rec2020: Rec2020Color<T>;
|
|
981
|
+
};
|
|
982
|
+
|
|
983
|
+
export declare const colorUnit2: <C extends ColorSpace>(color: ValueUnit<Color<ValueUnit<number>>, "color">, to?: C | null, normalized?: boolean, inverse?: boolean, inplace?: boolean) => ValueUnit<ColorSpaceMap<ValueUnit<number>>[C], "color">;
|
|
984
|
+
|
|
985
|
+
declare type ComponentExpr = {
|
|
986
|
+
type: "ref";
|
|
987
|
+
name: string;
|
|
988
|
+
} | {
|
|
989
|
+
type: "calc";
|
|
990
|
+
expr: string;
|
|
991
|
+
} | {
|
|
992
|
+
type: "literal";
|
|
993
|
+
value: number;
|
|
994
|
+
} | {
|
|
995
|
+
type: "none";
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
export declare const COMPUTED_UNITS: readonly ["var", "calc"];
|
|
999
|
+
|
|
1000
|
+
/**
|
|
1001
|
+
* Compute the maximum saturation S = C/L for a given hue direction (a_, b_)
|
|
1002
|
+
* where a_² + b_² ≈ 1. Uses a polynomial initial guess refined by one
|
|
1003
|
+
* Halley's method step for cubic convergence.
|
|
1004
|
+
*/
|
|
1005
|
+
export declare function computeMaxSaturation(a_: number, b_: number): number;
|
|
1006
|
+
|
|
1007
|
+
export declare function convert2(value: number, from: (typeof UNITS)[number], to: (typeof UNITS)[number], target?: HTMLElement): number;
|
|
1008
|
+
|
|
1009
|
+
export declare function convertAbsoluteUnitToPixels(value: number, unit: string): number;
|
|
1010
|
+
|
|
1011
|
+
export declare function convertToDegrees(value: number, unit: (typeof ANGLE_UNITS)[number]): number;
|
|
1012
|
+
|
|
1013
|
+
export declare function convertToDPI(value: number, unit: (typeof RESOLUTION_UNITS)[number]): number;
|
|
1014
|
+
|
|
1015
|
+
export declare function convertToMs(value: number, unit: (typeof TIME_UNITS)[number]): number;
|
|
1016
|
+
|
|
1017
|
+
export declare function convertToPixels(value: number, unit: (typeof ABSOLUTE_LENGTH_UNITS)[number] | (typeof RELATIVE_LENGTH_UNITS)[number] | (typeof PERCENTAGE_UNITS)[number], element?: HTMLElement, property?: string): number;
|
|
1018
|
+
|
|
1019
|
+
export declare function createHash(algorithm: string, data: string): Promise<string>;
|
|
1020
|
+
|
|
1021
|
+
export declare const CSSColor: {
|
|
1022
|
+
Value: Parser<ValueUnit<any, string | undefined>>;
|
|
1023
|
+
colorValue: Parser<ValueUnit<any, string | undefined>>;
|
|
1024
|
+
componentExpr: Parser<ComponentExpr>;
|
|
1025
|
+
sep: Parser<string>;
|
|
1026
|
+
alphaSep: Parser<string>;
|
|
1027
|
+
div: Parser<string>;
|
|
1028
|
+
};
|
|
1029
|
+
|
|
1030
|
+
export declare const CSSFunction: {
|
|
1031
|
+
Function: Parser<any>;
|
|
1032
|
+
Value: Parser<any>;
|
|
1033
|
+
FunctionArgs: Parser<ValueArray<any>>;
|
|
1034
|
+
};
|
|
1035
|
+
|
|
1036
|
+
export declare const CSSJSON: Parser<ValueUnit<any, string>>;
|
|
1037
|
+
|
|
1038
|
+
export declare const CSSString: Parser<ValueUnit<string, string | undefined>>;
|
|
1039
|
+
|
|
1040
|
+
export declare const CSSValues: {
|
|
1041
|
+
Value: Parser<any>;
|
|
1042
|
+
Values: Parser<any[]>;
|
|
1043
|
+
};
|
|
1044
|
+
|
|
1045
|
+
export declare const CSSValueUnit: {
|
|
1046
|
+
Length: Parser<ValueUnit<number, string>>;
|
|
1047
|
+
Angle: Parser<ValueUnit<number, string>>;
|
|
1048
|
+
Time: Parser<ValueUnit<number, string>>;
|
|
1049
|
+
TimePercentage: Parser<ValueUnit<any, string | undefined>>;
|
|
1050
|
+
Resolution: Parser<ValueUnit<number, string>>;
|
|
1051
|
+
Percentage: Parser<ValueUnit<any, string | undefined>>;
|
|
1052
|
+
Color: Parser<ValueUnit<any, string | undefined>>;
|
|
1053
|
+
Slash: Parser<ValueUnit<string, string>>;
|
|
1054
|
+
Value: Parser<ValueUnit<any, string | undefined>>;
|
|
1055
|
+
sep: Parser<string>;
|
|
1056
|
+
};
|
|
1057
|
+
|
|
1058
|
+
export declare function cubicBezier(t: number, x1: number, y1: number, x2: number, y2: number): number[];
|
|
1059
|
+
|
|
1060
|
+
export declare function cubicBezierToString(x1: number, y1: number, x2: number, y2: number): string;
|
|
1061
|
+
|
|
1062
|
+
export declare function cubicBezierToSVG(x1: number, y1: number, x2: number, y2: number): string;
|
|
1063
|
+
|
|
1064
|
+
export declare const CYLINDRICAL_HUE_COMPONENT: Partial<Record<ColorSpace, string>>;
|
|
1065
|
+
|
|
1066
|
+
export declare function debounce<T extends (...args: any[]) => any>(func: T, wait?: number, immediate?: boolean): ((...args: Parameters<T>) => void) & {
|
|
1067
|
+
cancel: () => void;
|
|
1068
|
+
};
|
|
1069
|
+
|
|
1070
|
+
export declare function deCasteljau(t: number, points: number[]): number;
|
|
1071
|
+
|
|
1072
|
+
/**
|
|
1073
|
+
* Analytical sRGB gamut mapping based on Bjorn Ottosson's ok_color.h
|
|
1074
|
+
* https://bottosson.github.io/posts/gamutclipping/
|
|
1075
|
+
*
|
|
1076
|
+
* Strategy: adaptive L0 (alpha=0.05) — deterministic, zero-iteration,
|
|
1077
|
+
* perceptually correct in OKLab with exact hue preservation.
|
|
1078
|
+
*
|
|
1079
|
+
* MIT License — Copyright (c) 2021 Bjorn Ottosson
|
|
1080
|
+
*/
|
|
1081
|
+
export declare const DELTA_E_OK_JND = 0.02;
|
|
1082
|
+
|
|
1083
|
+
export declare function deltaEOK(L1: number, a1: number, b1: number, L2: number, a2: number, b2: number): number;
|
|
1084
|
+
|
|
1085
|
+
export declare function displayP32xyz({ r, g, b, alpha }: DisplayP3Color): XYZColor;
|
|
1086
|
+
|
|
1087
|
+
export declare class DisplayP3Color<T = number> extends Color<T> {
|
|
1088
|
+
constructor(r: T, g: T, b: T, alpha?: T);
|
|
1089
|
+
get r(): T;
|
|
1090
|
+
set r(value: T);
|
|
1091
|
+
get g(): T;
|
|
1092
|
+
set g(value: T);
|
|
1093
|
+
get b(): T;
|
|
1094
|
+
set b(value: T);
|
|
1095
|
+
}
|
|
1096
|
+
|
|
1097
|
+
/** Parser that always fails with the given message. */
|
|
1098
|
+
export declare function fail(message: string): Parser<never>;
|
|
1099
|
+
|
|
1100
|
+
/**
|
|
1101
|
+
* Find the cusp (L_cusp, C_cusp) — the point of maximum chroma on the
|
|
1102
|
+
* gamut boundary for a given hue direction.
|
|
1103
|
+
*/
|
|
1104
|
+
export declare function findCusp(a_: number, b_: number): {
|
|
1105
|
+
L: number;
|
|
1106
|
+
C: number;
|
|
1107
|
+
};
|
|
1108
|
+
|
|
1109
|
+
/**
|
|
1110
|
+
* Find the parameter t where the ray from (L0, 0) through (L1, C1)
|
|
1111
|
+
* intersects the sRGB gamut boundary. Returns t ∈ [0,1].
|
|
1112
|
+
*
|
|
1113
|
+
* Lower half uses closed-form; upper half uses one Halley's method step.
|
|
1114
|
+
*/
|
|
1115
|
+
export declare function findGamutIntersection(a_: number, b_: number, L1: number, C1: number, L0: number, cusp: {
|
|
1116
|
+
L: number;
|
|
1117
|
+
C: number;
|
|
1118
|
+
}): number;
|
|
1119
|
+
|
|
1120
|
+
export declare const flattenObject: (obj: any) => Record<string, any>;
|
|
1121
|
+
|
|
1122
|
+
export declare const FRAME_RATE: number;
|
|
1123
|
+
|
|
1124
|
+
export declare class FunctionValue<T = any, N extends string = string> {
|
|
1125
|
+
name: N;
|
|
1126
|
+
values: Array<ValueUnit<T> | FunctionValue<T>>;
|
|
1127
|
+
constructor(name: N, values: Array<ValueUnit<T> | FunctionValue<T>>);
|
|
1128
|
+
setSubProperty(subProperty: any): void;
|
|
1129
|
+
setProperty(property: any): void;
|
|
1130
|
+
setTargets(targets: HTMLElement[]): void;
|
|
1131
|
+
setValue(value: T, index?: number): void;
|
|
1132
|
+
valueOf(): any[];
|
|
1133
|
+
toString(): string;
|
|
1134
|
+
toJSON(): Record<string, any[]>;
|
|
1135
|
+
clone(): FunctionValue<T>;
|
|
1136
|
+
}
|
|
1137
|
+
|
|
1138
|
+
export declare const GAMUT_SECTOR_COEFFICIENTS: readonly [{
|
|
1139
|
+
readonly test: (a: number, b: number) => boolean;
|
|
1140
|
+
readonly k0: 1.19086277;
|
|
1141
|
+
readonly k1: 1.76576728;
|
|
1142
|
+
readonly k2: 0.59662641;
|
|
1143
|
+
readonly k3: 0.75515197;
|
|
1144
|
+
readonly k4: 0.56771245;
|
|
1145
|
+
readonly wl: 4.0767416621;
|
|
1146
|
+
readonly wm: -3.3077115913;
|
|
1147
|
+
readonly ws: 0.2309699292;
|
|
1148
|
+
}, {
|
|
1149
|
+
readonly test: (a: number, b: number) => boolean;
|
|
1150
|
+
readonly k0: 0.73956515;
|
|
1151
|
+
readonly k1: -0.45954404;
|
|
1152
|
+
readonly k2: 0.08285427;
|
|
1153
|
+
readonly k3: 0.1254107;
|
|
1154
|
+
readonly k4: 0.14503204;
|
|
1155
|
+
readonly wl: -1.2684380046;
|
|
1156
|
+
readonly wm: 2.6097574011;
|
|
1157
|
+
readonly ws: -0.3413193965;
|
|
1158
|
+
}, {
|
|
1159
|
+
readonly test: () => boolean;
|
|
1160
|
+
readonly k0: 1.35733652;
|
|
1161
|
+
readonly k1: -0.00915799;
|
|
1162
|
+
readonly k2: -1.1513021;
|
|
1163
|
+
readonly k3: -0.50559606;
|
|
1164
|
+
readonly k4: 0.00692167;
|
|
1165
|
+
readonly wl: -0.0041960863;
|
|
1166
|
+
readonly wm: -0.7034186147;
|
|
1167
|
+
readonly ws: 1.707614701;
|
|
1168
|
+
}];
|
|
1169
|
+
|
|
1170
|
+
export declare function gamutMap<C extends Color>(color: C): C;
|
|
1171
|
+
|
|
1172
|
+
/**
|
|
1173
|
+
* Core gamut mapping in raw OKLab space.
|
|
1174
|
+
* Adaptive L0 strategy (alpha=0.05) — preserves hue exactly.
|
|
1175
|
+
*
|
|
1176
|
+
* Input/output: raw OKLab (L ∈ [0,1], a,b ∈ [-0.4,0.4]).
|
|
1177
|
+
* Returns the mapped (L, a, b) tuple.
|
|
1178
|
+
*/
|
|
1179
|
+
export declare function gamutMapOKLab(L: number, a: number, b: number): [number, number, number];
|
|
1180
|
+
|
|
1181
|
+
/**
|
|
1182
|
+
* Map an sRGB color (components may be outside [0,1]) to in-gamut sRGB.
|
|
1183
|
+
* Returns clamped sRGB [0,1]³.
|
|
1184
|
+
*/
|
|
1185
|
+
export declare function gamutMapSRGB(r: number, g: number, b: number): [number, number, number];
|
|
1186
|
+
|
|
1187
|
+
export declare const getComputedValue: ((value: ValueUnit, target: HTMLElement) => ValueUnit<any, any>) & {
|
|
1188
|
+
cache: Map<string, {
|
|
1189
|
+
value: ValueUnit<any, any>;
|
|
1190
|
+
timestamp: number;
|
|
1191
|
+
}>;
|
|
1192
|
+
};
|
|
1193
|
+
|
|
1194
|
+
export declare const getFormattedColorSpaceRange: <T extends ColorSpace>(colorSpace: T) => ColorSpaceMap<{
|
|
1195
|
+
min: string;
|
|
1196
|
+
max: string;
|
|
1197
|
+
}>[T];
|
|
1198
|
+
|
|
1199
|
+
export declare const hex2rgb: (hex: string) => RGBColor;
|
|
1200
|
+
|
|
1201
|
+
export declare const hsl2hsv: ({ h, s, l, alpha }: HSLColor) => HSVColor;
|
|
1202
|
+
|
|
1203
|
+
export declare const hsl2hwb: ({ h, s, l, alpha }: HSLColor) => HWBColor;
|
|
1204
|
+
|
|
1205
|
+
export declare function hsl2rgb({ h, s, l, alpha }: HSLColor): RGBColor;
|
|
1206
|
+
|
|
1207
|
+
export declare function hsl2xyz(hsl: HSLColor): XYZColor<number>;
|
|
1208
|
+
|
|
1209
|
+
export declare class HSLColor<T = number> extends Color<T> {
|
|
1210
|
+
constructor(h: T, s: T, l: T, alpha?: T);
|
|
1211
|
+
get h(): T;
|
|
1212
|
+
set h(value: T);
|
|
1213
|
+
get s(): T;
|
|
1214
|
+
set s(value: T);
|
|
1215
|
+
get l(): T;
|
|
1216
|
+
set l(value: T);
|
|
1217
|
+
}
|
|
1218
|
+
|
|
1219
|
+
export declare const hsv2hsl: ({ h, s, v, alpha }: HSVColor) => HSLColor;
|
|
1220
|
+
|
|
1221
|
+
export declare function hsv2xyz(hsv: HSVColor): XYZColor;
|
|
1222
|
+
|
|
1223
|
+
export declare class HSVColor<T = number> extends Color<T> {
|
|
1224
|
+
constructor(h: T, s: T, v: T, alpha?: T);
|
|
1225
|
+
get h(): T;
|
|
1226
|
+
set h(value: T);
|
|
1227
|
+
get s(): T;
|
|
1228
|
+
set s(value: T);
|
|
1229
|
+
get v(): T;
|
|
1230
|
+
set v(value: T);
|
|
1231
|
+
}
|
|
1232
|
+
|
|
1233
|
+
export declare const HUE_RANGE: {
|
|
1234
|
+
readonly deg: {
|
|
1235
|
+
readonly min: 0;
|
|
1236
|
+
readonly max: 360;
|
|
1237
|
+
};
|
|
1238
|
+
readonly number: {
|
|
1239
|
+
readonly min: 0;
|
|
1240
|
+
readonly max: 360;
|
|
1241
|
+
};
|
|
1242
|
+
readonly "%": {
|
|
1243
|
+
readonly min: 0;
|
|
1244
|
+
readonly max: 100;
|
|
1245
|
+
};
|
|
1246
|
+
};
|
|
1247
|
+
|
|
1248
|
+
export declare type HueInterpolationMethod = "shorter" | "longer" | "increasing" | "decreasing";
|
|
1249
|
+
|
|
1250
|
+
export declare const hwb2hsl: ({ h, w, b, alpha }: HWBColor) => HSLColor;
|
|
1251
|
+
|
|
1252
|
+
export declare function hwb2xyz(hwb: HWBColor): XYZColor;
|
|
1253
|
+
|
|
1254
|
+
export declare class HWBColor<T = number> extends Color<T> {
|
|
1255
|
+
constructor(h: T, w: T, b: T, alpha?: T);
|
|
1256
|
+
get h(): T;
|
|
1257
|
+
set h(value: T);
|
|
1258
|
+
get w(): T;
|
|
1259
|
+
set w(value: T);
|
|
1260
|
+
get b(): T;
|
|
1261
|
+
set b(value: T);
|
|
1262
|
+
}
|
|
1263
|
+
|
|
1264
|
+
export declare const hyphenToCamelCase: (str: string) => string;
|
|
1265
|
+
|
|
1266
|
+
export declare const identifier: Parser<string>;
|
|
1267
|
+
|
|
1268
|
+
export declare const integer: Parser<number>;
|
|
1269
|
+
|
|
1270
|
+
export declare function interpBezier(t: number, points: number[][]): number[];
|
|
1271
|
+
|
|
1272
|
+
export declare type InterpolatedVar<T> = {
|
|
1273
|
+
start: ValueUnit<T>;
|
|
1274
|
+
stop: ValueUnit<T>;
|
|
1275
|
+
value: ValueUnit<T>;
|
|
1276
|
+
computed: boolean;
|
|
1277
|
+
};
|
|
1278
|
+
|
|
1279
|
+
/**
|
|
1280
|
+
* Interpolate between two hue values using the given method.
|
|
1281
|
+
* Hues are in [0, 1] (normalized). Returns an interpolated hue in [0, 1].
|
|
1282
|
+
* Handles NaN (CSS `none`): if one hue is NaN, the other's value is used.
|
|
1283
|
+
*/
|
|
1284
|
+
export declare function interpolateHue(h1: number, h2: number, t: number, method?: HueInterpolationMethod): number;
|
|
1285
|
+
|
|
1286
|
+
/** Invert a 3×3 matrix via cofactor expansion. Returns the inverse. */
|
|
1287
|
+
export declare function invertMat3(m: Mat3): Mat3;
|
|
1288
|
+
|
|
1289
|
+
export declare function isColorUnit(value: ValueUnit<Color<ValueUnit>>): value is ValueUnit<Color<ValueUnit>>;
|
|
1290
|
+
|
|
1291
|
+
export declare function isCSSStyleName(value: any): value is (typeof STYLE_NAMES)[number];
|
|
1292
|
+
|
|
1293
|
+
/** Check if linear sRGB values are within the [0,1]³ gamut. */
|
|
1294
|
+
export declare function isInSRGBGamut(r: number, g: number, b: number): boolean;
|
|
1295
|
+
|
|
1296
|
+
export declare const isObject: (value: any) => boolean;
|
|
1297
|
+
|
|
1298
|
+
/** Case-insensitive string match. Returns the matched portion of the input. */
|
|
1299
|
+
export declare const istring: (str: string) => Parser<string>;
|
|
1300
|
+
|
|
1301
|
+
export declare const kelvin2rgb: ({ kelvin, alpha }: KelvinColor) => RGBColor;
|
|
1302
|
+
|
|
1303
|
+
export declare function kelvin2xyz(kelvin: KelvinColor): XYZColor;
|
|
1304
|
+
|
|
1305
|
+
export declare class KelvinColor<T = number> extends Color<T> {
|
|
1306
|
+
constructor(kelvin: T, alpha?: T);
|
|
1307
|
+
get kelvin(): T;
|
|
1308
|
+
set kelvin(value: T);
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
export declare function lab2lch({ l, a, b, alpha }: LABColor): LCHColor;
|
|
1312
|
+
|
|
1313
|
+
export declare function lab2oklab(lab: LABColor): OKLABColor;
|
|
1314
|
+
|
|
1315
|
+
export declare function lab2oklch(lab: LABColor): OKLCHColor;
|
|
1316
|
+
|
|
1317
|
+
export declare function lab2xyz(lab: LABColor): XYZColor;
|
|
1318
|
+
|
|
1319
|
+
export declare class LABColor<T = number> extends WhitePointColor<T> {
|
|
1320
|
+
constructor(l: T, a: T, b: T, alpha?: T);
|
|
1321
|
+
get l(): T;
|
|
1322
|
+
set l(value: T);
|
|
1323
|
+
get a(): T;
|
|
1324
|
+
set a(value: T);
|
|
1325
|
+
get b(): T;
|
|
1326
|
+
set b(value: T);
|
|
1327
|
+
}
|
|
1328
|
+
|
|
1329
|
+
export declare function lch2lab({ l, c, h, alpha }: LCHColor): LABColor;
|
|
1330
|
+
|
|
1331
|
+
export declare function lch2xyz(lch: LCHColor): XYZColor;
|
|
1332
|
+
|
|
1333
|
+
export declare class LCHColor<T = number> extends Color<T> {
|
|
1334
|
+
constructor(l: T, c: T, h: T, alpha?: T);
|
|
1335
|
+
get l(): T;
|
|
1336
|
+
set l(value: T);
|
|
1337
|
+
get c(): T;
|
|
1338
|
+
set c(value: T);
|
|
1339
|
+
get h(): T;
|
|
1340
|
+
set h(value: T);
|
|
1341
|
+
}
|
|
1342
|
+
|
|
1343
|
+
export declare const LENGTH_UNITS: readonly ["px", "cm", "mm", "Q", "in", "pc", "pt", "em", "ex", "ch", "rem", "lh", "rlh", "vw", "vh", "vmin", "vmax", "vb", "vi", "svw", "svh", "lvw", "lvh", "dvw", "dvh"];
|
|
1344
|
+
|
|
1345
|
+
export declare function lerp(t: number, start: number, end: number): number;
|
|
1346
|
+
|
|
1347
|
+
export declare const LINEAR_SRGB_TO_LMS: Mat3;
|
|
1348
|
+
|
|
1349
|
+
export declare function linearSrgb2xyz({ r, g, b, alpha }: LinearSRGBColor): XYZColor;
|
|
1350
|
+
|
|
1351
|
+
export declare class LinearSRGBColor<T = number> extends Color<T> {
|
|
1352
|
+
constructor(r: T, g: T, b: T, alpha?: T);
|
|
1353
|
+
get r(): T;
|
|
1354
|
+
set r(value: T);
|
|
1355
|
+
get g(): T;
|
|
1356
|
+
set g(value: T);
|
|
1357
|
+
get b(): T;
|
|
1358
|
+
set b(value: T);
|
|
1359
|
+
}
|
|
1360
|
+
|
|
1361
|
+
export declare function linearToAdobeRgb(c: number): number;
|
|
1362
|
+
|
|
1363
|
+
export declare function linearToProPhoto(c: number): number;
|
|
1364
|
+
|
|
1365
|
+
export declare function linearToRec2020(c: number): number;
|
|
1366
|
+
|
|
1367
|
+
export declare function linearToSrgb(channel: number): number;
|
|
1368
|
+
|
|
1369
|
+
export declare const LMS_TO_LINEAR_SRGB: Mat3;
|
|
1370
|
+
|
|
1371
|
+
export declare const LMS_TO_OKLAB_MATRIX: Mat3;
|
|
1372
|
+
|
|
1373
|
+
export declare const LMS_TO_XYZ_MATRIX: Mat3;
|
|
1374
|
+
|
|
1375
|
+
export declare function logerp(t: number, start: number, end: number): number;
|
|
1376
|
+
|
|
1377
|
+
export declare type Mat3 = [
|
|
1378
|
+
number,
|
|
1379
|
+
number,
|
|
1380
|
+
number,
|
|
1381
|
+
number,
|
|
1382
|
+
number,
|
|
1383
|
+
number,
|
|
1384
|
+
number,
|
|
1385
|
+
number,
|
|
1386
|
+
number
|
|
1387
|
+
];
|
|
1388
|
+
|
|
1389
|
+
export declare interface MatrixValues {
|
|
1390
|
+
scaleX: number;
|
|
1391
|
+
scaleY: number;
|
|
1392
|
+
scaleZ: number;
|
|
1393
|
+
skewX: number;
|
|
1394
|
+
skewY: number;
|
|
1395
|
+
skewZ: number;
|
|
1396
|
+
translateX: number;
|
|
1397
|
+
translateY: number;
|
|
1398
|
+
translateZ: number;
|
|
1399
|
+
rotateX: number;
|
|
1400
|
+
rotateY: number;
|
|
1401
|
+
rotateZ: number;
|
|
1402
|
+
perspectiveX: number;
|
|
1403
|
+
perspectiveY: number;
|
|
1404
|
+
perspectiveZ: number;
|
|
1405
|
+
perspectiveW: number;
|
|
1406
|
+
}
|
|
1407
|
+
|
|
1408
|
+
export declare function memoize<T extends (...args: any[]) => any>(func: T, options?: MemoizeOptions): T & {
|
|
1409
|
+
cache: Map<string, {
|
|
1410
|
+
value: ReturnType<T>;
|
|
1411
|
+
timestamp: number;
|
|
1412
|
+
}>;
|
|
1413
|
+
};
|
|
1414
|
+
|
|
1415
|
+
export declare interface MemoizeOptions {
|
|
1416
|
+
maxCacheSize?: number;
|
|
1417
|
+
ttl?: number;
|
|
1418
|
+
keyFn?: (...args: any[]) => string;
|
|
1419
|
+
}
|
|
1420
|
+
|
|
1421
|
+
/**
|
|
1422
|
+
* Mix two colors per CSS color-mix() specification.
|
|
1423
|
+
* Both colors should be normalized (components in [0, 1]).
|
|
1424
|
+
* Percentages p1, p2 are in [0, 1] (e.g. 0.5 = 50%).
|
|
1425
|
+
*/
|
|
1426
|
+
export declare function mixColors(col1: Color, col2: Color, p1: number, p2: number, space?: ColorSpace, hueMethod?: HueInterpolationMethod): Color;
|
|
1427
|
+
|
|
1428
|
+
/** Multiply two Mat3 matrices (row-major): result = A × B */
|
|
1429
|
+
export declare function multiplyMat3(a: Mat3, b: Mat3): Mat3;
|
|
1430
|
+
|
|
1431
|
+
export declare const none: Parser<string>;
|
|
1432
|
+
|
|
1433
|
+
export declare const normalizeColor: (color: Color<ValueUnit<number> | number>, inverse?: boolean) => Color<ValueUnit<number>>;
|
|
1434
|
+
|
|
1435
|
+
export declare const normalizeColorUnit: (color: ValueUnit<Color<ValueUnit<number>>, "color">, inverse?: boolean, inplace?: boolean) => ValueUnit<Color<ValueUnit<number>>, "color">;
|
|
1436
|
+
|
|
1437
|
+
export declare const normalizeColorUnitComponent: (v: number, unit: string, colorSpace: ColorSpace, component: string, inverse?: boolean) => ValueUnit<number, string>;
|
|
1438
|
+
|
|
1439
|
+
export declare const normalizeColorUnits: (a: ValueUnit<Color<ValueUnit<number>>, "color">, b: ValueUnit<Color<ValueUnit<number>>, "color">, to?: ColorSpace, normalized?: boolean, inverse?: boolean, inplace?: boolean) => readonly [ValueUnit<RGBColor<ValueUnit<number, string | undefined>> | HSLColor<ValueUnit<number, string | undefined>> | HSVColor<ValueUnit<number, string | undefined>> | HWBColor<ValueUnit<number, string | undefined>> | LABColor<ValueUnit<number, string | undefined>> | LCHColor<ValueUnit<number, string | undefined>> | OKLABColor<ValueUnit<number, string | undefined>> | OKLCHColor<ValueUnit<number, string | undefined>> | XYZColor<ValueUnit<number, string | undefined>> | KelvinColor<ValueUnit<number, string | undefined>> | LinearSRGBColor<ValueUnit<number, string | undefined>> | DisplayP3Color<ValueUnit<number, string | undefined>> | AdobeRGBColor<ValueUnit<number, string | undefined>> | ProPhotoRGBColor<ValueUnit<number, string | undefined>> | Rec2020Color<ValueUnit<number, string | undefined>>, "color">, ValueUnit<RGBColor<ValueUnit<number, string | undefined>> | HSLColor<ValueUnit<number, string | undefined>> | HSVColor<ValueUnit<number, string | undefined>> | HWBColor<ValueUnit<number, string | undefined>> | LABColor<ValueUnit<number, string | undefined>> | LCHColor<ValueUnit<number, string | undefined>> | OKLABColor<ValueUnit<number, string | undefined>> | OKLCHColor<ValueUnit<number, string | undefined>> | XYZColor<ValueUnit<number, string | undefined>> | KelvinColor<ValueUnit<number, string | undefined>> | LinearSRGBColor<ValueUnit<number, string | undefined>> | DisplayP3Color<ValueUnit<number, string | undefined>> | AdobeRGBColor<ValueUnit<number, string | undefined>> | ProPhotoRGBColor<ValueUnit<number, string | undefined>> | Rec2020Color<ValueUnit<number, string | undefined>>, "color">];
|
|
1440
|
+
|
|
1441
|
+
export declare const normalizeNumericUnits: (a: ValueUnit, b: ValueUnit, inplace?: boolean) => [ValueUnit, ValueUnit];
|
|
1442
|
+
|
|
1443
|
+
export declare function normalizeValueUnits(left: ValueUnit, right: ValueUnit): InterpolatedVar<any>;
|
|
1444
|
+
|
|
1445
|
+
export declare const number: Parser<number>;
|
|
1446
|
+
|
|
1447
|
+
export declare function oklab2lab(oklab: OKLABColor): LABColor;
|
|
1448
|
+
|
|
1449
|
+
export declare function oklab2oklch({ l, a, b, alpha }: OKLABColor): OKLCHColor;
|
|
1450
|
+
|
|
1451
|
+
export declare function oklab2xyz({ l, a, b, alpha }: OKLABColor): XYZColor;
|
|
1452
|
+
|
|
1453
|
+
export declare const OKLAB_TO_LMS_COEFF: {
|
|
1454
|
+
readonly l: Vec3;
|
|
1455
|
+
readonly m: Vec3;
|
|
1456
|
+
readonly s: Vec3;
|
|
1457
|
+
};
|
|
1458
|
+
|
|
1459
|
+
export declare const OKLAB_TO_LMS_MATRIX: Mat3;
|
|
1460
|
+
|
|
1461
|
+
export declare class OKLABColor<T = number> extends WhitePointColor<T> {
|
|
1462
|
+
constructor(l: T, a: T, b: T, alpha?: T);
|
|
1463
|
+
get l(): T;
|
|
1464
|
+
set l(value: T);
|
|
1465
|
+
get a(): T;
|
|
1466
|
+
set a(value: T);
|
|
1467
|
+
get b(): T;
|
|
1468
|
+
set b(value: T);
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
/**
|
|
1472
|
+
* Direct OKLab→linear sRGB conversion (no XYZ intermediate).
|
|
1473
|
+
* L ∈ [0,1], a,b ∈ [-0.4,0.4] (raw OKLab, NOT normalized).
|
|
1474
|
+
*/
|
|
1475
|
+
export declare function oklabToLinearSRGB(L: number, a: number, b: number): [number, number, number];
|
|
1476
|
+
|
|
1477
|
+
export declare function oklch2lab(oklch: OKLCHColor): LABColor;
|
|
1478
|
+
|
|
1479
|
+
export declare function oklch2oklab({ l, c, h, alpha }: OKLCHColor): OKLABColor;
|
|
1480
|
+
|
|
1481
|
+
export declare function oklch2xyz(oklch: OKLCHColor): XYZColor;
|
|
1482
|
+
|
|
1483
|
+
export declare class OKLCHColor<T = number> extends Color<T> {
|
|
1484
|
+
constructor(l: T, c: T, h: T, alpha?: T);
|
|
1485
|
+
get l(): T;
|
|
1486
|
+
set l(value: T);
|
|
1487
|
+
get c(): T;
|
|
1488
|
+
set c(value: T);
|
|
1489
|
+
get h(): T;
|
|
1490
|
+
set h(value: T);
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
export declare function parseCSSColor(input: string): ValueUnit;
|
|
1494
|
+
|
|
1495
|
+
export declare const parseCSSPercent: ((input: string | number) => number) & {
|
|
1496
|
+
cache: Map<string, {
|
|
1497
|
+
value: number;
|
|
1498
|
+
timestamp: number;
|
|
1499
|
+
}>;
|
|
1500
|
+
};
|
|
1501
|
+
|
|
1502
|
+
export declare const parseCSSTime: ((input: string) => number) & {
|
|
1503
|
+
cache: Map<string, {
|
|
1504
|
+
value: number;
|
|
1505
|
+
timestamp: number;
|
|
1506
|
+
}>;
|
|
1507
|
+
};
|
|
1508
|
+
|
|
1509
|
+
export declare const parseCSSValue: ((input: string) => ValueUnit | FunctionValue) & {
|
|
1510
|
+
cache: Map<string, {
|
|
1511
|
+
value: ValueUnit<any, string | undefined> | FunctionValue<any, string>;
|
|
1512
|
+
timestamp: number;
|
|
1513
|
+
}>;
|
|
1514
|
+
};
|
|
1515
|
+
|
|
1516
|
+
export declare function parseCSSValueUnit(input: string): ValueUnit;
|
|
1517
|
+
|
|
1518
|
+
/**
|
|
1519
|
+
* Parse and return a result object with `.status` and `.value`.
|
|
1520
|
+
* Equivalent to Parsimmon's `.parse()` return shape.
|
|
1521
|
+
*/
|
|
1522
|
+
export declare function parseResult<T>(parser: Parser<T>, input: string): {
|
|
1523
|
+
status: boolean;
|
|
1524
|
+
value: T;
|
|
1525
|
+
};
|
|
1526
|
+
|
|
1527
|
+
export declare const PERCENTAGE_UNITS: readonly ["%"];
|
|
1528
|
+
|
|
1529
|
+
export declare function proPhoto2xyz({ r, g, b, alpha }: ProPhotoRGBColor): XYZColor;
|
|
1530
|
+
|
|
1531
|
+
export declare class ProPhotoRGBColor<T = number> extends Color<T> {
|
|
1532
|
+
constructor(r: T, g: T, b: T, alpha?: T);
|
|
1533
|
+
get r(): T;
|
|
1534
|
+
set r(value: T);
|
|
1535
|
+
get g(): T;
|
|
1536
|
+
set g(value: T);
|
|
1537
|
+
get b(): T;
|
|
1538
|
+
set b(value: T);
|
|
1539
|
+
}
|
|
1540
|
+
|
|
1541
|
+
export declare function proPhotoToLinear(c: number): number;
|
|
1542
|
+
|
|
1543
|
+
export declare function rec20202xyz({ r, g, b, alpha }: Rec2020Color): XYZColor;
|
|
1544
|
+
|
|
1545
|
+
export declare class Rec2020Color<T = number> extends Color<T> {
|
|
1546
|
+
constructor(r: T, g: T, b: T, alpha?: T);
|
|
1547
|
+
get r(): T;
|
|
1548
|
+
set r(value: T);
|
|
1549
|
+
get g(): T;
|
|
1550
|
+
set g(value: T);
|
|
1551
|
+
get b(): T;
|
|
1552
|
+
set b(value: T);
|
|
1553
|
+
}
|
|
1554
|
+
|
|
1555
|
+
export declare function rec2020ToLinear(c: number): number;
|
|
1556
|
+
|
|
1557
|
+
export declare const RELATIVE_LENGTH_UNITS: readonly ["em", "ex", "ch", "rem", "lh", "rlh", "vw", "vh", "vmin", "vmax", "vb", "vi", "svw", "svh", "lvw", "lvh", "dvw", "dvh"];
|
|
1558
|
+
|
|
1559
|
+
declare function requestAnimationFrame_2(callback: FrameRequestCallback): number | NodeJS.Timeout;
|
|
1560
|
+
export { requestAnimationFrame_2 as requestAnimationFrame }
|
|
1561
|
+
|
|
1562
|
+
export declare const RESOLUTION_UNITS: readonly ["dpi", "dpcm", "dppx", "cqw"];
|
|
1563
|
+
|
|
1564
|
+
export declare const rgb2hex: ({ r, g, b, alpha }: RGBColor) => string;
|
|
1565
|
+
|
|
1566
|
+
export declare const rgb2hsl: ({ r, g, b, alpha }: RGBColor) => HSLColor;
|
|
1567
|
+
|
|
1568
|
+
export declare const rgb2kelvin: ({ r, g, b, alpha }: RGBColor) => KelvinColor;
|
|
1569
|
+
|
|
1570
|
+
export declare function rgb2xyz({ r, g, b, alpha }: RGBColor): XYZColor;
|
|
1571
|
+
|
|
1572
|
+
export declare const RGB_RANGE: {
|
|
1573
|
+
readonly "%": {
|
|
1574
|
+
readonly min: 0;
|
|
1575
|
+
readonly max: 100;
|
|
1576
|
+
};
|
|
1577
|
+
readonly number: {
|
|
1578
|
+
readonly min: 0;
|
|
1579
|
+
readonly max: 255;
|
|
1580
|
+
};
|
|
1581
|
+
};
|
|
1582
|
+
|
|
1583
|
+
export declare const RGBA_MAX = 255;
|
|
1584
|
+
|
|
1585
|
+
export declare class RGBColor<T = number> extends Color<T> {
|
|
1586
|
+
constructor(r: T, g: T, b: T, alpha?: T);
|
|
1587
|
+
get r(): T;
|
|
1588
|
+
set r(value: T);
|
|
1589
|
+
get g(): T;
|
|
1590
|
+
set g(value: T);
|
|
1591
|
+
get b(): T;
|
|
1592
|
+
set b(value: T);
|
|
1593
|
+
}
|
|
1594
|
+
|
|
1595
|
+
export declare function scale(value: number, fromMin: number, fromMax: number, toMin?: number, toMax?: number): number;
|
|
1596
|
+
|
|
1597
|
+
export declare function seekPreviousValue<T>(ix: number, values: T[], pred: (f: T) => boolean): number | undefined;
|
|
1598
|
+
|
|
1599
|
+
export declare function sleep(ms: number): Promise<unknown>;
|
|
1600
|
+
|
|
1601
|
+
export declare function srgbToLinear(channel: number): number;
|
|
1602
|
+
|
|
1603
|
+
/**
|
|
1604
|
+
* Convert sRGB (possibly out-of-gamut) to raw OKLab.
|
|
1605
|
+
* Uses the direct linear sRGB → LMS path.
|
|
1606
|
+
*/
|
|
1607
|
+
export declare function srgbToOKLab(r: number, g: number, b: number): [number, number, number];
|
|
1608
|
+
|
|
1609
|
+
export declare const STRING_UNITS: readonly ["string"];
|
|
1610
|
+
|
|
1611
|
+
export declare const STYLE_NAMES: readonly ["accentColor", "additiveSymbols", "alignContent", "alignItems", "alignSelf", "alignmentBaseline", "all", "anchorName", "animation", "animationComposition", "animationDelay", "animationDirection", "animationDuration", "animationFillMode", "animationIterationCount", "animationName", "animationPlayState", "animationRange", "animationRangeEnd", "animationRangeStart", "animationTimeline", "animationTimingFunction", "appRegion", "appearance", "ascentOverride", "aspectRatio", "backdropFilter", "backfaceVisibility", "background", "backgroundAttachment", "backgroundBlendMode", "backgroundClip", "backgroundColor", "backgroundImage", "backgroundOrigin", "backgroundPosition", "backgroundPositionX", "backgroundPositionY", "backgroundRepeat", "backgroundSize", "basePalette", "baselineShift", "baselineSource", "blockSize", "border", "borderBlock", "borderBlockColor", "borderBlockEnd", "borderBlockEndColor", "borderBlockEndStyle", "borderBlockEndWidth", "borderBlockStart", "borderBlockStartColor", "borderBlockStartStyle", "borderBlockStartWidth", "borderBlockStyle", "borderBlockWidth", "borderBottom", "borderBottomColor", "borderBottomLeftRadius", "borderBottomRightRadius", "borderBottomStyle", "borderBottomWidth", "borderCollapse", "borderColor", "borderEndEndRadius", "borderEndStartRadius", "borderImage", "borderImageOutset", "borderImageRepeat", "borderImageSlice", "borderImageSource", "borderImageWidth", "borderInline", "borderInlineColor", "borderInlineEnd", "borderInlineEndColor", "borderInlineEndStyle", "borderInlineEndWidth", "borderInlineStart", "borderInlineStartColor", "borderInlineStartStyle", "borderInlineStartWidth", "borderInlineStyle", "borderInlineWidth", "borderLeft", "borderLeftColor", "borderLeftStyle", "borderLeftWidth", "borderRadius", "borderRight", "borderRightColor", "borderRightStyle", "borderRightWidth", "borderSpacing", "borderStartEndRadius", "borderStartStartRadius", "borderStyle", "borderTop", "borderTopColor", "borderTopLeftRadius", "borderTopRightRadius", "borderTopStyle", "borderTopWidth", "borderWidth", "bottom", "boxShadow", "boxSizing", "breakAfter", "breakBefore", "breakInside", "bufferedRendering", "captionSide", "caretColor", "clear", "clip", "clipPath", "clipRule", "color", "colorInterpolation", "colorInterpolationFilters", "colorRendering", "colorScheme", "columnCount", "columnFill", "columnGap", "columnRule", "columnRuleColor", "columnRuleStyle", "columnRuleWidth", "columnSpan", "columnWidth", "columns", "contain", "containIntrinsicBlockSize", "containIntrinsicHeight", "containIntrinsicInlineSize", "containIntrinsicSize", "containIntrinsicWidth", "container", "containerName", "containerType", "content", "contentVisibility", "counterIncrement", "counterReset", "counterSet", "cursor", "cx", "cy", "d", "descentOverride", "direction", "display", "dominantBaseline", "emptyCells", "fallback", "fieldSizing", "fill", "fillOpacity", "fillRule", "filter", "flex", "flexBasis", "flexDirection", "flexFlow", "flexGrow", "flexShrink", "flexWrap", "float", "floodColor", "floodOpacity", "font", "fontDisplay", "fontFamily", "fontFeatureSettings", "fontKerning", "fontOpticalSizing", "fontPalette", "fontSize", "fontStretch", "fontStyle", "fontSynthesis", "fontSynthesisSmallCaps", "fontSynthesisStyle", "fontSynthesisWeight", "fontVariant", "fontVariantAlternates", "fontVariantCaps", "fontVariantEastAsian", "fontVariantLigatures", "fontVariantNumeric", "fontVariantPosition", "fontVariationSettings", "fontWeight", "forcedColorAdjust", "gap", "grid", "gridArea", "gridAutoColumns", "gridAutoFlow", "gridAutoRows", "gridColumn", "gridColumnEnd", "gridColumnGap", "gridColumnStart", "gridGap", "gridRow", "gridRowEnd", "gridRowGap", "gridRowStart", "gridTemplate", "gridTemplateAreas", "gridTemplateColumns", "gridTemplateRows", "height", "hyphenateCharacter", "hyphenateLimitChars", "hyphens", "imageOrientation", "imageRendering", "inherits", "initialLetter", "initialValue", "inlineSize", "inset", "insetArea", "insetBlock", "insetBlockEnd", "insetBlockStart", "insetInline", "insetInlineEnd", "insetInlineStart", "isolation", "justifyContent", "justifyItems", "justifySelf", "left", "letterSpacing", "lightingColor", "lineBreak", "lineGapOverride", "lineHeight", "listStyle", "listStyleImage", "listStylePosition", "listStyleType", "margin", "marginBlock", "marginBlockEnd", "marginBlockStart", "marginBottom", "marginInline", "marginInlineEnd", "marginInlineStart", "marginLeft", "marginRight", "marginTop", "marker", "markerEnd", "markerMid", "markerStart", "mask", "maskClip", "maskComposite", "maskImage", "maskMode", "maskOrigin", "maskPosition", "maskRepeat", "maskSize", "maskType", "mathDepth", "mathShift", "mathStyle", "maxBlockSize", "maxHeight", "maxInlineSize", "maxWidth", "minBlockSize", "minHeight", "minInlineSize", "minWidth", "mixBlendMode", "navigation", "negative", "objectFit", "objectPosition", "objectViewBox", "offset", "offsetAnchor", "offsetDistance", "offsetPath", "offsetPosition", "offsetRotate", "opacity", "order", "orphans", "outline", "outlineColor", "outlineOffset", "outlineStyle", "outlineWidth", "overflow", "overflowAnchor", "overflowClipMargin", "overflowWrap", "overflowX", "overflowY", "overlay", "overrideColors", "overscrollBehavior", "overscrollBehaviorBlock", "overscrollBehaviorInline", "overscrollBehaviorX", "overscrollBehaviorY", "pad", "padding", "paddingBlock", "paddingBlockEnd", "paddingBlockStart", "paddingBottom", "paddingInline", "paddingInlineEnd", "paddingInlineStart", "paddingLeft", "paddingRight", "paddingTop", "page", "pageBreakAfter", "pageBreakBefore", "pageBreakInside", "pageOrientation", "paintOrder", "perspective", "perspectiveOrigin", "placeContent", "placeItems", "placeSelf", "pointerEvents", "position", "positionAnchor", "positionTry", "positionTryOptions", "positionTryOrder", "positionVisibility", "prefix", "quotes", "r", "range", "resize", "right", "rotate", "rowGap", "rubyPosition", "rx", "ry", "scale", "scrollBehavior", "scrollMargin", "scrollMarginBlock", "scrollMarginBlockEnd", "scrollMarginBlockStart", "scrollMarginBottom", "scrollMarginInline", "scrollMarginInlineEnd", "scrollMarginInlineStart", "scrollMarginLeft", "scrollMarginRight", "scrollMarginTop", "scrollPadding", "scrollPaddingBlock", "scrollPaddingBlockEnd", "scrollPaddingBlockStart", "scrollPaddingBottom", "scrollPaddingInline", "scrollPaddingInlineEnd", "scrollPaddingInlineStart", "scrollPaddingLeft", "scrollPaddingRight", "scrollPaddingTop", "scrollSnapAlign", "scrollSnapStop", "scrollSnapType", "scrollTimeline", "scrollTimelineAxis", "scrollTimelineName", "scrollbarColor", "scrollbarGutter", "scrollbarWidth", "shapeImageThreshold", "shapeMargin", "shapeOutside", "shapeRendering", "size", "sizeAdjust", "speak", "speakAs", "src", "stopColor", "stopOpacity", "stroke", "strokeDasharray", "strokeDashoffset", "strokeLinecap", "strokeLinejoin", "strokeMiterlimit", "strokeOpacity", "strokeWidth", "suffix", "symbols", "syntax", "system", "tabSize", "tableLayout", "textAlign", "textAlignLast", "textAnchor", "textCombineUpright", "textDecoration", "textDecorationColor", "textDecorationLine", "textDecorationSkipInk", "textDecorationStyle", "textDecorationThickness", "textEmphasis", "textEmphasisColor", "textEmphasisPosition", "textEmphasisStyle", "textIndent", "textOrientation", "textOverflow", "textRendering", "textShadow", "textSizeAdjust", "textSpacingTrim", "textTransform", "textUnderlineOffset", "textUnderlinePosition", "textWrap", "timelineScope", "top", "touchAction", "transform", "transformBox", "transformOrigin", "transformStyle", "transition", "transitionBehavior", "transitionDelay", "transitionDuration", "transitionProperty", "transitionTimingFunction", "translate", "types", "unicodeBidi", "unicodeRange", "userSelect", "vectorEffect", "verticalAlign", "viewTimeline", "viewTimelineAxis", "viewTimelineInset", "viewTimelineName", "viewTransitionClass", "viewTransitionName", "visibility", "webkitAlignContent", "webkitAlignItems", "webkitAlignSelf", "webkitAnimation", "webkitAnimationDelay", "webkitAnimationDirection", "webkitAnimationDuration", "webkitAnimationFillMode", "webkitAnimationIterationCount", "webkitAnimationName", "webkitAnimationPlayState", "webkitAnimationTimingFunction", "webkitAppRegion", "webkitAppearance", "webkitBackfaceVisibility", "webkitBackgroundClip", "webkitBackgroundOrigin", "webkitBackgroundSize", "webkitBorderAfter", "webkitBorderAfterColor", "webkitBorderAfterStyle", "webkitBorderAfterWidth", "webkitBorderBefore", "webkitBorderBeforeColor", "webkitBorderBeforeStyle", "webkitBorderBeforeWidth", "webkitBorderBottomLeftRadius", "webkitBorderBottomRightRadius", "webkitBorderEnd", "webkitBorderEndColor", "webkitBorderEndStyle", "webkitBorderEndWidth", "webkitBorderHorizontalSpacing", "webkitBorderImage", "webkitBorderRadius", "webkitBorderStart", "webkitBorderStartColor", "webkitBorderStartStyle", "webkitBorderStartWidth", "webkitBorderTopLeftRadius", "webkitBorderTopRightRadius", "webkitBorderVerticalSpacing", "webkitBoxAlign", "webkitBoxDecorationBreak", "webkitBoxDirection", "webkitBoxFlex", "webkitBoxOrdinalGroup", "webkitBoxOrient", "webkitBoxPack", "webkitBoxReflect", "webkitBoxShadow", "webkitBoxSizing", "webkitClipPath", "webkitColumnBreakAfter", "webkitColumnBreakBefore", "webkitColumnBreakInside", "webkitColumnCount", "webkitColumnGap", "webkitColumnRule", "webkitColumnRuleColor", "webkitColumnRuleStyle", "webkitColumnRuleWidth", "webkitColumnSpan", "webkitColumnWidth", "webkitColumns", "webkitFilter", "webkitFlex", "webkitFlexBasis", "webkitFlexDirection", "webkitFlexFlow", "webkitFlexGrow", "webkitFlexShrink", "webkitFlexWrap", "webkitFontFeatureSettings", "webkitFontSmoothing", "webkitHyphenateCharacter", "webkitJustifyContent", "webkitLineBreak", "webkitLineClamp", "webkitLocale", "webkitLogicalHeight", "webkitLogicalWidth", "webkitMarginAfter", "webkitMarginBefore", "webkitMarginEnd", "webkitMarginStart", "webkitMask", "webkitMaskBoxImage", "webkitMaskBoxImageOutset", "webkitMaskBoxImageRepeat", "webkitMaskBoxImageSlice", "webkitMaskBoxImageSource", "webkitMaskBoxImageWidth", "webkitMaskClip", "webkitMaskComposite", "webkitMaskImage", "webkitMaskOrigin", "webkitMaskPosition", "webkitMaskPositionX", "webkitMaskPositionY", "webkitMaskRepeat", "webkitMaskSize", "webkitMaxLogicalHeight", "webkitMaxLogicalWidth", "webkitMinLogicalHeight", "webkitMinLogicalWidth", "webkitOpacity", "webkitOrder", "webkitPaddingAfter", "webkitPaddingBefore", "webkitPaddingEnd", "webkitPaddingStart", "webkitPerspective", "webkitPerspectiveOrigin", "webkitPerspectiveOriginX", "webkitPerspectiveOriginY", "webkitPrintColorAdjust", "webkitRtlOrdering", "webkitRubyPosition", "webkitShapeImageThreshold", "webkitShapeMargin", "webkitShapeOutside", "webkitTapHighlightColor", "webkitTextCombine", "webkitTextDecorationsInEffect", "webkitTextEmphasis", "webkitTextEmphasisColor", "webkitTextEmphasisPosition", "webkitTextEmphasisStyle", "webkitTextFillColor", "webkitTextOrientation", "webkitTextSecurity", "webkitTextSizeAdjust", "webkitTextStroke", "webkitTextStrokeColor", "webkitTextStrokeWidth", "webkitTransform", "webkitTransformOrigin", "webkitTransformOriginX", "webkitTransformOriginY", "webkitTransformOriginZ", "webkitTransformStyle", "webkitTransition", "webkitTransitionDelay", "webkitTransitionDuration", "webkitTransitionProperty", "webkitTransitionTimingFunction", "webkitUserDrag", "webkitUserModify", "webkitUserSelect", "webkitWritingMode", "whiteSpace", "whiteSpaceCollapse", "widows", "width", "willChange", "wordBreak", "wordSpacing", "wordWrap", "writingMode", "x", "y", "zIndex", "zoom"];
|
|
1612
|
+
|
|
1613
|
+
/** Parser that always succeeds with the given value without consuming input. */
|
|
1614
|
+
export declare function succeed<T>(value: T): Parser<T>;
|
|
1615
|
+
|
|
1616
|
+
export declare const TIME_UNITS: readonly ["s", "ms"];
|
|
1617
|
+
|
|
1618
|
+
/** Multiply a Mat3 (row-major) by a Vec3: result = M * v */
|
|
1619
|
+
export declare function transformMat3(v: Vec3, m: Mat3): Vec3;
|
|
1620
|
+
|
|
1621
|
+
/** Transpose a Mat3 (row-major → row-major transpose) */
|
|
1622
|
+
export declare function transposeMat3(m: Mat3): Mat3;
|
|
1623
|
+
|
|
1624
|
+
/**
|
|
1625
|
+
* Try to parse; return the result or throw on failure.
|
|
1626
|
+
* Equivalent to Parsimmon's `.tryParse()`.
|
|
1627
|
+
*/
|
|
1628
|
+
export declare function tryParse<T>(parser: Parser<T>, input: string): T;
|
|
1629
|
+
|
|
1630
|
+
export declare const unflattenObject: (flatObj: Record<string, any[]>) => any;
|
|
1631
|
+
|
|
1632
|
+
export declare const unflattenObjectToString: (flatObj: Record<string, any[]>) => Record<string, string>;
|
|
1633
|
+
|
|
1634
|
+
export declare const UNIT_RANGE: {
|
|
1635
|
+
readonly "%": {
|
|
1636
|
+
readonly min: 0;
|
|
1637
|
+
readonly max: 100;
|
|
1638
|
+
};
|
|
1639
|
+
readonly number: {
|
|
1640
|
+
readonly min: 0;
|
|
1641
|
+
readonly max: 1;
|
|
1642
|
+
};
|
|
1643
|
+
};
|
|
1644
|
+
|
|
1645
|
+
export declare const UNITS: readonly ["px", "cm", "mm", "Q", "in", "pc", "pt", "em", "ex", "ch", "rem", "lh", "rlh", "vw", "vh", "vmin", "vmax", "vb", "vi", "svw", "svh", "lvw", "lvh", "dvw", "dvh", "s", "ms", "deg", "rad", "grad", "turn", "%", "dpi", "dpcm", "dppx", "cqw", "var", "calc", "string", "color", "", undefined];
|
|
1646
|
+
|
|
1647
|
+
export declare const unpackMatrixValues: (value: FunctionValue) => MatrixValues;
|
|
1648
|
+
|
|
1649
|
+
export declare class ValueArray<T = any> extends Array<ValueUnit<T> | FunctionValue<T>> {
|
|
1650
|
+
constructor(...args: Array<ValueUnit<T> | FunctionValue<T>>);
|
|
1651
|
+
setSubProperty(subProperty: any): void;
|
|
1652
|
+
setProperty(property: any): void;
|
|
1653
|
+
setTargets(targets: HTMLElement[]): void;
|
|
1654
|
+
setValue(value: T, index?: number): void;
|
|
1655
|
+
valueOf(): (any[] | T)[];
|
|
1656
|
+
toString(): string;
|
|
1657
|
+
toJSON(): (Record<string, any[]> | T)[];
|
|
1658
|
+
clone(): ValueArray<T>;
|
|
1659
|
+
}
|
|
1660
|
+
|
|
1661
|
+
export declare class ValueUnit<T = any, U = (typeof UNITS)[number] | string> {
|
|
1662
|
+
value: T;
|
|
1663
|
+
unit?: U | undefined;
|
|
1664
|
+
superType?: string[] | undefined;
|
|
1665
|
+
subProperty?: string | undefined;
|
|
1666
|
+
property?: string | undefined;
|
|
1667
|
+
targets?: HTMLElement[] | undefined;
|
|
1668
|
+
constructor(value: T, unit?: U | undefined, superType?: string[] | undefined, subProperty?: string | undefined, property?: string | undefined, targets?: HTMLElement[] | undefined);
|
|
1669
|
+
setSubProperty(subProperty: any): void;
|
|
1670
|
+
setProperty(property: any): void;
|
|
1671
|
+
setTargets(targets: HTMLElement[]): void;
|
|
1672
|
+
valueOf(): T;
|
|
1673
|
+
setValue(value: T): void;
|
|
1674
|
+
toString(): string;
|
|
1675
|
+
toJSON(): T;
|
|
1676
|
+
toFixed(fractionDigits?: number): string;
|
|
1677
|
+
clone(): ValueUnit<T, U>;
|
|
1678
|
+
coalesce(right?: ValueUnit, inplace?: boolean): ValueUnit<any, any>;
|
|
1679
|
+
}
|
|
1680
|
+
|
|
1681
|
+
/**
|
|
1682
|
+
* Minimal 3×3 matrix and 3-element vector math.
|
|
1683
|
+
* Replaces gl-matrix dependency — uses native number[] for full f64 precision
|
|
1684
|
+
* (gl-matrix uses Float32Array).
|
|
1685
|
+
*
|
|
1686
|
+
* Mat3 is stored in row-major order:
|
|
1687
|
+
* [m00, m01, m02, m10, m11, m12, m20, m21, m22]
|
|
1688
|
+
*/
|
|
1689
|
+
export declare type Vec3 = [number, number, number];
|
|
1690
|
+
|
|
1691
|
+
export declare function waitUntil(condition: () => boolean, delay?: number): Promise<void>;
|
|
1692
|
+
|
|
1693
|
+
export declare const WHITE_POINT_D50: Vec3;
|
|
1694
|
+
|
|
1695
|
+
export declare const WHITE_POINT_D50_D65: Mat3;
|
|
1696
|
+
|
|
1697
|
+
export declare const WHITE_POINT_D65: Vec3;
|
|
1698
|
+
|
|
1699
|
+
export declare const WHITE_POINT_D65_D50: Mat3;
|
|
1700
|
+
|
|
1701
|
+
export declare const WHITE_POINTS: {
|
|
1702
|
+
D65: Vec3;
|
|
1703
|
+
D50: Vec3;
|
|
1704
|
+
};
|
|
1705
|
+
|
|
1706
|
+
export declare type WhitePoint = keyof typeof WHITE_POINTS;
|
|
1707
|
+
|
|
1708
|
+
declare class WhitePointColor<T = number> extends Color<T> {
|
|
1709
|
+
whitePoint: WhitePoint;
|
|
1710
|
+
constructor(colorSpace: ColorSpace, alpha: T, whitePoint: WhitePoint);
|
|
1711
|
+
}
|
|
1712
|
+
|
|
1713
|
+
export declare function xyz2adobeRgb({ x, y, z, alpha }: XYZColor): AdobeRGBColor;
|
|
1714
|
+
|
|
1715
|
+
export declare function xyz2displayP3({ x, y, z, alpha }: XYZColor): DisplayP3Color;
|
|
1716
|
+
|
|
1717
|
+
export declare function xyz2hsl(xyz: XYZColor): HSLColor<number>;
|
|
1718
|
+
|
|
1719
|
+
export declare function xyz2hsv(xyz: XYZColor): HSVColor;
|
|
1720
|
+
|
|
1721
|
+
export declare function xyz2hwb(xyz: XYZColor): HWBColor;
|
|
1722
|
+
|
|
1723
|
+
export declare function xyz2kelvin(xyz: XYZColor): KelvinColor;
|
|
1724
|
+
|
|
1725
|
+
export declare function xyz2lab(xyz: XYZColor, toWhitePoint?: WhitePoint): LABColor;
|
|
1726
|
+
|
|
1727
|
+
export declare function xyz2lch(xyz: XYZColor): LCHColor;
|
|
1728
|
+
|
|
1729
|
+
export declare function xyz2linearSrgb({ x, y, z, alpha }: XYZColor): LinearSRGBColor;
|
|
1730
|
+
|
|
1731
|
+
export declare function xyz2oklab(xyz: XYZColor): OKLABColor;
|
|
1732
|
+
|
|
1733
|
+
export declare function xyz2oklch(xyz: XYZColor): OKLCHColor;
|
|
1734
|
+
|
|
1735
|
+
export declare function xyz2proPhoto({ x, y, z, alpha }: XYZColor): ProPhotoRGBColor;
|
|
1736
|
+
|
|
1737
|
+
export declare function xyz2rec2020({ x, y, z, alpha }: XYZColor): Rec2020Color;
|
|
1738
|
+
|
|
1739
|
+
export declare const xyz2rgb: ({ x, y, z, alpha }: XYZColor, correctGamut?: boolean) => RGBColor;
|
|
1740
|
+
|
|
1741
|
+
export declare const XYZ_TO_LMS_MATRIX: Mat3;
|
|
1742
|
+
|
|
1743
|
+
export declare class XYZColor<T = number> extends WhitePointColor<T> {
|
|
1744
|
+
constructor(x: T, y: T, z: T, alpha?: T);
|
|
1745
|
+
get x(): T;
|
|
1746
|
+
set x(value: T);
|
|
1747
|
+
get y(): T;
|
|
1748
|
+
set y(value: T);
|
|
1749
|
+
get z(): T;
|
|
1750
|
+
set z(value: T);
|
|
1751
|
+
}
|
|
1752
|
+
|
|
1753
|
+
export { }
|