@mkbabb/value.js 0.4.2 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/value.d.ts CHANGED
@@ -1,1997 +1,2 @@
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 bezierPresets: {
37
- readonly ease: readonly [0.25, 0.1, 0.25, 1];
38
- readonly "ease-in": readonly [0.42, 0, 1, 1];
39
- readonly "ease-out": readonly [0, 0, 0.58, 1];
40
- readonly "ease-in-out": readonly [0.42, 0, 0.58, 1];
41
- readonly "ease-in-back": readonly [0.6, -0.28, 0.735, 0.045];
42
- readonly "ease-out-back": readonly [0.175, 0.885, 0.32, 1.275];
43
- readonly "ease-in-out-back": readonly [0.68, -0.55, 0.265, 1.55];
44
- };
45
-
46
- export declare const BLACKLISTED_COALESCE_UNITS: readonly ["string", "var", "calc"];
47
-
48
- export declare function bounceInEase(t: number): number;
49
-
50
- export declare function bounceInEaseHalf(t: number): number;
51
-
52
- export declare function bounceInOutEase(t: number): number;
53
-
54
- export declare function bounceOutEase(t: number): number;
55
-
56
- export declare function bounceOutEaseHalf(t: number): number;
57
-
58
- export declare function camelCaseToHyphen(str: string): string;
59
-
60
- declare function cancelAnimationFrame_2(handle: number | undefined | null | any): void;
61
- export { cancelAnimationFrame_2 as cancelAnimationFrame }
62
-
63
- export declare function clamp(value: number, min: number, max: number): number;
64
-
65
- export declare function clone(obj: any): any;
66
-
67
- export declare abstract class Color<T = number> {
68
- readonly colorSpace: ColorSpace;
69
- alpha: T;
70
- [key: string]: any;
71
- protected components: Map<string, T>;
72
- constructor(colorSpace: ColorSpace, alpha?: T);
73
- toString(): string;
74
- toFormattedString(digits?: number): string;
75
- valueOf(): T[];
76
- toJSON(): Record<string, T>;
77
- clone(): this;
78
- keys(): string[];
79
- values(): T[];
80
- entries(): [string, T][];
81
- protected getComponent(key: string): T | undefined;
82
- protected setComponent(key: string, value: T): void;
83
- }
84
-
85
- export declare function color2<T, C extends ColorSpace>(color: Color<T>, to: C): Color<T>;
86
-
87
- export declare const COLOR_NAMES: {
88
- readonly aliceblue: "#f0f8ff";
89
- readonly antiquewhite: "#faebd7";
90
- readonly aqua: "#00ffff";
91
- readonly aquamarine: "#7fffd4";
92
- readonly azure: "#f0ffff";
93
- readonly beige: "#f5f5dc";
94
- readonly bisque: "#ffe4c4";
95
- readonly black: "#000000";
96
- readonly blanchedalmond: "#ffebcd";
97
- readonly blue: "#0000ff";
98
- readonly blueviolet: "#8a2be2";
99
- readonly brown: "#a52a2a";
100
- readonly burlywood: "#deb887";
101
- readonly cadetblue: "#5f9ea0";
102
- readonly chartreuse: "#7fff00";
103
- readonly chocolate: "#d2691e";
104
- readonly coral: "#ff7f50";
105
- readonly cornflowerblue: "#6495ed";
106
- readonly cornsilk: "#fff8dc";
107
- readonly crimson: "#dc143c";
108
- readonly cyan: "#00ffff";
109
- readonly darkblue: "#00008b";
110
- readonly darkcyan: "#008b8b";
111
- readonly darkgoldenrod: "#b8860b";
112
- readonly darkgray: "#a9a9a9";
113
- readonly darkgreen: "#006400";
114
- readonly darkgrey: "#a9a9a9";
115
- readonly darkkhaki: "#bdb76b";
116
- readonly darkmagenta: "#8b008b";
117
- readonly darkolivegreen: "#556b2f";
118
- readonly darkorange: "#ff8c00";
119
- readonly darkorchid: "#9932cc";
120
- readonly darkred: "#8b0000";
121
- readonly darksalmon: "#e9967a";
122
- readonly darkseagreen: "#8fbc8f";
123
- readonly darkslateblue: "#483d8b";
124
- readonly darkslategray: "#2f4f4f";
125
- readonly darkslategrey: "#2f4f4f";
126
- readonly darkturquoise: "#00ced1";
127
- readonly darkviolet: "#9400d3";
128
- readonly deeppink: "#ff1493";
129
- readonly deepskyblue: "#00bfff";
130
- readonly dimgray: "#696969";
131
- readonly dimgrey: "#696969";
132
- readonly dodgerblue: "#1e90ff";
133
- readonly firebrick: "#b22222";
134
- readonly floralwhite: "#fffaf0";
135
- readonly forestgreen: "#228b22";
136
- readonly fuchsia: "#ff00ff";
137
- readonly gainsboro: "#dcdcdc";
138
- readonly ghostwhite: "#f8f8ff";
139
- readonly gold: "#ffd700";
140
- readonly goldenrod: "#daa520";
141
- readonly gray: "#808080";
142
- readonly green: "#008000";
143
- readonly greenyellow: "#adff2f";
144
- readonly grey: "#808080";
145
- readonly honeydew: "#f0fff0";
146
- readonly hotpink: "#ff69b4";
147
- readonly indianred: "#cd5c5c";
148
- readonly indigo: "#4b0082";
149
- readonly ivory: "#fffff0";
150
- readonly khaki: "#f0e68c";
151
- readonly lavender: "#e6e6fa";
152
- readonly lavenderblush: "#fff0f5";
153
- readonly lawngreen: "#7cfc00";
154
- readonly lemonchiffon: "#fffacd";
155
- readonly lightblue: "#add8e6";
156
- readonly lightcoral: "#f08080";
157
- readonly lightcyan: "#e0ffff";
158
- readonly lightgoldenrodyellow: "#fafad2";
159
- readonly lightgray: "#d3d3d3";
160
- readonly lightgreen: "#90ee90";
161
- readonly lightgrey: "#d3d3d3";
162
- readonly lightpink: "#ffb6c1";
163
- readonly lightsalmon: "#ffa07a";
164
- readonly lightseagreen: "#20b2aa";
165
- readonly lightskyblue: "#87cefa";
166
- readonly lightslategray: "#778899";
167
- readonly lightslategrey: "#778899";
168
- readonly lightsteelblue: "#b0c4de";
169
- readonly lightyellow: "#ffffe0";
170
- readonly lime: "#00ff00";
171
- readonly limegreen: "#32cd32";
172
- readonly linen: "#faf0e6";
173
- readonly magenta: "#ff00ff";
174
- readonly maroon: "#800000";
175
- readonly mediumaquamarine: "#66cdaa";
176
- readonly mediumblue: "#0000cd";
177
- readonly mediumorchid: "#ba55d3";
178
- readonly mediumpurple: "#9370db";
179
- readonly mediumseagreen: "#3cb371";
180
- readonly mediumslateblue: "#7b68ee";
181
- readonly mediumspringgreen: "#00fa9a";
182
- readonly mediumturquoise: "#48d1cc";
183
- readonly mediumvioletred: "#c71585";
184
- readonly midnightblue: "#191970";
185
- readonly mintcream: "#f5fffa";
186
- readonly mistyrose: "#ffe4e1";
187
- readonly moccasin: "#ffe4b5";
188
- readonly navajowhite: "#ffdead";
189
- readonly navy: "#000080";
190
- readonly oldlace: "#fdf5e6";
191
- readonly olive: "#808000";
192
- readonly olivedrab: "#6b8e23";
193
- readonly orange: "#ffa500";
194
- readonly orangered: "#ff4500";
195
- readonly orchid: "#da70d6";
196
- readonly palegoldenrod: "#eee8aa";
197
- readonly palegreen: "#98fb98";
198
- readonly paleturquoise: "#afeeee";
199
- readonly palevioletred: "#db7093";
200
- readonly papayawhip: "#ffefd5";
201
- readonly peachpuff: "#ffdab9";
202
- readonly peru: "#cd853f";
203
- readonly pink: "#ffc0cb";
204
- readonly plum: "#dda0dd";
205
- readonly powderblue: "#b0e0e6";
206
- readonly purple: "#800080";
207
- readonly rebeccapurple: "#663399";
208
- readonly red: "#ff0000";
209
- readonly rosybrown: "#bc8f8f";
210
- readonly royalblue: "#4169e1";
211
- readonly saddlebrown: "#8b4513";
212
- readonly salmon: "#fa8072";
213
- readonly sandybrown: "#f4a460";
214
- readonly seagreen: "#2e8b57";
215
- readonly seashell: "#fff5ee";
216
- readonly sienna: "#a0522d";
217
- readonly silver: "#c0c0c0";
218
- readonly skyblue: "#87ceeb";
219
- readonly slateblue: "#6a5acd";
220
- readonly slategray: "#708090";
221
- readonly slategrey: "#708090";
222
- readonly snow: "#fffafa";
223
- readonly springgreen: "#00ff7f";
224
- readonly steelblue: "#4682b4";
225
- readonly tan: "#d2b48c";
226
- readonly teal: "#008080";
227
- readonly thistle: "#d8bfd8";
228
- readonly transparent: "rgba(0, 0, 0, 0)";
229
- readonly tomato: "#ff6347";
230
- readonly turquoise: "#40e0d0";
231
- readonly violet: "#ee82ee";
232
- readonly wheat: "#f5deb3";
233
- readonly white: "#ffffff";
234
- readonly whitesmoke: "#f5f5f5";
235
- readonly yellow: "#ffff00";
236
- readonly yellowgreen: "#9acd32";
237
- readonly padaleckipink: "oklch(100% 0.42 360deg / 71.70%)";
238
- readonly "lodge blu color": "rgb(53\t101\t144)";
239
- readonly lavendi: "oklch(79.90% 0.11 318.24deg / 100%)";
240
- readonly shadyshroom: "oklch(53% 0.07 21.60deg / 100%)";
241
- readonly patriarchalplum: "oklch(31.20% 0.11 19.80deg / 100%)";
242
- };
243
-
244
- export declare const COLOR_SPACE_DENORM_UNITS: {
245
- readonly rgb: {
246
- readonly r: "";
247
- readonly g: "";
248
- readonly b: "";
249
- readonly alpha: "%";
250
- };
251
- readonly hsl: {
252
- readonly h: "deg";
253
- readonly s: "%";
254
- readonly l: "%";
255
- readonly alpha: "%";
256
- };
257
- readonly hsv: {
258
- readonly h: "deg";
259
- readonly s: "%";
260
- readonly v: "%";
261
- readonly alpha: "%";
262
- };
263
- readonly hwb: {
264
- readonly h: "deg";
265
- readonly w: "%";
266
- readonly b: "%";
267
- readonly alpha: "%";
268
- };
269
- readonly lab: {
270
- readonly l: "%";
271
- readonly a: "";
272
- readonly b: "";
273
- readonly alpha: "%";
274
- };
275
- readonly lch: {
276
- readonly l: "%";
277
- readonly c: "";
278
- readonly h: "deg";
279
- readonly alpha: "%";
280
- };
281
- readonly oklab: {
282
- readonly l: "%";
283
- readonly a: "";
284
- readonly b: "";
285
- readonly alpha: "%";
286
- };
287
- readonly oklch: {
288
- readonly l: "%";
289
- readonly c: "";
290
- readonly h: "deg";
291
- readonly alpha: "%";
292
- };
293
- readonly xyz: {
294
- readonly x: "%";
295
- readonly y: "%";
296
- readonly z: "%";
297
- readonly alpha: "%";
298
- };
299
- readonly kelvin: {
300
- readonly kelvin: "K";
301
- readonly alpha: "%";
302
- };
303
- readonly "srgb-linear": {
304
- readonly r: "";
305
- readonly g: "";
306
- readonly b: "";
307
- readonly alpha: "%";
308
- };
309
- readonly "display-p3": {
310
- readonly r: "";
311
- readonly g: "";
312
- readonly b: "";
313
- readonly alpha: "%";
314
- };
315
- readonly "a98-rgb": {
316
- readonly r: "";
317
- readonly g: "";
318
- readonly b: "";
319
- readonly alpha: "%";
320
- };
321
- readonly "prophoto-rgb": {
322
- readonly r: "";
323
- readonly g: "";
324
- readonly b: "";
325
- readonly alpha: "%";
326
- };
327
- readonly rec2020: {
328
- readonly r: "";
329
- readonly g: "";
330
- readonly b: "";
331
- readonly alpha: "%";
332
- };
333
- };
334
-
335
- export declare const COLOR_SPACE_NAMES: {
336
- readonly rgb: "RGB";
337
- readonly hsl: "HSL";
338
- readonly hsv: "HSV";
339
- readonly hwb: "HWB";
340
- readonly lab: "Lab";
341
- readonly lch: "LCh";
342
- readonly oklab: "OKLab";
343
- readonly oklch: "OKLCh";
344
- readonly xyz: "XYZ";
345
- readonly kelvin: "Kelvin";
346
- readonly "srgb-linear": "sRGB Linear";
347
- readonly "display-p3": "Display P3";
348
- readonly "a98-rgb": "Adobe RGB";
349
- readonly "prophoto-rgb": "ProPhoto RGB";
350
- readonly rec2020: "Rec. 2020";
351
- };
352
-
353
- export declare const COLOR_SPACE_RANGES: {
354
- readonly rgb: {
355
- readonly r: {
356
- readonly "%": {
357
- readonly min: 0;
358
- readonly max: 100;
359
- };
360
- readonly number: {
361
- readonly min: 0;
362
- readonly max: 255;
363
- };
364
- };
365
- readonly g: {
366
- readonly "%": {
367
- readonly min: 0;
368
- readonly max: 100;
369
- };
370
- readonly number: {
371
- readonly min: 0;
372
- readonly max: 255;
373
- };
374
- };
375
- readonly b: {
376
- readonly "%": {
377
- readonly min: 0;
378
- readonly max: 100;
379
- };
380
- readonly number: {
381
- readonly min: 0;
382
- readonly max: 255;
383
- };
384
- };
385
- readonly alpha: {
386
- readonly "%": {
387
- readonly min: 0;
388
- readonly max: 100;
389
- };
390
- readonly number: {
391
- readonly min: 0;
392
- readonly max: 1;
393
- };
394
- };
395
- };
396
- readonly hsl: {
397
- readonly h: {
398
- readonly deg: {
399
- readonly min: 0;
400
- readonly max: 360;
401
- };
402
- readonly number: {
403
- readonly min: 0;
404
- readonly max: 360;
405
- };
406
- readonly "%": {
407
- readonly min: 0;
408
- readonly max: 100;
409
- };
410
- };
411
- readonly s: {
412
- readonly "%": {
413
- readonly min: 0;
414
- readonly max: 100;
415
- };
416
- readonly number: {
417
- readonly min: 0;
418
- readonly max: 1;
419
- };
420
- };
421
- readonly l: {
422
- readonly "%": {
423
- readonly min: 0;
424
- readonly max: 100;
425
- };
426
- readonly number: {
427
- readonly min: 0;
428
- readonly max: 1;
429
- };
430
- };
431
- readonly alpha: {
432
- readonly "%": {
433
- readonly min: 0;
434
- readonly max: 100;
435
- };
436
- readonly number: {
437
- readonly min: 0;
438
- readonly max: 1;
439
- };
440
- };
441
- };
442
- readonly hsv: {
443
- readonly h: {
444
- readonly deg: {
445
- readonly min: 0;
446
- readonly max: 360;
447
- };
448
- readonly number: {
449
- readonly min: 0;
450
- readonly max: 360;
451
- };
452
- readonly "%": {
453
- readonly min: 0;
454
- readonly max: 100;
455
- };
456
- };
457
- readonly s: {
458
- readonly "%": {
459
- readonly min: 0;
460
- readonly max: 100;
461
- };
462
- readonly number: {
463
- readonly min: 0;
464
- readonly max: 1;
465
- };
466
- };
467
- readonly v: {
468
- readonly "%": {
469
- readonly min: 0;
470
- readonly max: 100;
471
- };
472
- readonly number: {
473
- readonly min: 0;
474
- readonly max: 1;
475
- };
476
- };
477
- readonly alpha: {
478
- readonly "%": {
479
- readonly min: 0;
480
- readonly max: 100;
481
- };
482
- readonly number: {
483
- readonly min: 0;
484
- readonly max: 1;
485
- };
486
- };
487
- };
488
- readonly hwb: {
489
- readonly h: {
490
- readonly deg: {
491
- readonly min: 0;
492
- readonly max: 360;
493
- };
494
- readonly number: {
495
- readonly min: 0;
496
- readonly max: 360;
497
- };
498
- readonly "%": {
499
- readonly min: 0;
500
- readonly max: 100;
501
- };
502
- };
503
- readonly w: {
504
- readonly "%": {
505
- readonly min: 0;
506
- readonly max: 100;
507
- };
508
- readonly number: {
509
- readonly min: 0;
510
- readonly max: 1;
511
- };
512
- };
513
- readonly b: {
514
- readonly "%": {
515
- readonly min: 0;
516
- readonly max: 100;
517
- };
518
- readonly number: {
519
- readonly min: 0;
520
- readonly max: 1;
521
- };
522
- };
523
- readonly alpha: {
524
- readonly "%": {
525
- readonly min: 0;
526
- readonly max: 100;
527
- };
528
- readonly number: {
529
- readonly min: 0;
530
- readonly max: 1;
531
- };
532
- };
533
- };
534
- readonly lab: {
535
- readonly l: {
536
- readonly "%": {
537
- readonly min: 0;
538
- readonly max: 100;
539
- };
540
- readonly number: {
541
- readonly min: 0;
542
- readonly max: 100;
543
- };
544
- };
545
- readonly a: {
546
- readonly number: {
547
- readonly min: -125;
548
- readonly max: 125;
549
- };
550
- readonly "%": {
551
- readonly min: -100;
552
- readonly max: 100;
553
- };
554
- };
555
- readonly b: {
556
- readonly number: {
557
- readonly min: -125;
558
- readonly max: 125;
559
- };
560
- readonly "%": {
561
- readonly min: -100;
562
- readonly max: 100;
563
- };
564
- };
565
- readonly alpha: {
566
- readonly "%": {
567
- readonly min: 0;
568
- readonly max: 100;
569
- };
570
- readonly number: {
571
- readonly min: 0;
572
- readonly max: 1;
573
- };
574
- };
575
- };
576
- readonly lch: {
577
- readonly l: {
578
- readonly "%": {
579
- readonly min: 0;
580
- readonly max: 100;
581
- };
582
- readonly number: {
583
- readonly min: 0;
584
- readonly max: 100;
585
- };
586
- };
587
- readonly c: {
588
- readonly number: {
589
- readonly min: 0;
590
- readonly max: 150;
591
- };
592
- readonly "%": {
593
- readonly min: 0;
594
- readonly max: 100;
595
- };
596
- };
597
- readonly h: {
598
- readonly deg: {
599
- readonly min: 0;
600
- readonly max: 360;
601
- };
602
- readonly number: {
603
- readonly min: 0;
604
- readonly max: 360;
605
- };
606
- readonly "%": {
607
- readonly min: 0;
608
- readonly max: 100;
609
- };
610
- };
611
- readonly alpha: {
612
- readonly "%": {
613
- readonly min: 0;
614
- readonly max: 100;
615
- };
616
- readonly number: {
617
- readonly min: 0;
618
- readonly max: 1;
619
- };
620
- };
621
- };
622
- readonly oklab: {
623
- readonly l: {
624
- readonly "%": {
625
- readonly min: 0;
626
- readonly max: 100;
627
- };
628
- readonly number: {
629
- readonly min: 0;
630
- readonly max: 1;
631
- };
632
- };
633
- readonly a: {
634
- readonly number: {
635
- readonly min: -0.4;
636
- readonly max: 0.4;
637
- };
638
- readonly "%": {
639
- readonly min: -100;
640
- readonly max: 100;
641
- };
642
- };
643
- readonly b: {
644
- readonly number: {
645
- readonly min: -0.4;
646
- readonly max: 0.4;
647
- };
648
- readonly "%": {
649
- readonly min: -100;
650
- readonly max: 100;
651
- };
652
- };
653
- readonly alpha: {
654
- readonly "%": {
655
- readonly min: 0;
656
- readonly max: 100;
657
- };
658
- readonly number: {
659
- readonly min: 0;
660
- readonly max: 1;
661
- };
662
- };
663
- };
664
- readonly oklch: {
665
- readonly l: {
666
- readonly "%": {
667
- readonly min: 0;
668
- readonly max: 100;
669
- };
670
- readonly number: {
671
- readonly min: 0;
672
- readonly max: 1;
673
- };
674
- };
675
- readonly c: {
676
- readonly number: {
677
- readonly min: 0;
678
- readonly max: 0.5;
679
- };
680
- readonly "%": {
681
- readonly min: 0;
682
- readonly max: 100;
683
- };
684
- };
685
- readonly h: {
686
- readonly deg: {
687
- readonly min: 0;
688
- readonly max: 360;
689
- };
690
- readonly number: {
691
- readonly min: 0;
692
- readonly max: 360;
693
- };
694
- readonly "%": {
695
- readonly min: 0;
696
- readonly max: 100;
697
- };
698
- };
699
- readonly alpha: {
700
- readonly "%": {
701
- readonly min: 0;
702
- readonly max: 100;
703
- };
704
- readonly number: {
705
- readonly min: 0;
706
- readonly max: 1;
707
- };
708
- };
709
- };
710
- readonly xyz: {
711
- readonly x: {
712
- readonly "%": {
713
- readonly min: 0;
714
- readonly max: 100;
715
- };
716
- readonly number: {
717
- readonly min: 0;
718
- readonly max: 1;
719
- };
720
- };
721
- readonly y: {
722
- readonly "%": {
723
- readonly min: 0;
724
- readonly max: 100;
725
- };
726
- readonly number: {
727
- readonly min: 0;
728
- readonly max: 1;
729
- };
730
- };
731
- readonly z: {
732
- readonly "%": {
733
- readonly min: 0;
734
- readonly max: 100;
735
- };
736
- readonly number: {
737
- readonly min: 0;
738
- readonly max: 1;
739
- };
740
- };
741
- readonly alpha: {
742
- readonly "%": {
743
- readonly min: 0;
744
- readonly max: 100;
745
- };
746
- readonly number: {
747
- readonly min: 0;
748
- readonly max: 1;
749
- };
750
- };
751
- };
752
- readonly kelvin: {
753
- readonly kelvin: {
754
- readonly number: {
755
- readonly min: 1000;
756
- readonly max: 40000;
757
- };
758
- };
759
- readonly alpha: {
760
- readonly "%": {
761
- readonly min: 0;
762
- readonly max: 100;
763
- };
764
- readonly number: {
765
- readonly min: 0;
766
- readonly max: 1;
767
- };
768
- };
769
- };
770
- readonly "srgb-linear": {
771
- readonly r: {
772
- readonly "%": {
773
- readonly min: 0;
774
- readonly max: 100;
775
- };
776
- readonly number: {
777
- readonly min: 0;
778
- readonly max: 1;
779
- };
780
- };
781
- readonly g: {
782
- readonly "%": {
783
- readonly min: 0;
784
- readonly max: 100;
785
- };
786
- readonly number: {
787
- readonly min: 0;
788
- readonly max: 1;
789
- };
790
- };
791
- readonly b: {
792
- readonly "%": {
793
- readonly min: 0;
794
- readonly max: 100;
795
- };
796
- readonly number: {
797
- readonly min: 0;
798
- readonly max: 1;
799
- };
800
- };
801
- readonly alpha: {
802
- readonly "%": {
803
- readonly min: 0;
804
- readonly max: 100;
805
- };
806
- readonly number: {
807
- readonly min: 0;
808
- readonly max: 1;
809
- };
810
- };
811
- };
812
- readonly "display-p3": {
813
- readonly r: {
814
- readonly "%": {
815
- readonly min: 0;
816
- readonly max: 100;
817
- };
818
- readonly number: {
819
- readonly min: 0;
820
- readonly max: 1;
821
- };
822
- };
823
- readonly g: {
824
- readonly "%": {
825
- readonly min: 0;
826
- readonly max: 100;
827
- };
828
- readonly number: {
829
- readonly min: 0;
830
- readonly max: 1;
831
- };
832
- };
833
- readonly b: {
834
- readonly "%": {
835
- readonly min: 0;
836
- readonly max: 100;
837
- };
838
- readonly number: {
839
- readonly min: 0;
840
- readonly max: 1;
841
- };
842
- };
843
- readonly alpha: {
844
- readonly "%": {
845
- readonly min: 0;
846
- readonly max: 100;
847
- };
848
- readonly number: {
849
- readonly min: 0;
850
- readonly max: 1;
851
- };
852
- };
853
- };
854
- readonly "a98-rgb": {
855
- readonly r: {
856
- readonly "%": {
857
- readonly min: 0;
858
- readonly max: 100;
859
- };
860
- readonly number: {
861
- readonly min: 0;
862
- readonly max: 1;
863
- };
864
- };
865
- readonly g: {
866
- readonly "%": {
867
- readonly min: 0;
868
- readonly max: 100;
869
- };
870
- readonly number: {
871
- readonly min: 0;
872
- readonly max: 1;
873
- };
874
- };
875
- readonly b: {
876
- readonly "%": {
877
- readonly min: 0;
878
- readonly max: 100;
879
- };
880
- readonly number: {
881
- readonly min: 0;
882
- readonly max: 1;
883
- };
884
- };
885
- readonly alpha: {
886
- readonly "%": {
887
- readonly min: 0;
888
- readonly max: 100;
889
- };
890
- readonly number: {
891
- readonly min: 0;
892
- readonly max: 1;
893
- };
894
- };
895
- };
896
- readonly "prophoto-rgb": {
897
- readonly r: {
898
- readonly "%": {
899
- readonly min: 0;
900
- readonly max: 100;
901
- };
902
- readonly number: {
903
- readonly min: 0;
904
- readonly max: 1;
905
- };
906
- };
907
- readonly g: {
908
- readonly "%": {
909
- readonly min: 0;
910
- readonly max: 100;
911
- };
912
- readonly number: {
913
- readonly min: 0;
914
- readonly max: 1;
915
- };
916
- };
917
- readonly b: {
918
- readonly "%": {
919
- readonly min: 0;
920
- readonly max: 100;
921
- };
922
- readonly number: {
923
- readonly min: 0;
924
- readonly max: 1;
925
- };
926
- };
927
- readonly alpha: {
928
- readonly "%": {
929
- readonly min: 0;
930
- readonly max: 100;
931
- };
932
- readonly number: {
933
- readonly min: 0;
934
- readonly max: 1;
935
- };
936
- };
937
- };
938
- readonly rec2020: {
939
- readonly r: {
940
- readonly "%": {
941
- readonly min: 0;
942
- readonly max: 100;
943
- };
944
- readonly number: {
945
- readonly min: 0;
946
- readonly max: 1;
947
- };
948
- };
949
- readonly g: {
950
- readonly "%": {
951
- readonly min: 0;
952
- readonly max: 100;
953
- };
954
- readonly number: {
955
- readonly min: 0;
956
- readonly max: 1;
957
- };
958
- };
959
- readonly b: {
960
- readonly "%": {
961
- readonly min: 0;
962
- readonly max: 100;
963
- };
964
- readonly number: {
965
- readonly min: 0;
966
- readonly max: 1;
967
- };
968
- };
969
- readonly alpha: {
970
- readonly "%": {
971
- readonly min: 0;
972
- readonly max: 100;
973
- };
974
- readonly number: {
975
- readonly min: 0;
976
- readonly max: 1;
977
- };
978
- };
979
- };
980
- };
981
-
982
- export declare const COLOR_UNITS: readonly ["color"];
983
-
984
- export declare type ColorSpace = keyof typeof COLOR_SPACE_RANGES;
985
-
986
- export declare type ColorSpaceMap<T> = {
987
- rgb: RGBColor<T>;
988
- hsl: HSLColor<T>;
989
- hsv: HSVColor<T>;
990
- hwb: HWBColor<T>;
991
- lab: LABColor<T>;
992
- lch: LCHColor<T>;
993
- oklab: OKLABColor<T>;
994
- oklch: OKLCHColor<T>;
995
- kelvin: KelvinColor<T>;
996
- xyz: XYZColor<T>;
997
- "srgb-linear": LinearSRGBColor<T>;
998
- "display-p3": DisplayP3Color<T>;
999
- "a98-rgb": AdobeRGBColor<T>;
1000
- "prophoto-rgb": ProPhotoRGBColor<T>;
1001
- rec2020: Rec2020Color<T>;
1002
- };
1003
-
1004
- 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">;
1005
-
1006
- declare type ComponentExpr = {
1007
- type: "ref";
1008
- name: string;
1009
- } | {
1010
- type: "calc";
1011
- expr: string;
1012
- } | {
1013
- type: "literal";
1014
- value: number;
1015
- } | {
1016
- type: "none";
1017
- };
1018
-
1019
- export declare const COMPUTED_UNITS: readonly ["var", "calc"];
1020
-
1021
- /**
1022
- * Compute the maximum saturation S = C/L for a given hue direction (a_, b_)
1023
- * where a_² + b_² ≈ 1. Uses a polynomial initial guess refined by one
1024
- * Halley's method step for cubic convergence.
1025
- */
1026
- export declare function computeMaxSaturation(a_: number, b_: number): number;
1027
-
1028
- export declare function convert2(value: number, from: (typeof UNITS)[number], to: (typeof UNITS)[number], target?: HTMLElement): number;
1029
-
1030
- export declare function convertAbsoluteUnitToPixels(value: number, unit: string): number;
1031
-
1032
- export declare function convertToDegrees(value: number, unit: (typeof ANGLE_UNITS)[number]): number;
1033
-
1034
- export declare function convertToDPI(value: number, unit: (typeof RESOLUTION_UNITS)[number]): number;
1035
-
1036
- export declare function convertToHz(value: number, unit: (typeof FREQUENCY_UNITS)[number]): number;
1037
-
1038
- export declare function convertToMs(value: number, unit: (typeof TIME_UNITS)[number]): number;
1039
-
1040
- 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;
1041
-
1042
- export declare function createHash(algorithm: string, data: string): Promise<string>;
1043
-
1044
- export declare const CSS_WIDE_KEYWORDS: readonly ["inherit", "initial", "unset", "revert", "revert-layer"];
1045
-
1046
- export declare const CSSColor: {
1047
- Value: Parser<ValueUnit<any, string | undefined>>;
1048
- colorValue: Parser<ValueUnit<any, string | undefined>>;
1049
- componentExpr: Parser<ComponentExpr>;
1050
- sep: Parser<string>;
1051
- alphaSep: Parser<string>;
1052
- div: Parser<string>;
1053
- };
1054
-
1055
- export declare const CSSCubicBezier: (x1: number, y1: number, x2: number, y2: number) => (x: number) => number;
1056
-
1057
- export declare function cssFiltersToString(filters: number[]): string;
1058
-
1059
- export declare const CSSFunction: {
1060
- Function: Parser<any>;
1061
- Value: Parser<any>;
1062
- FunctionArgs: Parser<ValueArray<any>>;
1063
- };
1064
-
1065
- export declare const CSSJSON: Parser<ValueUnit<any, string>>;
1066
-
1067
- export declare function cssLinear(stops: LinearStop[]): (t: number) => number;
1068
-
1069
- export declare const CSSString: Parser<ValueUnit<string, string | undefined>>;
1070
-
1071
- export declare const CSSValues: {
1072
- Value: Parser<any>;
1073
- Values: Parser<any[]>;
1074
- };
1075
-
1076
- export declare const CSSValueUnit: {
1077
- Length: Parser<ValueUnit<number, string>>;
1078
- Angle: Parser<ValueUnit<number, string>>;
1079
- Time: Parser<ValueUnit<number, string>>;
1080
- TimePercentage: Parser<ValueUnit<any, string | undefined>>;
1081
- Frequency: Parser<ValueUnit<number, string>>;
1082
- Resolution: Parser<ValueUnit<number, string>>;
1083
- Flex: Parser<ValueUnit<number, string>>;
1084
- Percentage: Parser<ValueUnit<any, string | undefined>>;
1085
- Color: Parser<ValueUnit<any, string | undefined>>;
1086
- Slash: Parser<ValueUnit<string, string>>;
1087
- Value: Parser<ValueUnit<any, string | undefined>>;
1088
- sep: Parser<string>;
1089
- };
1090
-
1091
- export declare function cubicBezier(t: number, x1: number, y1: number, x2: number, y2: number): number[];
1092
-
1093
- export declare function cubicBezierToString(x1: number, y1: number, x2: number, y2: number): string;
1094
-
1095
- export declare function cubicBezierToSVG(x1: number, y1: number, x2: number, y2: number): string;
1096
-
1097
- export declare const CYLINDRICAL_HUE_COMPONENT: Partial<Record<ColorSpace, string>>;
1098
-
1099
- export declare function debounce<T extends (...args: any[]) => any>(func: T, wait?: number, immediate?: boolean): ((...args: Parameters<T>) => void) & {
1100
- cancel: () => void;
1101
- };
1102
-
1103
- export declare function deCasteljau(t: number, points: number[]): number;
1104
-
1105
- export declare interface DecomposedMatrix2D {
1106
- translateX: number;
1107
- translateY: number;
1108
- scaleX: number;
1109
- scaleY: number;
1110
- angle: number;
1111
- skew: number;
1112
- }
1113
-
1114
- export declare interface DecomposedMatrix3D {
1115
- translate: [number, number, number];
1116
- scale: [number, number, number];
1117
- skew: [number, number, number];
1118
- quaternion: Vec4;
1119
- perspective: Vec4;
1120
- }
1121
-
1122
- /**
1123
- * Decompose a 2D CSS matrix(a, b, c, d, e, f) into translate, scale, rotation, and skew.
1124
- *
1125
- * The matrix maps like:
1126
- * | a c e |
1127
- * | b d f |
1128
- * | 0 0 1 |
1129
- */
1130
- export declare function decomposeMatrix2D(a: number, b: number, c: number, d: number, e: number, f: number): DecomposedMatrix2D;
1131
-
1132
- /**
1133
- * Decompose a CSS matrix3d (16 values in column-major CSS order) into
1134
- * translate, scale, skew, rotation (quaternion), and perspective.
1135
- *
1136
- * CSS `matrix3d(a1,b1,c1,d1, a2,b2,c2,d2, a3,b3,c3,d3, a4,b4,c4,d4)` maps to:
1137
- * | a1 a2 a3 a4 |
1138
- * | b1 b2 b3 b4 |
1139
- * | c1 c2 c3 c4 |
1140
- * | d1 d2 d3 d4 |
1141
- * The parameter order is already column-major: [a1,b1,c1,d1, a2,b2,c2,d2, ...].
1142
- *
1143
- * Based on the "unmatrix" algorithm from the CSS Transforms spec.
1144
- */
1145
- export declare function decomposeMatrix3D(cssValues: number[]): DecomposedMatrix3D | null;
1146
-
1147
- /**
1148
- * Analytical sRGB gamut mapping based on Bjorn Ottosson's ok_color.h
1149
- * https://bottosson.github.io/posts/gamutclipping/
1150
- *
1151
- * Strategy: adaptive L0 (alpha=0.05) — deterministic, zero-iteration,
1152
- * perceptually correct in OKLab with exact hue preservation.
1153
- *
1154
- * MIT License — Copyright (c) 2021 Bjorn Ottosson
1155
- */
1156
- export declare const DELTA_E_OK_JND = 0.02;
1157
-
1158
- export declare function deltaEOK(L1: number, a1: number, b1: number, L2: number, a2: number, b2: number): number;
1159
-
1160
- export declare function displayP32xyz({ r, g, b, alpha }: DisplayP3Color): XYZColor;
1161
-
1162
- export declare class DisplayP3Color<T = number> extends Color<T> {
1163
- constructor(r: T, g: T, b: T, alpha?: T);
1164
- get r(): T;
1165
- set r(value: T);
1166
- get g(): T;
1167
- set g(value: T);
1168
- get b(): T;
1169
- set b(value: T);
1170
- }
1171
-
1172
- export declare function easeInBounce(t: number): number;
1173
-
1174
- export declare function easeInCirc(t: number): number;
1175
-
1176
- export declare function easeInCubic(t: number): number;
1177
-
1178
- export declare function easeInExpo(t: number): number;
1179
-
1180
- export declare function easeInOutCirc(t: number): number;
1181
-
1182
- export declare function easeInOutCubic(t: number): number;
1183
-
1184
- export declare function easeInOutExpo(t: number): number;
1185
-
1186
- export declare function easeInOutQuad(t: number): number;
1187
-
1188
- export declare function easeInOutSine(t: number): number;
1189
-
1190
- export declare function easeInQuad(t: number): number;
1191
-
1192
- export declare function easeInSine(t: number): number;
1193
-
1194
- export declare function easeOutCirc(t: number): number;
1195
-
1196
- export declare function easeOutCubic(t: number): number;
1197
-
1198
- export declare function easeOutExpo(t: number): number;
1199
-
1200
- export declare function easeOutQuad(t: number): number;
1201
-
1202
- export declare function easeOutSine(t: number): number;
1203
-
1204
- /**
1205
- * Evaluate a math FunctionValue to a numeric ValueUnit.
1206
- * Returns null if the expression can't be fully resolved.
1207
- *
1208
- * The result unit is determined by the first resolvable argument's unit,
1209
- * since CSS requires type-compatible arguments.
1210
- */
1211
- export declare function evaluateMathFunction(fn: FunctionValue): ValueUnit | null;
1212
-
1213
- /** Parser that always fails with the given message. */
1214
- export declare function fail(message: string): Parser<never>;
1215
-
1216
- /**
1217
- * Find the cusp (L_cusp, C_cusp) — the point of maximum chroma on the
1218
- * gamut boundary for a given hue direction.
1219
- */
1220
- export declare function findCusp(a_: number, b_: number): {
1221
- L: number;
1222
- C: number;
1223
- };
1224
-
1225
- /**
1226
- * Find the parameter t where the ray from (L0, 0) through (L1, C1)
1227
- * intersects the sRGB gamut boundary. Returns t ∈ [0,1].
1228
- *
1229
- * Lower half uses closed-form; upper half uses one Halley's method step.
1230
- */
1231
- export declare function findGamutIntersection(a_: number, b_: number, L1: number, C1: number, L0: number, cusp: {
1232
- L: number;
1233
- C: number;
1234
- }): number;
1235
-
1236
- export declare const flattenObject: (obj: any) => Record<string, any>;
1237
-
1238
- export declare const FLEX_UNITS: readonly ["fr"];
1239
-
1240
- export declare const FRAME_RATE: number;
1241
-
1242
- export declare const FREQUENCY_UNITS: readonly ["Hz", "kHz"];
1243
-
1244
- export declare class FunctionValue<T = any, N extends string = string> {
1245
- name: N;
1246
- values: Array<ValueUnit<T> | FunctionValue<T>>;
1247
- constructor(name: N, values: Array<ValueUnit<T> | FunctionValue<T>>);
1248
- setSubProperty(subProperty: any): void;
1249
- setProperty(property: any): void;
1250
- setTargets(targets: HTMLElement[]): void;
1251
- setValue(value: T, index?: number): void;
1252
- valueOf(): any[];
1253
- toString(): string;
1254
- toJSON(): Record<string, any[]>;
1255
- clone(): FunctionValue<T>;
1256
- }
1257
-
1258
- export declare const GAMUT_SECTOR_COEFFICIENTS: readonly [{
1259
- readonly test: (a: number, b: number) => boolean;
1260
- readonly k0: 1.19086277;
1261
- readonly k1: 1.76576728;
1262
- readonly k2: 0.59662641;
1263
- readonly k3: 0.75515197;
1264
- readonly k4: 0.56771245;
1265
- readonly wl: 4.0767416621;
1266
- readonly wm: -3.3077115913;
1267
- readonly ws: 0.2309699292;
1268
- }, {
1269
- readonly test: (a: number, b: number) => boolean;
1270
- readonly k0: 0.73956515;
1271
- readonly k1: -0.45954404;
1272
- readonly k2: 0.08285427;
1273
- readonly k3: 0.1254107;
1274
- readonly k4: 0.14503204;
1275
- readonly wl: -1.2684380046;
1276
- readonly wm: 2.6097574011;
1277
- readonly ws: -0.3413193965;
1278
- }, {
1279
- readonly test: () => boolean;
1280
- readonly k0: 1.35733652;
1281
- readonly k1: -0.00915799;
1282
- readonly k2: -1.1513021;
1283
- readonly k3: -0.50559606;
1284
- readonly k4: 0.00692167;
1285
- readonly wl: -0.0041960863;
1286
- readonly wm: -0.7034186147;
1287
- readonly ws: 1.707614701;
1288
- }];
1289
-
1290
- export declare function gamutMap<C extends Color>(color: C): C;
1291
-
1292
- /**
1293
- * Core gamut mapping in raw OKLab space.
1294
- * Adaptive L0 strategy (alpha=0.05) — preserves hue exactly.
1295
- *
1296
- * Input/output: raw OKLab (L ∈ [0,1], a,b ∈ [-0.4,0.4]).
1297
- * Returns the mapped (L, a, b) tuple.
1298
- */
1299
- export declare function gamutMapOKLab(L: number, a: number, b: number): [number, number, number];
1300
-
1301
- /**
1302
- * Map an sRGB color (components may be outside [0,1]) to in-gamut sRGB.
1303
- * Returns clamped sRGB [0,1]³.
1304
- */
1305
- export declare function gamutMapSRGB(r: number, g: number, b: number): [number, number, number];
1306
-
1307
- export declare const getComputedValue: ((value: ValueUnit, target: HTMLElement) => ValueUnit<any, any>) & {
1308
- cache: Map<string, {
1309
- value: ValueUnit<any, any>;
1310
- timestamp: number;
1311
- }>;
1312
- };
1313
-
1314
- export declare const getFormattedColorSpaceRange: <T extends ColorSpace>(colorSpace: T) => ColorSpaceMap<{
1315
- min: string;
1316
- max: string;
1317
- }>[T];
1318
-
1319
- export declare const hex2rgb: (hex: string) => RGBColor;
1320
-
1321
- export declare const hsl2hsv: ({ h, s, l, alpha }: HSLColor) => HSVColor;
1322
-
1323
- export declare const hsl2hwb: ({ h, s, l, alpha }: HSLColor) => HWBColor;
1324
-
1325
- export declare function hsl2rgb({ h, s, l, alpha }: HSLColor): RGBColor;
1326
-
1327
- export declare function hsl2xyz(hsl: HSLColor): XYZColor<number>;
1328
-
1329
- export declare class HSLColor<T = number> extends Color<T> {
1330
- constructor(h: T, s: T, l: T, alpha?: T);
1331
- get h(): T;
1332
- set h(value: T);
1333
- get s(): T;
1334
- set s(value: T);
1335
- get l(): T;
1336
- set l(value: T);
1337
- }
1338
-
1339
- export declare const hsv2hsl: ({ h, s, v, alpha }: HSVColor) => HSLColor;
1340
-
1341
- export declare function hsv2xyz(hsv: HSVColor): XYZColor;
1342
-
1343
- export declare class HSVColor<T = number> extends Color<T> {
1344
- constructor(h: T, s: T, v: T, alpha?: T);
1345
- get h(): T;
1346
- set h(value: T);
1347
- get s(): T;
1348
- set s(value: T);
1349
- get v(): T;
1350
- set v(value: T);
1351
- }
1352
-
1353
- export declare const HUE_RANGE: {
1354
- readonly deg: {
1355
- readonly min: 0;
1356
- readonly max: 360;
1357
- };
1358
- readonly number: {
1359
- readonly min: 0;
1360
- readonly max: 360;
1361
- };
1362
- readonly "%": {
1363
- readonly min: 0;
1364
- readonly max: 100;
1365
- };
1366
- };
1367
-
1368
- export declare type HueInterpolationMethod = "shorter" | "longer" | "increasing" | "decreasing";
1369
-
1370
- export declare const hwb2hsl: ({ h, w, b, alpha }: HWBColor) => HSLColor;
1371
-
1372
- export declare function hwb2xyz(hwb: HWBColor): XYZColor;
1373
-
1374
- export declare class HWBColor<T = number> extends Color<T> {
1375
- constructor(h: T, w: T, b: T, alpha?: T);
1376
- get h(): T;
1377
- set h(value: T);
1378
- get w(): T;
1379
- set w(value: T);
1380
- get b(): T;
1381
- set b(value: T);
1382
- }
1383
-
1384
- export declare const hyphenToCamelCase: (str: string) => string;
1385
-
1386
- export declare const identifier: Parser<string>;
1387
-
1388
- export declare const integer: Parser<number>;
1389
-
1390
- export declare function interpBezier(t: number, points: number[][]): number[];
1391
-
1392
- /**
1393
- * Interpolate between two decomposed 3D matrices at parameter t.
1394
- * Uses slerp for rotation, lerp for everything else.
1395
- */
1396
- export declare function interpolateDecomposed(a: DecomposedMatrix3D, b: DecomposedMatrix3D, t: number): DecomposedMatrix3D;
1397
-
1398
- export declare type InterpolatedVar<T> = {
1399
- start: ValueUnit<T>;
1400
- stop: ValueUnit<T>;
1401
- value: ValueUnit<T>;
1402
- computed: boolean;
1403
- };
1404
-
1405
- /**
1406
- * Interpolate between two hue values using the given method.
1407
- * Hues are in [0, 1] (normalized). Returns an interpolated hue in [0, 1].
1408
- * Handles NaN (CSS `none`): if one hue is NaN, the other's value is used.
1409
- */
1410
- export declare function interpolateHue(h1: number, h2: number, t: number, method?: HueInterpolationMethod): number;
1411
-
1412
- /** Invert a 3×3 matrix via cofactor expansion. Returns the inverse. */
1413
- export declare function invertMat3(m: Mat3): Mat3;
1414
-
1415
- export declare function isColorUnit(value: ValueUnit<Color<ValueUnit>>): value is ValueUnit<Color<ValueUnit>>;
1416
-
1417
- export declare function isCSSStyleName(value: any): value is (typeof STYLE_NAMES)[number];
1418
-
1419
- /** Check if linear sRGB values are within the [0,1]³ gamut. */
1420
- export declare function isInSRGBGamut(r: number, g: number, b: number): boolean;
1421
-
1422
- export declare const isObject: (value: any) => boolean;
1423
-
1424
- /** Case-insensitive string match. Returns the matched portion of the input. */
1425
- export declare const istring: (str: string) => Parser<string>;
1426
-
1427
- export declare const jumpTerms: readonly ["jump-start", "jump-end", "jump-none", "jump-both", "start", "end", "both"];
1428
-
1429
- export declare const kelvin2rgb: ({ kelvin, alpha }: KelvinColor) => RGBColor;
1430
-
1431
- export declare function kelvin2xyz(kelvin: KelvinColor): XYZColor;
1432
-
1433
- export declare class KelvinColor<T = number> extends Color<T> {
1434
- constructor(kelvin: T, alpha?: T);
1435
- get kelvin(): T;
1436
- set kelvin(value: T);
1437
- }
1438
-
1439
- export declare function lab2lch({ l, a, b, alpha }: LABColor): LCHColor;
1440
-
1441
- export declare function lab2oklab(lab: LABColor): OKLABColor;
1442
-
1443
- export declare function lab2oklch(lab: LABColor): OKLCHColor;
1444
-
1445
- export declare function lab2xyz(lab: LABColor): XYZColor;
1446
-
1447
- export declare class LABColor<T = number> extends WhitePointColor<T> {
1448
- constructor(l: T, a: T, b: T, alpha?: T);
1449
- get l(): T;
1450
- set l(value: T);
1451
- get a(): T;
1452
- set a(value: T);
1453
- get b(): T;
1454
- set b(value: T);
1455
- }
1456
-
1457
- export declare function lch2lab({ l, c, h, alpha }: LCHColor): LABColor;
1458
-
1459
- export declare function lch2xyz(lch: LCHColor): XYZColor;
1460
-
1461
- export declare class LCHColor<T = number> extends Color<T> {
1462
- constructor(l: T, c: T, h: T, alpha?: T);
1463
- get l(): T;
1464
- set l(value: T);
1465
- get c(): T;
1466
- set c(value: T);
1467
- get h(): T;
1468
- set h(value: T);
1469
- }
1470
-
1471
- export declare const LENGTH_UNITS: readonly ["px", "cm", "mm", "Q", "in", "pc", "pt", "em", "ex", "ch", "cap", "ic", "rem", "lh", "rlh", "vw", "vh", "vmin", "vmax", "vb", "vi", "svw", "svh", "svi", "svb", "svmin", "svmax", "lvw", "lvh", "lvi", "lvb", "lvmin", "lvmax", "dvw", "dvh", "dvi", "dvb", "dvmin", "dvmax", "cqw", "cqh", "cqi", "cqb", "cqmin", "cqmax"];
1472
-
1473
- export declare function lerp(t: number, start: number, end: number): number;
1474
-
1475
- export declare function linear(t: number): number;
1476
-
1477
- export declare const LINEAR_SRGB_TO_LMS: Mat3;
1478
-
1479
- export declare function linearSrgb2xyz({ r, g, b, alpha }: LinearSRGBColor): XYZColor;
1480
-
1481
- export declare class LinearSRGBColor<T = number> extends Color<T> {
1482
- constructor(r: T, g: T, b: T, alpha?: T);
1483
- get r(): T;
1484
- set r(value: T);
1485
- get g(): T;
1486
- set g(value: T);
1487
- get b(): T;
1488
- set b(value: T);
1489
- }
1490
-
1491
- /**
1492
- * CSS Easing Level 2 `linear()` — piecewise-linear timing function.
1493
- *
1494
- * Each stop is `{ output: number, input?: number }`.
1495
- * - `output` is the easing output value (typically 0–1 but can overshoot).
1496
- * - `input` is the progress percentage (0–100). If omitted, stops are
1497
- * evenly distributed.
1498
- *
1499
- * Syntax examples:
1500
- * linear(0, 0.25, 1) → three evenly-spaced stops
1501
- * linear(0, 0.25 75%, 1) → second stop at 75% input
1502
- * linear(0, 0.5 25% 75%, 1) → second stop spans 25%–75% (flat segment)
1503
- */
1504
- export declare interface LinearStop {
1505
- output: number;
1506
- input?: number;
1507
- }
1508
-
1509
- export declare function linearToAdobeRgb(c: number): number;
1510
-
1511
- export declare function linearToProPhoto(c: number): number;
1512
-
1513
- export declare function linearToRec2020(c: number): number;
1514
-
1515
- export declare function linearToSrgb(channel: number): number;
1516
-
1517
- export declare const LMS_TO_LINEAR_SRGB: Mat3;
1518
-
1519
- export declare const LMS_TO_OKLAB_MATRIX: Mat3;
1520
-
1521
- export declare const LMS_TO_XYZ_MATRIX: Mat3;
1522
-
1523
- export declare function logerp(t: number, start: number, end: number): number;
1524
-
1525
- export declare type Mat3 = [
1526
- number,
1527
- number,
1528
- number,
1529
- number,
1530
- number,
1531
- number,
1532
- number,
1533
- number,
1534
- number
1535
- ];
1536
-
1537
- export declare type Mat4 = number[];
1538
-
1539
- export declare interface MatrixValues {
1540
- scaleX: number;
1541
- scaleY: number;
1542
- scaleZ: number;
1543
- skewX: number;
1544
- skewY: number;
1545
- skewZ: number;
1546
- translateX: number;
1547
- translateY: number;
1548
- translateZ: number;
1549
- rotateX: number;
1550
- rotateY: number;
1551
- rotateZ: number;
1552
- perspectiveX: number;
1553
- perspectiveY: number;
1554
- perspectiveZ: number;
1555
- perspectiveW: number;
1556
- }
1557
-
1558
- export declare function memoize<T extends (...args: any[]) => any>(func: T, options?: MemoizeOptions<T>): T & {
1559
- cache: Map<string, {
1560
- value: ReturnType<T>;
1561
- timestamp: number;
1562
- }>;
1563
- };
1564
-
1565
- export declare interface MemoizeOptions<T extends (...args: any[]) => any = (...args: any[]) => any> {
1566
- maxCacheSize?: number;
1567
- ttl?: number;
1568
- keyFn?: (...args: any[]) => string;
1569
- /** When provided, the result is only cached if this returns true. */
1570
- shouldCache?: (result: ReturnType<T>, ...args: Parameters<T>) => boolean;
1571
- }
1572
-
1573
- /**
1574
- * Mix two colors per CSS color-mix() specification.
1575
- * Both colors should be normalized (components in [0, 1]).
1576
- * Percentages p1, p2 are in [0, 1] (e.g. 0.5 = 50%).
1577
- */
1578
- export declare function mixColors(col1: Color, col2: Color, p1: number, p2: number, space?: ColorSpace, hueMethod?: HueInterpolationMethod): Color;
1579
-
1580
- /** Multiply two Mat3 matrices (row-major): result = A × B */
1581
- export declare function multiplyMat3(a: Mat3, b: Mat3): Mat3;
1582
-
1583
- export declare const none: Parser<string>;
1584
-
1585
- export declare const normalizeColor: (color: Color<ValueUnit<number> | number>, inverse?: boolean) => Color<ValueUnit<number>>;
1586
-
1587
- export declare const normalizeColorUnit: (color: ValueUnit<Color<ValueUnit<number>>, "color">, inverse?: boolean, inplace?: boolean) => ValueUnit<Color<ValueUnit<number>>, "color">;
1588
-
1589
- export declare const normalizeColorUnitComponent: (v: number, unit: string, colorSpace: ColorSpace, component: string, inverse?: boolean) => ValueUnit<number, string>;
1590
-
1591
- export declare const normalizeColorUnits: (a: ValueUnit<Color<ValueUnit<number>>, "color">, b: ValueUnit<Color<ValueUnit<number>>, "color">, to?: ColorSpace, normalized?: boolean, inverse?: boolean, inplace?: boolean, hueMethod?: HueInterpolationMethod) => 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">, HueInterpolationMethod | undefined];
1592
-
1593
- export declare const normalizeNumericUnits: (a: ValueUnit, b: ValueUnit, inplace?: boolean) => [ValueUnit, ValueUnit];
1594
-
1595
- export declare function normalizeValueUnits(left: ValueUnit, right: ValueUnit): InterpolatedVar<any>;
1596
-
1597
- export declare const number: Parser<number>;
1598
-
1599
- export declare function oklab2lab(oklab: OKLABColor): LABColor;
1600
-
1601
- export declare function oklab2oklch({ l, a, b, alpha }: OKLABColor): OKLCHColor;
1602
-
1603
- export declare function oklab2xyz({ l, a, b, alpha }: OKLABColor): XYZColor;
1604
-
1605
- export declare const OKLAB_TO_LMS_COEFF: {
1606
- readonly l: Vec3;
1607
- readonly m: Vec3;
1608
- readonly s: Vec3;
1609
- };
1610
-
1611
- export declare const OKLAB_TO_LMS_MATRIX: Mat3;
1612
-
1613
- export declare class OKLABColor<T = number> extends WhitePointColor<T> {
1614
- constructor(l: T, a: T, b: T, alpha?: T);
1615
- get l(): T;
1616
- set l(value: T);
1617
- get a(): T;
1618
- set a(value: T);
1619
- get b(): T;
1620
- set b(value: T);
1621
- }
1622
-
1623
- /**
1624
- * Direct OKLab→linear sRGB conversion (no XYZ intermediate).
1625
- * L ∈ [0,1], a,b ∈ [-0.4,0.4] (raw OKLab, NOT normalized).
1626
- */
1627
- export declare function oklabToLinearSRGB(L: number, a: number, b: number): [number, number, number];
1628
-
1629
- export declare function oklch2lab(oklch: OKLCHColor): LABColor;
1630
-
1631
- export declare function oklch2oklab({ l, c, h, alpha }: OKLCHColor): OKLABColor;
1632
-
1633
- export declare function oklch2xyz(oklch: OKLCHColor): XYZColor;
1634
-
1635
- export declare class OKLCHColor<T = number> extends Color<T> {
1636
- constructor(l: T, c: T, h: T, alpha?: T);
1637
- get l(): T;
1638
- set l(value: T);
1639
- get c(): T;
1640
- set c(value: T);
1641
- get h(): T;
1642
- set h(value: T);
1643
- }
1644
-
1645
- export declare function parseCSSColor(input: string): ValueUnit;
1646
-
1647
- export declare const parseCSSPercent: ((input: string | number) => number) & {
1648
- cache: Map<string, {
1649
- value: number;
1650
- timestamp: number;
1651
- }>;
1652
- };
1653
-
1654
- export declare const parseCSSTime: ((input: string) => number) & {
1655
- cache: Map<string, {
1656
- value: number;
1657
- timestamp: number;
1658
- }>;
1659
- };
1660
-
1661
- export declare const parseCSSValue: ((input: string) => ValueUnit | FunctionValue) & {
1662
- cache: Map<string, {
1663
- value: ValueUnit<any, string | undefined> | FunctionValue<any, string>;
1664
- timestamp: number;
1665
- }>;
1666
- };
1667
-
1668
- export declare function parseCSSValueUnit(input: string): ValueUnit;
1669
-
1670
- /**
1671
- * Parse and return a result object with `.status` and `.value`.
1672
- * Equivalent to Parsimmon's `.parse()` return shape.
1673
- */
1674
- export declare function parseResult<T>(parser: Parser<T>, input: string): {
1675
- status: boolean;
1676
- value: T;
1677
- };
1678
-
1679
- export declare const PERCENTAGE_UNITS: readonly ["%"];
1680
-
1681
- export declare function proPhoto2xyz({ r, g, b, alpha }: ProPhotoRGBColor): XYZColor;
1682
-
1683
- export declare class ProPhotoRGBColor<T = number> extends Color<T> {
1684
- constructor(r: T, g: T, b: T, alpha?: T);
1685
- get r(): T;
1686
- set r(value: T);
1687
- get g(): T;
1688
- set g(value: T);
1689
- get b(): T;
1690
- set b(value: T);
1691
- }
1692
-
1693
- export declare function proPhotoToLinear(c: number): number;
1694
-
1695
- export declare function rec20202xyz({ r, g, b, alpha }: Rec2020Color): XYZColor;
1696
-
1697
- export declare class Rec2020Color<T = number> extends Color<T> {
1698
- constructor(r: T, g: T, b: T, alpha?: T);
1699
- get r(): T;
1700
- set r(value: T);
1701
- get g(): T;
1702
- set g(value: T);
1703
- get b(): T;
1704
- set b(value: T);
1705
- }
1706
-
1707
- export declare function rec2020ToLinear(c: number): number;
1708
-
1709
- /**
1710
- * Recompose a 3D decomposed matrix back into a CSS matrix3d() value array (16 values, column-major CSS order).
1711
- */
1712
- export declare function recomposeMatrix3D(d: DecomposedMatrix3D): number[];
1713
-
1714
- export declare const RELATIVE_LENGTH_UNITS: readonly ["em", "ex", "ch", "cap", "ic", "rem", "lh", "rlh", "vw", "vh", "vmin", "vmax", "vb", "vi", "svw", "svh", "svi", "svb", "svmin", "svmax", "lvw", "lvh", "lvi", "lvb", "lvmin", "lvmax", "dvw", "dvh", "dvi", "dvb", "dvmin", "dvmax", "cqw", "cqh", "cqi", "cqb", "cqmin", "cqmax"];
1715
-
1716
- declare function requestAnimationFrame_2(callback: FrameRequestCallback): number | NodeJS.Timeout;
1717
- export { requestAnimationFrame_2 as requestAnimationFrame }
1718
-
1719
- export declare const RESOLUTION_UNITS: readonly ["dpi", "dpcm", "dppx"];
1720
-
1721
- export declare function rgb2ColorFilter(color: RGBColor<number>): {
1722
- values: number[];
1723
- loss: number;
1724
- filter: string;
1725
- };
1726
-
1727
- export declare const rgb2hex: ({ r, g, b, alpha }: RGBColor) => string;
1728
-
1729
- export declare const rgb2hsl: ({ r, g, b, alpha }: RGBColor) => HSLColor;
1730
-
1731
- export declare const rgb2kelvin: ({ r, g, b, alpha }: RGBColor) => KelvinColor;
1732
-
1733
- export declare function rgb2xyz({ r, g, b, alpha }: RGBColor): XYZColor;
1734
-
1735
- export declare const RGB_RANGE: {
1736
- readonly "%": {
1737
- readonly min: 0;
1738
- readonly max: 100;
1739
- };
1740
- readonly number: {
1741
- readonly min: 0;
1742
- readonly max: 255;
1743
- };
1744
- };
1745
-
1746
- export declare const RGBA_MAX = 255;
1747
-
1748
- export declare class RGBColor<T = number> extends Color<T> {
1749
- constructor(r: T, g: T, b: T, alpha?: T);
1750
- get r(): T;
1751
- set r(value: T);
1752
- get g(): T;
1753
- set g(value: T);
1754
- get b(): T;
1755
- set b(value: T);
1756
- }
1757
-
1758
- export declare function scale(value: number, fromMin: number, fromMax: number, toMin?: number, toMax?: number): number;
1759
-
1760
- export declare function seekPreviousValue<T>(ix: number, values: T[], pred: (f: T) => boolean): number | undefined;
1761
-
1762
- export declare function sleep(ms: number): Promise<unknown>;
1763
-
1764
- /**
1765
- * Spherical linear interpolation between two quaternions.
1766
- * Both quaternions should be normalized.
1767
- */
1768
- export declare function slerp(qa: Vec4, qb: Vec4, t: number): Vec4;
1769
-
1770
- export declare function smoothStep3(t: number): number;
1771
-
1772
- export declare function srgbToLinear(channel: number): number;
1773
-
1774
- /**
1775
- * Convert sRGB (possibly out-of-gamut) to raw OKLab.
1776
- * Uses the direct linear sRGB → LMS path.
1777
- */
1778
- export declare function srgbToOKLab(r: number, g: number, b: number): [number, number, number];
1779
-
1780
- export declare function stepEnd(): (t: number) => number;
1781
-
1782
- export declare function steppedEase(steps: number, jumpTerm?: (typeof jumpTerms)[number]): (t: number) => number;
1783
-
1784
- export declare function stepStart(): (t: number) => number;
1785
-
1786
- export declare const STRING_UNITS: readonly ["string"];
1787
-
1788
- 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"];
1789
-
1790
- /** Parser that always succeeds with the given value without consuming input. */
1791
- export declare function succeed<T>(value: T): Parser<T>;
1792
-
1793
- export declare const TIME_UNITS: readonly ["s", "ms"];
1794
-
1795
- export declare const timingFunctions: {
1796
- readonly linear: typeof linear;
1797
- readonly easeInQuad: typeof easeInQuad;
1798
- readonly "ease-in-quad": typeof easeInQuad;
1799
- readonly easeOutQuad: typeof easeOutQuad;
1800
- readonly "ease-out-quad": typeof easeOutQuad;
1801
- readonly easeInOutQuad: typeof easeInOutQuad;
1802
- readonly "ease-in-out-quad": typeof easeInOutQuad;
1803
- readonly easeInCubic: typeof easeInCubic;
1804
- readonly "ease-in-cubic": typeof easeInCubic;
1805
- readonly easeOutCubic: typeof easeOutCubic;
1806
- readonly "ease-out-cubic": typeof easeOutCubic;
1807
- readonly easeInOutCubic: typeof easeInOutCubic;
1808
- readonly "ease-in-out-cubic": typeof easeInOutCubic;
1809
- readonly easeInBounce: typeof easeInBounce;
1810
- readonly "ease-in-bounce": typeof easeInBounce;
1811
- readonly bounceInEase: typeof bounceInEase;
1812
- readonly "bounce-in-ease": typeof bounceInEase;
1813
- readonly bounceInEaseHalf: typeof bounceInEaseHalf;
1814
- readonly "bounce-in-ease-half": typeof bounceInEaseHalf;
1815
- readonly bounceOutEase: typeof bounceOutEase;
1816
- readonly "bounce-out-ease": typeof bounceOutEase;
1817
- readonly bounceOutEaseHalf: typeof bounceOutEaseHalf;
1818
- readonly "bounce-out-ease-half": typeof bounceOutEaseHalf;
1819
- readonly bounceInOutEase: typeof bounceInOutEase;
1820
- readonly "bounce-in-out-ease": typeof bounceInOutEase;
1821
- readonly easeInSine: typeof easeInSine;
1822
- readonly "ease-in-sine": typeof easeInSine;
1823
- readonly easeOutSine: typeof easeOutSine;
1824
- readonly "ease-out-sine": typeof easeOutSine;
1825
- readonly easeInOutSine: typeof easeInOutSine;
1826
- readonly "ease-in-out-sine": typeof easeInOutSine;
1827
- readonly easeInCirc: typeof easeInCirc;
1828
- readonly "ease-in-circ": typeof easeInCirc;
1829
- readonly easeOutCirc: typeof easeOutCirc;
1830
- readonly "ease-out-circ": typeof easeOutCirc;
1831
- readonly easeInOutCirc: typeof easeInOutCirc;
1832
- readonly "ease-in-out-circ": typeof easeInOutCirc;
1833
- readonly easeInExpo: typeof easeInExpo;
1834
- readonly "ease-in-expo": typeof easeInExpo;
1835
- readonly easeOutExpo: typeof easeOutExpo;
1836
- readonly "ease-out-expo": typeof easeOutExpo;
1837
- readonly easeInOutExpo: typeof easeInOutExpo;
1838
- readonly "ease-in-out-expo": typeof easeInOutExpo;
1839
- readonly smoothStep3: typeof smoothStep3;
1840
- readonly "smooth-step-3": typeof smoothStep3;
1841
- readonly ease: (x: number) => number;
1842
- readonly "ease-in": (x: number) => number;
1843
- readonly "ease-out": (x: number) => number;
1844
- readonly "ease-in-out": (x: number) => number;
1845
- readonly "ease-in-back": (x: number) => number;
1846
- readonly "ease-out-back": (x: number) => number;
1847
- readonly "ease-in-out-back": (x: number) => number;
1848
- readonly steps: typeof steppedEase;
1849
- readonly "step-start": typeof stepStart;
1850
- readonly "step-end": typeof stepEnd;
1851
- };
1852
-
1853
- /** Multiply a Mat3 (row-major) by a Vec3: result = M * v */
1854
- export declare function transformMat3(v: Vec3, m: Mat3): Vec3;
1855
-
1856
- /** Transpose a Mat3 (row-major → row-major transpose) */
1857
- export declare function transposeMat3(m: Mat3): Mat3;
1858
-
1859
- /**
1860
- * Try to parse; return the result or throw on failure.
1861
- * Equivalent to Parsimmon's `.tryParse()`.
1862
- */
1863
- export declare function tryParse<T>(parser: Parser<T>, input: string): T;
1864
-
1865
- export declare const unflattenObject: (flatObj: Record<string, any[]>) => any;
1866
-
1867
- export declare const unflattenObjectToString: (flatObj: Record<string, any[]>) => Record<string, string>;
1868
-
1869
- export declare const UNIT_RANGE: {
1870
- readonly "%": {
1871
- readonly min: 0;
1872
- readonly max: 100;
1873
- };
1874
- readonly number: {
1875
- readonly min: 0;
1876
- readonly max: 1;
1877
- };
1878
- };
1879
-
1880
- export declare const UNITS: readonly ["px", "cm", "mm", "Q", "in", "pc", "pt", "em", "ex", "ch", "cap", "ic", "rem", "lh", "rlh", "vw", "vh", "vmin", "vmax", "vb", "vi", "svw", "svh", "svi", "svb", "svmin", "svmax", "lvw", "lvh", "lvi", "lvb", "lvmin", "lvmax", "dvw", "dvh", "dvi", "dvb", "dvmin", "dvmax", "cqw", "cqh", "cqi", "cqb", "cqmin", "cqmax", "s", "ms", "deg", "rad", "grad", "turn", "%", "Hz", "kHz", "dpi", "dpcm", "dppx", "fr", "var", "calc", "string", "color", "", undefined];
1881
-
1882
- export declare const unpackMatrixValues: (value: FunctionValue) => MatrixValues;
1883
-
1884
- export declare class ValueArray<T = any> extends Array<ValueUnit<T> | FunctionValue<T>> {
1885
- constructor(...args: Array<ValueUnit<T> | FunctionValue<T>>);
1886
- setSubProperty(subProperty: any): void;
1887
- setProperty(property: any): void;
1888
- setTargets(targets: HTMLElement[]): void;
1889
- setValue(value: T, index?: number): void;
1890
- valueOf(): (any[] | T)[];
1891
- toString(): string;
1892
- toJSON(): (Record<string, any[]> | T)[];
1893
- clone(): ValueArray<T>;
1894
- }
1895
-
1896
- export declare class ValueUnit<T = any, U = (typeof UNITS)[number] | string> {
1897
- value: T;
1898
- unit?: U | undefined;
1899
- superType?: string[] | undefined;
1900
- subProperty?: string | undefined;
1901
- property?: string | undefined;
1902
- targets?: HTMLElement[] | undefined;
1903
- constructor(value: T, unit?: U | undefined, superType?: string[] | undefined, subProperty?: string | undefined, property?: string | undefined, targets?: HTMLElement[] | undefined);
1904
- setSubProperty(subProperty: any): void;
1905
- setProperty(property: any): void;
1906
- setTargets(targets: HTMLElement[]): void;
1907
- valueOf(): T;
1908
- setValue(value: T): void;
1909
- toString(): string;
1910
- toJSON(): T;
1911
- toFixed(fractionDigits?: number): string;
1912
- clone(): ValueUnit<T, U>;
1913
- coalesce(right?: ValueUnit, inplace?: boolean): ValueUnit<any, any>;
1914
- }
1915
-
1916
- /**
1917
- * Minimal 3×3 matrix and 3-element vector math.
1918
- * Replaces gl-matrix dependency — uses native number[] for full f64 precision
1919
- * (gl-matrix uses Float32Array).
1920
- *
1921
- * Mat3 is stored in row-major order:
1922
- * [m00, m01, m02, m10, m11, m12, m20, m21, m22]
1923
- */
1924
- export declare type Vec3 = [number, number, number];
1925
-
1926
- /**
1927
- * CSS Transform Matrix Decomposition and Recomposition.
1928
- *
1929
- * Implements the CSSOM View spec algorithm (§15.1) for 2D matrices
1930
- * and polar decomposition for 3D matrices.
1931
- * Also includes quaternion slerp for smooth rotation interpolation.
1932
- */
1933
- export declare type Vec4 = [number, number, number, number];
1934
-
1935
- export declare function waitUntil(condition: () => boolean, delay?: number): Promise<void>;
1936
-
1937
- export declare const WHITE_POINT_D50: Vec3;
1938
-
1939
- export declare const WHITE_POINT_D50_D65: Mat3;
1940
-
1941
- export declare const WHITE_POINT_D65: Vec3;
1942
-
1943
- export declare const WHITE_POINT_D65_D50: Mat3;
1944
-
1945
- export declare const WHITE_POINTS: {
1946
- D65: Vec3;
1947
- D50: Vec3;
1948
- };
1949
-
1950
- export declare type WhitePoint = keyof typeof WHITE_POINTS;
1951
-
1952
- declare class WhitePointColor<T = number> extends Color<T> {
1953
- whitePoint: WhitePoint;
1954
- constructor(colorSpace: ColorSpace, alpha: T, whitePoint: WhitePoint);
1955
- }
1956
-
1957
- export declare function xyz2adobeRgb({ x, y, z, alpha }: XYZColor): AdobeRGBColor;
1958
-
1959
- export declare function xyz2displayP3({ x, y, z, alpha }: XYZColor): DisplayP3Color;
1960
-
1961
- export declare function xyz2hsl(xyz: XYZColor): HSLColor<number>;
1962
-
1963
- export declare function xyz2hsv(xyz: XYZColor): HSVColor;
1964
-
1965
- export declare function xyz2hwb(xyz: XYZColor): HWBColor;
1966
-
1967
- export declare function xyz2kelvin(xyz: XYZColor): KelvinColor;
1968
-
1969
- export declare function xyz2lab(xyz: XYZColor, toWhitePoint?: WhitePoint): LABColor;
1970
-
1971
- export declare function xyz2lch(xyz: XYZColor): LCHColor;
1972
-
1973
- export declare function xyz2linearSrgb({ x, y, z, alpha }: XYZColor): LinearSRGBColor;
1974
-
1975
- export declare function xyz2oklab(xyz: XYZColor): OKLABColor;
1976
-
1977
- export declare function xyz2oklch(xyz: XYZColor): OKLCHColor;
1978
-
1979
- export declare function xyz2proPhoto({ x, y, z, alpha }: XYZColor): ProPhotoRGBColor;
1980
-
1981
- export declare function xyz2rec2020({ x, y, z, alpha }: XYZColor): Rec2020Color;
1982
-
1983
- export declare const xyz2rgb: ({ x, y, z, alpha }: XYZColor, correctGamut?: boolean) => RGBColor;
1984
-
1985
- export declare const XYZ_TO_LMS_MATRIX: Mat3;
1986
-
1987
- export declare class XYZColor<T = number> extends WhitePointColor<T> {
1988
- constructor(x: T, y: T, z: T, alpha?: T);
1989
- get x(): T;
1990
- set x(value: T);
1991
- get y(): T;
1992
- set y(value: T);
1993
- get z(): T;
1994
- set z(value: T);
1995
- }
1996
-
1997
- export { }
1
+ export * from './src/index'
2
+ export {}