@tempots/std 0.26.1 → 0.28.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/color-D7FAmkht.cjs +1 -0
- package/color-SZxckS9U.js +522 -0
- package/color-adjust.cjs +1 -0
- package/color-adjust.d.ts +148 -0
- package/color-adjust.js +47 -0
- package/color-contrast.cjs +1 -0
- package/color-contrast.d.ts +96 -0
- package/color-contrast.js +22 -0
- package/color-distance.cjs +1 -0
- package/color-distance.d.ts +41 -0
- package/color-distance.js +25 -0
- package/color-harmony.cjs +1 -0
- package/color-harmony.d.ts +81 -0
- package/color-harmony.js +35 -0
- package/color-hsl.cjs +1 -0
- package/color-hsl.d.ts +81 -0
- package/color-hsl.js +10 -0
- package/color-hsv.cjs +1 -0
- package/color-hsv.d.ts +116 -0
- package/color-hsv.js +12 -0
- package/color-hwb.cjs +1 -0
- package/color-hwb.d.ts +88 -0
- package/color-hwb.js +10 -0
- package/color-lab.cjs +1 -0
- package/color-lab.d.ts +161 -0
- package/color-lab.js +15 -0
- package/color-mix.cjs +1 -0
- package/color-mix.d.ts +50 -0
- package/color-mix.js +101 -0
- package/color-named.cjs +1 -0
- package/color-named.d.ts +8 -0
- package/color-named.js +153 -0
- package/color-oklab.cjs +1 -0
- package/color-oklab.d.ts +141 -0
- package/color-oklab.js +15 -0
- package/color-rgb.cjs +1 -0
- package/color-rgb.d.ts +119 -0
- package/color-rgb.js +14 -0
- package/color-utils.cjs +1 -0
- package/color-utils.d.ts +57 -0
- package/color-utils.js +54 -0
- package/color.cjs +1 -0
- package/color.d.ts +466 -0
- package/color.js +33 -0
- package/index.cjs +1 -1
- package/index.d.ts +14 -0
- package/index.js +370 -265
- package/number.cjs +1 -1
- package/number.d.ts +15 -0
- package/number.js +32 -31
- package/package.json +99 -1
package/color.d.ts
ADDED
|
@@ -0,0 +1,466 @@
|
|
|
1
|
+
import { rgb8aToHexString } from './color-rgb';
|
|
2
|
+
/**
|
|
3
|
+
* String literal union of all supported color spaces.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export type ColorSpace = 'rgb' | 'rgb8' | 'hsl' | 'hsv' | 'hwb' | 'lab' | 'lch' | 'oklab' | 'oklch';
|
|
8
|
+
/**
|
|
9
|
+
* An RGBA color with channels `r` (0–1), `g` (0–1), `b` (0–1), and
|
|
10
|
+
* `alpha` (0–1).
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export interface RGBA {
|
|
15
|
+
readonly space: 'rgb';
|
|
16
|
+
readonly r: number;
|
|
17
|
+
readonly g: number;
|
|
18
|
+
readonly b: number;
|
|
19
|
+
readonly alpha: number;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* An 8-bit RGBA color with channels `r` (0–255), `g` (0–255), `b` (0–255),
|
|
23
|
+
* and `alpha` (0–1). This is the format used by CSS `rgb()` and hex notation.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export interface RGB8A {
|
|
28
|
+
readonly space: 'rgb8';
|
|
29
|
+
readonly r: number;
|
|
30
|
+
readonly g: number;
|
|
31
|
+
readonly b: number;
|
|
32
|
+
readonly alpha: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* An HSLA color with `h` (0–360), `s` (0–100), `l` (0–100), and `alpha`
|
|
36
|
+
* (0–1).
|
|
37
|
+
*
|
|
38
|
+
* @public
|
|
39
|
+
*/
|
|
40
|
+
export interface HSLA {
|
|
41
|
+
readonly space: 'hsl';
|
|
42
|
+
readonly h: number;
|
|
43
|
+
readonly s: number;
|
|
44
|
+
readonly l: number;
|
|
45
|
+
readonly alpha: number;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* An HSVA color with `h` (0–360), `s` (0–100), `v` (0–100), and `alpha`
|
|
49
|
+
* (0–1).
|
|
50
|
+
*
|
|
51
|
+
* @public
|
|
52
|
+
*/
|
|
53
|
+
export interface HSVA {
|
|
54
|
+
readonly space: 'hsv';
|
|
55
|
+
readonly h: number;
|
|
56
|
+
readonly s: number;
|
|
57
|
+
readonly v: number;
|
|
58
|
+
readonly alpha: number;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* An HWBA color with `h` (0–360), `w` (0–100), `b` (0–100), and `alpha`
|
|
62
|
+
* (0–1).
|
|
63
|
+
*
|
|
64
|
+
* @public
|
|
65
|
+
*/
|
|
66
|
+
export interface HWBA {
|
|
67
|
+
readonly space: 'hwb';
|
|
68
|
+
readonly h: number;
|
|
69
|
+
readonly w: number;
|
|
70
|
+
readonly b: number;
|
|
71
|
+
readonly alpha: number;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* A CIE LAB color with `l` (0–100), `a` (~-125 to 125), `b` (~-125 to 125),
|
|
75
|
+
* and `alpha` (0–1).
|
|
76
|
+
*
|
|
77
|
+
* @public
|
|
78
|
+
*/
|
|
79
|
+
export interface LABA {
|
|
80
|
+
readonly space: 'lab';
|
|
81
|
+
readonly l: number;
|
|
82
|
+
readonly a: number;
|
|
83
|
+
readonly b: number;
|
|
84
|
+
readonly alpha: number;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* A CIE LCH color with `l` (0–100), `c` (0–150+), `h` (0–360), and `alpha`
|
|
88
|
+
* (0–1).
|
|
89
|
+
*
|
|
90
|
+
* @public
|
|
91
|
+
*/
|
|
92
|
+
export interface LCHA {
|
|
93
|
+
readonly space: 'lch';
|
|
94
|
+
readonly l: number;
|
|
95
|
+
readonly c: number;
|
|
96
|
+
readonly h: number;
|
|
97
|
+
readonly alpha: number;
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* An OKLAB color with `l` (0–1), `a` (~-0.4 to 0.4), `b` (~-0.4 to 0.4),
|
|
101
|
+
* and `alpha` (0–1).
|
|
102
|
+
*
|
|
103
|
+
* @public
|
|
104
|
+
*/
|
|
105
|
+
export interface OKLABA {
|
|
106
|
+
readonly space: 'oklab';
|
|
107
|
+
readonly l: number;
|
|
108
|
+
readonly a: number;
|
|
109
|
+
readonly b: number;
|
|
110
|
+
readonly alpha: number;
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* An OKLCH color with `l` (0–1), `c` (0–0.4+), `h` (0–360), and `alpha`
|
|
114
|
+
* (0–1).
|
|
115
|
+
*
|
|
116
|
+
* @public
|
|
117
|
+
*/
|
|
118
|
+
export interface OKLCHA {
|
|
119
|
+
readonly space: 'oklch';
|
|
120
|
+
readonly l: number;
|
|
121
|
+
readonly c: number;
|
|
122
|
+
readonly h: number;
|
|
123
|
+
readonly alpha: number;
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* A color value in any of the supported color spaces.
|
|
127
|
+
*
|
|
128
|
+
* @public
|
|
129
|
+
*/
|
|
130
|
+
export type Color = RGBA | RGB8A | HSLA | HSVA | HWBA | LABA | LCHA | OKLABA | OKLCHA;
|
|
131
|
+
/**
|
|
132
|
+
* Creates an RGBA color with channels in the 0–1 range.
|
|
133
|
+
*
|
|
134
|
+
* @param r - Red channel (0–1).
|
|
135
|
+
* @param g - Green channel (0–1).
|
|
136
|
+
* @param b - Blue channel (0–1).
|
|
137
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
138
|
+
* @returns An RGBA color.
|
|
139
|
+
* @public
|
|
140
|
+
* @example
|
|
141
|
+
* ```ts
|
|
142
|
+
* rgba(1, 0, 0) // { space: 'rgb', r: 1, g: 0, b: 0, alpha: 1 }
|
|
143
|
+
* rgba(1, 0, 0, 0.5) // { space: 'rgb', r: 1, g: 0, b: 0, alpha: 0.5 }
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
export declare const rgba: (r: number, g: number, b: number, alpha?: number) => RGBA;
|
|
147
|
+
/**
|
|
148
|
+
* Creates an 8-bit RGB8A color with channels in the 0–255 range.
|
|
149
|
+
*
|
|
150
|
+
* @param r - Red channel (0–255).
|
|
151
|
+
* @param g - Green channel (0–255).
|
|
152
|
+
* @param b - Blue channel (0–255).
|
|
153
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
154
|
+
* @returns An RGB8A color.
|
|
155
|
+
* @public
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* rgb8a(255, 0, 0) // { space: 'rgb8', r: 255, g: 0, b: 0, alpha: 1 }
|
|
159
|
+
* rgb8a(255, 0, 0, 0.5) // { space: 'rgb8', r: 255, g: 0, b: 0, alpha: 0.5 }
|
|
160
|
+
* ```
|
|
161
|
+
*/
|
|
162
|
+
export declare const rgb8a: (r: number, g: number, b: number, alpha?: number) => RGB8A;
|
|
163
|
+
/**
|
|
164
|
+
* Creates an HSLA color, wrapping hue and clamping other channels.
|
|
165
|
+
*
|
|
166
|
+
* @param h - Hue (0–360, wraps).
|
|
167
|
+
* @param s - Saturation (0–100).
|
|
168
|
+
* @param l - Lightness (0–100).
|
|
169
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
170
|
+
* @returns An HSLA color.
|
|
171
|
+
* @public
|
|
172
|
+
* @example
|
|
173
|
+
* ```ts
|
|
174
|
+
* hsla(0, 100, 50) // { space: 'hsl', h: 0, s: 100, l: 50, alpha: 1 }
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export declare const hsla: (h: number, s: number, l: number, alpha?: number) => HSLA;
|
|
178
|
+
/**
|
|
179
|
+
* Creates an HSVA color, wrapping hue and clamping other channels.
|
|
180
|
+
*
|
|
181
|
+
* @param h - Hue (0–360, wraps).
|
|
182
|
+
* @param s - Saturation (0–100).
|
|
183
|
+
* @param v - Value (0–100).
|
|
184
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
185
|
+
* @returns An HSVA color.
|
|
186
|
+
* @public
|
|
187
|
+
* @example
|
|
188
|
+
* ```ts
|
|
189
|
+
* hsva(0, 100, 100) // { space: 'hsv', h: 0, s: 100, v: 100, alpha: 1 }
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
export declare const hsva: (h: number, s: number, v: number, alpha?: number) => HSVA;
|
|
193
|
+
/**
|
|
194
|
+
* Creates an HWBA color, wrapping hue and clamping other channels.
|
|
195
|
+
*
|
|
196
|
+
* @param h - Hue (0–360, wraps).
|
|
197
|
+
* @param w - Whiteness (0–100).
|
|
198
|
+
* @param b - Blackness (0–100).
|
|
199
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
200
|
+
* @returns An HWBA color.
|
|
201
|
+
* @public
|
|
202
|
+
* @example
|
|
203
|
+
* ```ts
|
|
204
|
+
* hwba(0, 0, 0) // { space: 'hwb', h: 0, w: 0, b: 0, alpha: 1 }
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
export declare const hwba: (h: number, w: number, b: number, alpha?: number) => HWBA;
|
|
208
|
+
/**
|
|
209
|
+
* Creates a CIE LAB color.
|
|
210
|
+
*
|
|
211
|
+
* @param l - Lightness (0–100).
|
|
212
|
+
* @param a - Green-red axis (~-125 to 125).
|
|
213
|
+
* @param b - Blue-yellow axis (~-125 to 125).
|
|
214
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
215
|
+
* @returns A LABA color.
|
|
216
|
+
* @public
|
|
217
|
+
* @example
|
|
218
|
+
* ```ts
|
|
219
|
+
* laba(50, -20, 30) // { space: 'lab', l: 50, a: -20, b: 30, alpha: 1 }
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
222
|
+
export declare const laba: (l: number, a: number, b: number, alpha?: number) => LABA;
|
|
223
|
+
/**
|
|
224
|
+
* Creates a CIE LCH color.
|
|
225
|
+
*
|
|
226
|
+
* @param l - Lightness (0–100).
|
|
227
|
+
* @param c - Chroma (0–150+).
|
|
228
|
+
* @param h - Hue (0–360).
|
|
229
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
230
|
+
* @returns A LCHA color.
|
|
231
|
+
* @public
|
|
232
|
+
* @example
|
|
233
|
+
* ```ts
|
|
234
|
+
* lcha(50, 36, 326) // { space: 'lch', l: 50, c: 36, h: 326, alpha: 1 }
|
|
235
|
+
* ```
|
|
236
|
+
*/
|
|
237
|
+
export declare const lcha: (l: number, c: number, h: number, alpha?: number) => LCHA;
|
|
238
|
+
/**
|
|
239
|
+
* Creates an OKLAB color.
|
|
240
|
+
*
|
|
241
|
+
* @param l - Lightness (0–1).
|
|
242
|
+
* @param a - Green-red axis (~-0.4 to 0.4).
|
|
243
|
+
* @param b - Blue-yellow axis (~-0.4 to 0.4).
|
|
244
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
245
|
+
* @returns An OKLABA color.
|
|
246
|
+
* @public
|
|
247
|
+
* @example
|
|
248
|
+
* ```ts
|
|
249
|
+
* oklaba(0.5, -0.1, 0.1) // { space: 'oklab', l: 0.5, a: -0.1, b: 0.1, alpha: 1 }
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
export declare const oklaba: (l: number, a: number, b: number, alpha?: number) => OKLABA;
|
|
253
|
+
/**
|
|
254
|
+
* Creates an OKLCH color.
|
|
255
|
+
*
|
|
256
|
+
* @param l - Lightness (0–1).
|
|
257
|
+
* @param c - Chroma (0–0.4+).
|
|
258
|
+
* @param h - Hue (0–360).
|
|
259
|
+
* @param alpha - Alpha channel (0–1). Defaults to 1.
|
|
260
|
+
* @returns An OKLCHA color.
|
|
261
|
+
* @public
|
|
262
|
+
* @example
|
|
263
|
+
* ```ts
|
|
264
|
+
* oklcha(0.5, 0.15, 326) // { space: 'oklch', l: 0.5, c: 0.15, h: 326, alpha: 1 }
|
|
265
|
+
* ```
|
|
266
|
+
*/
|
|
267
|
+
export declare const oklcha: (l: number, c: number, h: number, alpha?: number) => OKLCHA;
|
|
268
|
+
/**
|
|
269
|
+
* Returns `true` if the color is an RGBA color (0–1 channels).
|
|
270
|
+
*
|
|
271
|
+
* @param c - The color to check.
|
|
272
|
+
* @returns `true` if the color is RGBA.
|
|
273
|
+
* @public
|
|
274
|
+
*/
|
|
275
|
+
export declare const isRgba: (c: Color) => c is RGBA;
|
|
276
|
+
/**
|
|
277
|
+
* Returns `true` if the color is an RGB8A color (0–255 channels).
|
|
278
|
+
*
|
|
279
|
+
* @param c - The color to check.
|
|
280
|
+
* @returns `true` if the color is RGB8A.
|
|
281
|
+
* @public
|
|
282
|
+
*/
|
|
283
|
+
export declare const isRgb8a: (c: Color) => c is RGB8A;
|
|
284
|
+
/**
|
|
285
|
+
* Returns `true` if the color is an HSLA color.
|
|
286
|
+
*
|
|
287
|
+
* @param c - The color to check.
|
|
288
|
+
* @returns `true` if the color is HSLA.
|
|
289
|
+
* @public
|
|
290
|
+
*/
|
|
291
|
+
export declare const isHsla: (c: Color) => c is HSLA;
|
|
292
|
+
/**
|
|
293
|
+
* Returns `true` if the color is an HSVA color.
|
|
294
|
+
*
|
|
295
|
+
* @param c - The color to check.
|
|
296
|
+
* @returns `true` if the color is HSVA.
|
|
297
|
+
* @public
|
|
298
|
+
*/
|
|
299
|
+
export declare const isHsva: (c: Color) => c is HSVA;
|
|
300
|
+
/**
|
|
301
|
+
* Returns `true` if the color is an HWBA color.
|
|
302
|
+
*
|
|
303
|
+
* @param c - The color to check.
|
|
304
|
+
* @returns `true` if the color is HWBA.
|
|
305
|
+
* @public
|
|
306
|
+
*/
|
|
307
|
+
export declare const isHwba: (c: Color) => c is HWBA;
|
|
308
|
+
/**
|
|
309
|
+
* Returns `true` if the color is a LABA color.
|
|
310
|
+
*
|
|
311
|
+
* @param c - The color to check.
|
|
312
|
+
* @returns `true` if the color is LABA.
|
|
313
|
+
* @public
|
|
314
|
+
*/
|
|
315
|
+
export declare const isLaba: (c: Color) => c is LABA;
|
|
316
|
+
/**
|
|
317
|
+
* Returns `true` if the color is a LCHA color.
|
|
318
|
+
*
|
|
319
|
+
* @param c - The color to check.
|
|
320
|
+
* @returns `true` if the color is LCHA.
|
|
321
|
+
* @public
|
|
322
|
+
*/
|
|
323
|
+
export declare const isLcha: (c: Color) => c is LCHA;
|
|
324
|
+
/**
|
|
325
|
+
* Returns `true` if the color is an OKLABA color.
|
|
326
|
+
*
|
|
327
|
+
* @param c - The color to check.
|
|
328
|
+
* @returns `true` if the color is OKLABA.
|
|
329
|
+
* @public
|
|
330
|
+
*/
|
|
331
|
+
export declare const isOklaba: (c: Color) => c is OKLABA;
|
|
332
|
+
/**
|
|
333
|
+
* Returns `true` if the color is an OKLCHA color.
|
|
334
|
+
*
|
|
335
|
+
* @param c - The color to check.
|
|
336
|
+
* @returns `true` if the color is OKLCHA.
|
|
337
|
+
* @public
|
|
338
|
+
*/
|
|
339
|
+
export declare const isOklcha: (c: Color) => c is OKLCHA;
|
|
340
|
+
/**
|
|
341
|
+
* Parses an alpha value from a CSS string. Supports both decimal (`0.5`) and
|
|
342
|
+
* percentage (`50%`) forms. Returns 1 when the value is `undefined`.
|
|
343
|
+
*
|
|
344
|
+
* @param s - The alpha string to parse.
|
|
345
|
+
* @returns A number between 0 and 1.
|
|
346
|
+
* @public
|
|
347
|
+
*/
|
|
348
|
+
export declare const parseAlpha: (s: string | undefined) => number;
|
|
349
|
+
/**
|
|
350
|
+
* Converts an RGBA color (0–1) to an RGB8A color (0–255).
|
|
351
|
+
*
|
|
352
|
+
* @param c - The RGBA color to convert.
|
|
353
|
+
* @returns An RGB8A color.
|
|
354
|
+
* @public
|
|
355
|
+
* @example
|
|
356
|
+
* ```ts
|
|
357
|
+
* rgbaToRgb8a(rgba(1, 0, 0)) // rgb8a(255, 0, 0)
|
|
358
|
+
* ```
|
|
359
|
+
*/
|
|
360
|
+
export declare const rgbaToRgb8a: (c: RGBA) => RGB8A;
|
|
361
|
+
/**
|
|
362
|
+
* Converts an RGB8A color (0–255) to an RGBA color (0–1).
|
|
363
|
+
*
|
|
364
|
+
* @param c - The RGB8A color to convert.
|
|
365
|
+
* @returns An RGBA color.
|
|
366
|
+
* @public
|
|
367
|
+
* @example
|
|
368
|
+
* ```ts
|
|
369
|
+
* rgb8aToRgba(rgb8a(255, 0, 0)) // rgba(1, 0, 0)
|
|
370
|
+
* ```
|
|
371
|
+
*/
|
|
372
|
+
export declare const rgb8aToRgba: (c: RGB8A) => RGBA;
|
|
373
|
+
/**
|
|
374
|
+
* Detects the color space of a CSS color string. Returns `undefined` when the
|
|
375
|
+
* format is not recognized.
|
|
376
|
+
*
|
|
377
|
+
* CSS color strings (`#hex`, `rgb()`, named colors) are detected as `'rgb8'`
|
|
378
|
+
* since they use 0–255 integer channels.
|
|
379
|
+
*
|
|
380
|
+
* @param s - The string to inspect.
|
|
381
|
+
* @returns The detected `ColorSpace`, or `undefined`.
|
|
382
|
+
* @public
|
|
383
|
+
* @example
|
|
384
|
+
* ```ts
|
|
385
|
+
* detectColorSpace('#ff0000') // 'rgb8'
|
|
386
|
+
* detectColorSpace('hsl(0, 100%, 50%)') // 'hsl'
|
|
387
|
+
* detectColorSpace('red') // 'rgb8'
|
|
388
|
+
* detectColorSpace('nope') // undefined
|
|
389
|
+
* ```
|
|
390
|
+
*/
|
|
391
|
+
export declare const detectColorSpace: (s: string) => ColorSpace | undefined;
|
|
392
|
+
/**
|
|
393
|
+
* Returns `true` if the string can be parsed as any supported color format.
|
|
394
|
+
*
|
|
395
|
+
* @param s - The string to test.
|
|
396
|
+
* @returns `true` if the string is a valid color.
|
|
397
|
+
* @public
|
|
398
|
+
* @example
|
|
399
|
+
* ```ts
|
|
400
|
+
* canParseColor('#ff0000') // true
|
|
401
|
+
* canParseColor('rgb(255, 0, 0)') // true
|
|
402
|
+
* canParseColor('red') // true
|
|
403
|
+
* canParseColor('nope') // false
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
export declare const canParseColor: (s: string) => boolean;
|
|
407
|
+
/**
|
|
408
|
+
* Parses a CSS color string into a `Color` value, auto-detecting the format.
|
|
409
|
+
*
|
|
410
|
+
* Supports hex, `rgb()`, `hsl()`, `hsv()`, `hwb()`, `lab()`, `lch()`,
|
|
411
|
+
* `oklab()`, `oklch()`, and all 148 CSS named colors. Hex, `rgb()`, and
|
|
412
|
+
* named colors produce `RGB8A` values.
|
|
413
|
+
*
|
|
414
|
+
* @param s - The string to parse.
|
|
415
|
+
* @returns A `Color` value.
|
|
416
|
+
* @throws ParsingError if the format is not recognized.
|
|
417
|
+
* @public
|
|
418
|
+
* @example
|
|
419
|
+
* ```ts
|
|
420
|
+
* parseColor('#ff0000') // RGB8A
|
|
421
|
+
* parseColor('hsl(0, 100%, 50%)') // HSLA
|
|
422
|
+
* parseColor('red') // RGB8A
|
|
423
|
+
* ```
|
|
424
|
+
*/
|
|
425
|
+
export declare const parseColor: (s: string) => Color;
|
|
426
|
+
/**
|
|
427
|
+
* Converts a color from one color space to another.
|
|
428
|
+
*
|
|
429
|
+
* Uses RGB8A as an internal hub — the source color is first converted to
|
|
430
|
+
* RGB8A, then from RGB8A to the target space.
|
|
431
|
+
*
|
|
432
|
+
* @param c - The color to convert.
|
|
433
|
+
* @param to - The target color space.
|
|
434
|
+
* @returns The converted color.
|
|
435
|
+
* @public
|
|
436
|
+
* @example
|
|
437
|
+
* ```ts
|
|
438
|
+
* convertColor(rgb8a(255, 0, 0), 'hsl') // hsla(0, 100, 50)
|
|
439
|
+
* convertColor(hsla(120, 100, 50), 'rgb8') // rgb8a(0, 255, 0)
|
|
440
|
+
* ```
|
|
441
|
+
*/
|
|
442
|
+
export declare const convertColor: (c: Color, to: ColorSpace) => Color;
|
|
443
|
+
/**
|
|
444
|
+
* Serializes a color to a CSS-compatible string based on its color space.
|
|
445
|
+
*
|
|
446
|
+
* RGBA (0–1) colors are first converted to RGB8A for CSS serialization.
|
|
447
|
+
*
|
|
448
|
+
* @param c - The color to serialize.
|
|
449
|
+
* @returns A CSS color string.
|
|
450
|
+
* @public
|
|
451
|
+
* @example
|
|
452
|
+
* ```ts
|
|
453
|
+
* colorToString(rgb8a(255, 0, 0)) // 'rgb(255, 0, 0)'
|
|
454
|
+
* colorToString(hsla(0, 100, 50)) // 'hsl(0, 100%, 50%)'
|
|
455
|
+
* ```
|
|
456
|
+
*/
|
|
457
|
+
export declare const colorToString: (c: Color) => string;
|
|
458
|
+
/**
|
|
459
|
+
* Serializes an RGB8A color to a hex string. Convenience re-export from
|
|
460
|
+
* `color-rgb`.
|
|
461
|
+
*
|
|
462
|
+
* @param c - The color to serialize.
|
|
463
|
+
* @returns A hex color string.
|
|
464
|
+
* @public
|
|
465
|
+
*/
|
|
466
|
+
export { rgb8aToHexString };
|
package/color.js
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import "./number.js";
|
|
2
|
+
import "./error.js";
|
|
3
|
+
import "./color-named.js";
|
|
4
|
+
import { c as l, l as i, m as g, n as c, o as e, s as t, w as h, z as p, A as m, B as n, C, D as H, E as R, F as k, G as T, H as v, I as w, L, O, R as S, U as f, V as x, a4 as A, a5 as d, ae as z, af as B, ag as D } from "./color-SZxckS9U.js";
|
|
5
|
+
export {
|
|
6
|
+
l as canParseColor,
|
|
7
|
+
i as colorToString,
|
|
8
|
+
g as convertColor,
|
|
9
|
+
c as detectColorSpace,
|
|
10
|
+
e as hsla,
|
|
11
|
+
t as hsva,
|
|
12
|
+
h as hwba,
|
|
13
|
+
p as isHsla,
|
|
14
|
+
m as isHsva,
|
|
15
|
+
n as isHwba,
|
|
16
|
+
C as isLaba,
|
|
17
|
+
H as isLcha,
|
|
18
|
+
R as isOklaba,
|
|
19
|
+
k as isOklcha,
|
|
20
|
+
T as isRgb8a,
|
|
21
|
+
v as isRgba,
|
|
22
|
+
w as laba,
|
|
23
|
+
L as lcha,
|
|
24
|
+
O as oklaba,
|
|
25
|
+
S as oklcha,
|
|
26
|
+
f as parseAlpha,
|
|
27
|
+
x as parseColor,
|
|
28
|
+
A as rgb8a,
|
|
29
|
+
d as rgb8aToHexString,
|
|
30
|
+
z as rgb8aToRgba,
|
|
31
|
+
B as rgba,
|
|
32
|
+
D as rgbaToRgb8a
|
|
33
|
+
};
|
package/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./array.cjs"),b=require("./async-result.cjs"),a=require("./bigint.cjs"),u=require("./boolean.cjs"),t=require("./date.cjs"),A=require("./deferred.cjs"),g=require("./equal.cjs"),p=require("./function.cjs"),l=require("./iterator.cjs"),y=require("./json.cjs"),m=require("./map.cjs"),i=require("./number.cjs"),s=require("./object.cjs"),S=require("./promise.cjs"),c=require("./random.cjs"),C=require("./regexp.cjs"),f=require("./result-DBJ3htTg.cjs"),n=require("./set.cjs"),e=require("./string.cjs"),d=require("./timer.cjs"),o=require("./url.cjs");exports.applyArrayDiffOperations=r.applyArrayDiffOperations;exports.areArraysEqual=r.areArraysEqual;exports.arrayDiffOperations=r.arrayDiffOperations;exports.arrayHasValues=r.arrayHasValues;exports.arrayHead=r.arrayHead;exports.arrayTail=r.arrayTail;exports.buildArray=r.buildArray;exports.chunk=r.chunk;exports.compareArrays=r.compareArrays;exports.fillArray=r.fillArray;exports.filterMapArray=r.filterMapArray;exports.filterNullsFromArray=r.filterNullsFromArray;exports.groupBy=r.groupBy;exports.isArrayEmpty=r.isArrayEmpty;exports.joinArrayWithConjunction=r.joinArrayWithConjunction;exports.partition=r.partition;exports.range=r.range;exports.rankArray=r.rankArray;exports.removeAllFromArray=r.removeAllFromArray;exports.removeAllFromArrayByPredicate=r.removeAllFromArrayByPredicate;exports.removeOneFromArray=r.removeOneFromArray;exports.removeOneFromArrayByPredicate=r.removeOneFromArrayByPredicate;exports.uniqueByPrimitive=r.uniqueByPrimitive;exports.AsyncResult=b.AsyncResult;exports.biAbs=a.biAbs;exports.biCeilDiv=a.biCeilDiv;exports.biCompare=a.biCompare;exports.biFloorDiv=a.biFloorDiv;exports.biGcd=a.biGcd;exports.biIsEven=a.biIsEven;exports.biIsNegative=a.biIsNegative;exports.biIsOdd=a.biIsOdd;exports.biIsOne=a.biIsOne;exports.biIsPositive=a.biIsPositive;exports.biIsPrime=a.biIsPrime;exports.biIsZero=a.biIsZero;exports.biLcm=a.biLcm;exports.biMax=a.biMax;exports.biMin=a.biMin;exports.biNextPrime=a.biNextPrime;exports.biPow=a.biPow;exports.biPrevPrime=a.biPrevPrime;exports.booleanToInt=u.booleanToInt;exports.canParseBoolean=u.canParseBoolean;exports.compareBooleans=u.compareBooleans;exports.parseBoolean=u.parseBoolean;exports.xorBoolean=u.xorBoolean;exports.addDays=t.addDays;exports.addHours=t.addHours;exports.addMinutes=t.addMinutes;exports.compareDates=t.compareDates;exports.diffInDays=t.diffInDays;exports.diffInHours=t.diffInHours;exports.endOfDay=t.endOfDay;exports.endOfWeek=t.endOfWeek;exports.isSameDay=t.isSameDay;exports.isSameHour=t.isSameHour;exports.isSameMinute=t.isSameMinute;exports.isSameMonth=t.isSameMonth;exports.isSameSecond=t.isSameSecond;exports.isSameWeek=t.isSameWeek;exports.isSameYear=t.isSameYear;exports.isValidDate=t.isValidDate;exports.isWeekend=t.isWeekend;exports.startOfDay=t.startOfDay;exports.startOfWeek=t.startOfWeek;exports.deferred=A.deferred;exports.deepEqual=g.deepEqual;exports.looseEqual=g.looseEqual;exports.strictEqual=g.strictEqual;exports.compose=p.compose;exports.curryLeft=p.curryLeft;exports.flip=p.flip;exports.identity=p.identity;exports.memoize=p.memoize;exports.negate=p.negate;exports.once=p.once;exports.partial=p.partial;exports.pipe=p.pipe;exports.chain=l.chain;exports.every=l.every;exports.filter=l.filter;exports.find=l.find;exports.map=l.map;exports.reduce=l.reduce;exports.skip=l.skip;exports.some=l.some;exports.take=l.take;exports.toArray=l.toArray;exports.isJSON=y.isJSON;exports.isJSONArray=y.isJSONArray;exports.isJSONObject=y.isJSONObject;exports.isJSONPrimitive=y.isJSONPrimitive;exports.parseJSON=y.parseJSON;exports.mapEntries=m.mapEntries;exports.mapFilter=m.mapFilter;exports.mapFromEntries=m.mapFromEntries;exports.mapGroupBy=m.mapGroupBy;exports.mapIsEmpty=m.mapIsEmpty;exports.mapKeys=m.mapKeys;exports.mapMap=m.mapMap;exports.mapMerge=m.mapMerge;exports.mapToObject=m.mapToObject;exports.mapValues=m.mapValues;exports.EPSILON=i.EPSILON;exports.angleDifference=i.angleDifference;exports.ceilTo=i.ceilTo;exports.clamp=i.clamp;exports.clampInt=i.clampInt;exports.clampSym=i.clampSym;exports.compareNumbers=i.compareNumbers;exports.floorTo=i.floorTo;exports.interpolate=i.interpolate;exports.interpolateAngle=i.interpolateAngle;exports.interpolateAngleCCW=i.interpolateAngleCCW;exports.interpolateAngleCW=i.interpolateAngleCW;exports.interpolateWidestAngle=i.interpolateWidestAngle;exports.nearEqual=i.nearEqual;exports.nearEqualAngles=i.nearEqualAngles;exports.nearZero=i.nearZero;exports.root=i.root;exports.roundTo=i.roundTo;exports.toHex=i.toHex;exports.widestAngleDifference=i.widestAngleDifference;exports.wrap=i.wrap;exports.wrapCircular=i.wrapCircular;exports.deepClone=s.deepClone;exports.isEmptyObject=s.isEmptyObject;exports.isObject=s.isObject;exports.mergeObjects=s.mergeObjects;exports.objectEntries=s.objectEntries;exports.objectFromEntries=s.objectFromEntries;exports.objectKeys=s.objectKeys;exports.objectValues=s.objectValues;exports.omit=s.omit;exports.pick=s.pick;exports.removeObjectFields=s.removeObjectFields;exports.sameObjectKeys=s.sameObjectKeys;exports.sleep=S.sleep;exports.randomBytes=c.randomBytes;exports.randomChoice=c.randomChoice;exports.randomChoices=c.randomChoices;exports.randomFloat=c.randomFloat;exports.randomHex=c.randomHex;exports.randomInt=c.randomInt;exports.randomUuid=c.randomUuid;exports.seedRandom=c.seedRandom;exports.shuffle=c.shuffle;exports.shuffled=c.shuffled;exports.mapRegExp=C.mapRegExp;exports.Result=f.Result;exports.Validation=f.Validation;exports.setDifference=n.setDifference;exports.setFilter=n.setFilter;exports.setFromArray=n.setFromArray;exports.setIntersection=n.setIntersection;exports.setIsEmpty=n.setIsEmpty;exports.setIsSubset=n.setIsSubset;exports.setIsSuperset=n.setIsSuperset;exports.setMap=n.setMap;exports.setSymmetricDifference=n.setSymmetricDifference;exports.setToArray=n.setToArray;exports.setUnion=n.setUnion;exports.canonicalizeNewlines=e.canonicalizeNewlines;exports.capitalize=e.capitalize;exports.capitalizeWords=e.capitalizeWords;exports.chunkString=e.chunkString;exports.collapseText=e.collapseText;exports.compareCaseInsensitive=e.compareCaseInsensitive;exports.compareStrings=e.compareStrings;exports.containsAllText=e.containsAllText;exports.containsAllTextCaseInsensitive=e.containsAllTextCaseInsensitive;exports.containsAnyText=e.containsAnyText;exports.containsAnyTextCaseInsensitive=e.containsAnyTextCaseInsensitive;exports.countStringOccurrences=e.countStringOccurrences;exports.dasherize=e.dasherize;exports.decodeBase64=e.decodeBase64;exports.deleteFirstFromString=e.deleteFirstFromString;exports.deleteStringAfter=e.deleteStringAfter;exports.deleteStringBefore=e.deleteStringBefore;exports.deleteSubstring=e.deleteSubstring;exports.ellipsis=e.ellipsis;exports.ellipsisMiddle=e.ellipsisMiddle;exports.encodeBase64=e.encodeBase64;exports.filterCharcodes=e.filterCharcodes;exports.filterChars=e.filterChars;exports.humanize=e.humanize;exports.ifEmptyString=e.ifEmptyString;exports.isAlpha=e.isAlpha;exports.isAlphaNum=e.isAlphaNum;exports.isBreakingWhitespace=e.isBreakingWhitespace;exports.isDigitsOnly=e.isDigitsOnly;exports.isEmptyString=e.isEmptyString;exports.isLowerCase=e.isLowerCase;exports.isSpaceAt=e.isSpaceAt;exports.isUpperCase=e.isUpperCase;exports.jsQuote=e.jsQuote;exports.lowerCaseFirst=e.lowerCaseFirst;exports.lpad=e.lpad;exports.mapChars=e.mapChars;exports.quote=e.quote;exports.randomStringSequence=e.randomStringSequence;exports.randomStringSequenceBase64=e.randomStringSequenceBase64;exports.randomSubString=e.randomSubString;exports.reverseString=e.reverseString;exports.rpad=e.rpad;exports.smartQuote=e.smartQuote;exports.splitStringOnFirst=e.splitStringOnFirst;exports.splitStringOnLast=e.splitStringOnLast;exports.splitStringOnce=e.splitStringOnce;exports.stringEndsWithAny=e.stringEndsWithAny;exports.stringHasContent=e.stringHasContent;exports.stringHashCode=e.stringHashCode;exports.stringStartsWithAny=e.stringStartsWithAny;exports.stringToCharcodes=e.stringToCharcodes;exports.stringsDifferAtIndex=e.stringsDifferAtIndex;exports.substringAfter=e.substringAfter;exports.substringAfterLast=e.substringAfterLast;exports.substringBefore=e.substringBefore;exports.substringBeforeLast=e.substringBeforeLast;exports.surroundString=e.surroundString;exports.textContainsCaseInsensitive=e.textContainsCaseInsensitive;exports.textEndsWithAnyCaseInsensitive=e.textEndsWithAnyCaseInsensitive;exports.textEndsWithCaseInsensitive=e.textEndsWithCaseInsensitive;exports.textStartsWithAnyCaseInsensitive=e.textStartsWithAnyCaseInsensitive;exports.textStartsWithCaseInsensitive=e.textStartsWithCaseInsensitive;exports.textToLines=e.textToLines;exports.trimChars=e.trimChars;exports.trimCharsLeft=e.trimCharsLeft;exports.trimCharsRight=e.trimCharsRight;exports.trimStringSlice=e.trimStringSlice;exports.underscore=e.underscore;exports.upperCaseFirst=e.upperCaseFirst;exports.wrapColumns=e.wrapColumns;exports.wrapLine=e.wrapLine;exports.debounce=d.debounce;exports.delayed=d.delayed;exports.delayedAnimationFrame=d.delayedAnimationFrame;exports.interval=d.interval;exports.intervalAnimationFrame=d.intervalAnimationFrame;exports.throttle=d.throttle;exports.buildUrl=o.buildUrl;exports.getBaseName=o.getBaseName;exports.getFileExtension=o.getFileExtension;exports.getFileName=o.getFileName;exports.getQueryParams=o.getQueryParams;exports.isValidUrl=o.isValidUrl;exports.joinPaths=o.joinPaths;exports.normalizePath=o.normalizePath;exports.parseUrl=o.parseUrl;exports.removeQueryParam=o.removeQueryParam;exports.setQueryParam=o.setQueryParam;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./array.cjs"),v=require("./async-result.cjs"),i=require("./bigint.cjs"),u=require("./boolean.cjs"),a=require("./color-D7FAmkht.cjs"),H=require("./color-named.cjs"),g=require("./color-adjust.cjs"),S=require("./color-contrast.cjs"),A=require("./color-distance.cjs"),y=require("./color-harmony.cjs"),T=require("./color-mix.cjs"),C=require("./color-utils.cjs"),t=require("./date.cjs"),P=require("./deferred.cjs"),f=require("./equal.cjs"),b=require("./function.cjs"),c=require("./iterator.cjs"),h=require("./json.cjs"),m=require("./map.cjs"),s=require("./number.cjs"),o=require("./object.cjs"),k=require("./promise.cjs"),p=require("./random.cjs"),I=require("./regexp.cjs"),O=require("./result-DBJ3htTg.cjs"),n=require("./set.cjs"),e=require("./string.cjs"),d=require("./timer.cjs"),l=require("./url.cjs");exports.applyArrayDiffOperations=r.applyArrayDiffOperations;exports.areArraysEqual=r.areArraysEqual;exports.arrayDiffOperations=r.arrayDiffOperations;exports.arrayHasValues=r.arrayHasValues;exports.arrayHead=r.arrayHead;exports.arrayTail=r.arrayTail;exports.buildArray=r.buildArray;exports.chunk=r.chunk;exports.compareArrays=r.compareArrays;exports.fillArray=r.fillArray;exports.filterMapArray=r.filterMapArray;exports.filterNullsFromArray=r.filterNullsFromArray;exports.groupBy=r.groupBy;exports.isArrayEmpty=r.isArrayEmpty;exports.joinArrayWithConjunction=r.joinArrayWithConjunction;exports.partition=r.partition;exports.range=r.range;exports.rankArray=r.rankArray;exports.removeAllFromArray=r.removeAllFromArray;exports.removeAllFromArrayByPredicate=r.removeAllFromArrayByPredicate;exports.removeOneFromArray=r.removeOneFromArray;exports.removeOneFromArrayByPredicate=r.removeOneFromArrayByPredicate;exports.uniqueByPrimitive=r.uniqueByPrimitive;exports.AsyncResult=v.AsyncResult;exports.biAbs=i.biAbs;exports.biCeilDiv=i.biCeilDiv;exports.biCompare=i.biCompare;exports.biFloorDiv=i.biFloorDiv;exports.biGcd=i.biGcd;exports.biIsEven=i.biIsEven;exports.biIsNegative=i.biIsNegative;exports.biIsOdd=i.biIsOdd;exports.biIsOne=i.biIsOne;exports.biIsPositive=i.biIsPositive;exports.biIsPrime=i.biIsPrime;exports.biIsZero=i.biIsZero;exports.biLcm=i.biLcm;exports.biMax=i.biMax;exports.biMin=i.biMin;exports.biNextPrime=i.biNextPrime;exports.biPow=i.biPow;exports.biPrevPrime=i.biPrevPrime;exports.booleanToInt=u.booleanToInt;exports.canParseBoolean=u.canParseBoolean;exports.compareBooleans=u.compareBooleans;exports.parseBoolean=u.parseBoolean;exports.xorBoolean=u.xorBoolean;exports.canParseColor=a.canParseColor;exports.canParseHex=a.canParseHex;exports.canParseHsl=a.canParseHsl;exports.canParseHsv=a.canParseHsv;exports.canParseHwb=a.canParseHwb;exports.canParseLab=a.canParseLab;exports.canParseLch=a.canParseLch;exports.canParseNamedColor=a.canParseNamedColor;exports.canParseOklab=a.canParseOklab;exports.canParseOklch=a.canParseOklch;exports.canParseRgb=a.canParseRgb;exports.colorToString=a.colorToString;exports.convertColor=a.convertColor;exports.detectColorSpace=a.detectColorSpace;exports.hsla=a.hsla;exports.hslaToHslString=a.hslaToHslString;exports.hslaToHsva=a.hslaToHsva;exports.hslaToRgb8a=a.hslaToRgb8a;exports.hsva=a.hsva;exports.hsvaToHsla=a.hsvaToHsla;exports.hsvaToHsvString=a.hsvaToHsvString;exports.hsvaToRgb8a=a.hsvaToRgb8a;exports.hwba=a.hwba;exports.hwbaToHwbString=a.hwbaToHwbString;exports.hwbaToRgb8a=a.hwbaToRgb8a;exports.isHsla=a.isHsla;exports.isHsva=a.isHsva;exports.isHwba=a.isHwba;exports.isLaba=a.isLaba;exports.isLcha=a.isLcha;exports.isOklaba=a.isOklaba;exports.isOklcha=a.isOklcha;exports.isRgb8a=a.isRgb8a;exports.isRgba=a.isRgba;exports.laba=a.laba;exports.labaToLabString=a.labaToLabString;exports.labaToRgb8a=a.labaToRgb8a;exports.lcha=a.lcha;exports.lchaToLchString=a.lchaToLchString;exports.lchaToRgb8a=a.lchaToRgb8a;exports.oklaba=a.oklaba;exports.oklabaToOklabString=a.oklabaToOklabString;exports.oklabaToRgb8a=a.oklabaToRgb8a;exports.oklcha=a.oklcha;exports.oklchaToOklchString=a.oklchaToOklchString;exports.oklchaToRgb8a=a.oklchaToRgb8a;exports.parseAlpha=a.parseAlpha;exports.parseColor=a.parseColor;exports.parseHex=a.parseHex;exports.parseHsl=a.parseHsl;exports.parseHsv=a.parseHsv;exports.parseHwb=a.parseHwb;exports.parseLab=a.parseLab;exports.parseLch=a.parseLch;exports.parseNamedColor=a.parseNamedColor;exports.parseOklab=a.parseOklab;exports.parseOklch=a.parseOklch;exports.parseRgb=a.parseRgb;exports.rgb8a=a.rgb8a;exports.rgb8aToHexString=a.rgb8aToHexString;exports.rgb8aToHsla=a.rgb8aToHsla;exports.rgb8aToHsva=a.rgb8aToHsva;exports.rgb8aToHwba=a.rgb8aToHwba;exports.rgb8aToLaba=a.rgb8aToLaba;exports.rgb8aToLcha=a.rgb8aToLcha;exports.rgb8aToOklaba=a.rgb8aToOklaba;exports.rgb8aToOklcha=a.rgb8aToOklcha;exports.rgb8aToRgbString=a.rgb8aToRgbString;exports.rgb8aToRgba=a.rgb8aToRgba;exports.rgba=a.rgba;exports.rgbaToRgb8a=a.rgbaToRgb8a;exports.NAMED_COLORS=H.NAMED_COLORS;exports.darken=g.darken;exports.desaturate=g.desaturate;exports.grayscale=g.grayscale;exports.invert=g.invert;exports.lighten=g.lighten;exports.opacify=g.opacify;exports.saturate=g.saturate;exports.transparentize=g.transparentize;exports.contrastColor=S.contrastColor;exports.contrastRatio=S.contrastRatio;exports.luminance=S.luminance;exports.meetsContrast=S.meetsContrast;exports.colorDistance=A.colorDistance;exports.colorDistanceSimple=A.colorDistanceSimple;exports.analogous=y.analogous;exports.complement=y.complement;exports.splitComplementary=y.splitComplementary;exports.tetradic=y.tetradic;exports.triadic=y.triadic;exports.interpolateColors=T.interpolateColors;exports.mixColors=T.mixColors;exports.closestNamedColor=C.closestNamedColor;exports.equalColors=C.equalColors;exports.randomColor=C.randomColor;exports.addDays=t.addDays;exports.addHours=t.addHours;exports.addMinutes=t.addMinutes;exports.compareDates=t.compareDates;exports.diffInDays=t.diffInDays;exports.diffInHours=t.diffInHours;exports.endOfDay=t.endOfDay;exports.endOfWeek=t.endOfWeek;exports.isSameDay=t.isSameDay;exports.isSameHour=t.isSameHour;exports.isSameMinute=t.isSameMinute;exports.isSameMonth=t.isSameMonth;exports.isSameSecond=t.isSameSecond;exports.isSameWeek=t.isSameWeek;exports.isSameYear=t.isSameYear;exports.isValidDate=t.isValidDate;exports.isWeekend=t.isWeekend;exports.startOfDay=t.startOfDay;exports.startOfWeek=t.startOfWeek;exports.deferred=P.deferred;exports.deepEqual=f.deepEqual;exports.looseEqual=f.looseEqual;exports.strictEqual=f.strictEqual;exports.compose=b.compose;exports.curryLeft=b.curryLeft;exports.flip=b.flip;exports.identity=b.identity;exports.memoize=b.memoize;exports.negate=b.negate;exports.once=b.once;exports.partial=b.partial;exports.pipe=b.pipe;exports.chain=c.chain;exports.every=c.every;exports.filter=c.filter;exports.find=c.find;exports.map=c.map;exports.reduce=c.reduce;exports.skip=c.skip;exports.some=c.some;exports.take=c.take;exports.toArray=c.toArray;exports.isJSON=h.isJSON;exports.isJSONArray=h.isJSONArray;exports.isJSONObject=h.isJSONObject;exports.isJSONPrimitive=h.isJSONPrimitive;exports.parseJSON=h.parseJSON;exports.mapEntries=m.mapEntries;exports.mapFilter=m.mapFilter;exports.mapFromEntries=m.mapFromEntries;exports.mapGroupBy=m.mapGroupBy;exports.mapIsEmpty=m.mapIsEmpty;exports.mapKeys=m.mapKeys;exports.mapMap=m.mapMap;exports.mapMerge=m.mapMerge;exports.mapToObject=m.mapToObject;exports.mapValues=m.mapValues;exports.EPSILON=s.EPSILON;exports.angleDifference=s.angleDifference;exports.ceilTo=s.ceilTo;exports.clamp=s.clamp;exports.clampInt=s.clampInt;exports.clampSym=s.clampSym;exports.compareNumbers=s.compareNumbers;exports.floorTo=s.floorTo;exports.interpolate=s.interpolate;exports.interpolateAngle=s.interpolateAngle;exports.interpolateAngleCCW=s.interpolateAngleCCW;exports.interpolateAngleCW=s.interpolateAngleCW;exports.interpolateWidestAngle=s.interpolateWidestAngle;exports.nearEqual=s.nearEqual;exports.nearEqualAngles=s.nearEqualAngles;exports.nearZero=s.nearZero;exports.root=s.root;exports.roundTo=s.roundTo;exports.snapToGrid=s.snapToGrid;exports.toHex=s.toHex;exports.widestAngleDifference=s.widestAngleDifference;exports.wrap=s.wrap;exports.wrapCircular=s.wrapCircular;exports.deepClone=o.deepClone;exports.isEmptyObject=o.isEmptyObject;exports.isObject=o.isObject;exports.mergeObjects=o.mergeObjects;exports.objectEntries=o.objectEntries;exports.objectFromEntries=o.objectFromEntries;exports.objectKeys=o.objectKeys;exports.objectValues=o.objectValues;exports.omit=o.omit;exports.pick=o.pick;exports.removeObjectFields=o.removeObjectFields;exports.sameObjectKeys=o.sameObjectKeys;exports.sleep=k.sleep;exports.randomBytes=p.randomBytes;exports.randomChoice=p.randomChoice;exports.randomChoices=p.randomChoices;exports.randomFloat=p.randomFloat;exports.randomHex=p.randomHex;exports.randomInt=p.randomInt;exports.randomUuid=p.randomUuid;exports.seedRandom=p.seedRandom;exports.shuffle=p.shuffle;exports.shuffled=p.shuffled;exports.mapRegExp=I.mapRegExp;exports.Result=O.Result;exports.Validation=O.Validation;exports.setDifference=n.setDifference;exports.setFilter=n.setFilter;exports.setFromArray=n.setFromArray;exports.setIntersection=n.setIntersection;exports.setIsEmpty=n.setIsEmpty;exports.setIsSubset=n.setIsSubset;exports.setIsSuperset=n.setIsSuperset;exports.setMap=n.setMap;exports.setSymmetricDifference=n.setSymmetricDifference;exports.setToArray=n.setToArray;exports.setUnion=n.setUnion;exports.canonicalizeNewlines=e.canonicalizeNewlines;exports.capitalize=e.capitalize;exports.capitalizeWords=e.capitalizeWords;exports.chunkString=e.chunkString;exports.collapseText=e.collapseText;exports.compareCaseInsensitive=e.compareCaseInsensitive;exports.compareStrings=e.compareStrings;exports.containsAllText=e.containsAllText;exports.containsAllTextCaseInsensitive=e.containsAllTextCaseInsensitive;exports.containsAnyText=e.containsAnyText;exports.containsAnyTextCaseInsensitive=e.containsAnyTextCaseInsensitive;exports.countStringOccurrences=e.countStringOccurrences;exports.dasherize=e.dasherize;exports.decodeBase64=e.decodeBase64;exports.deleteFirstFromString=e.deleteFirstFromString;exports.deleteStringAfter=e.deleteStringAfter;exports.deleteStringBefore=e.deleteStringBefore;exports.deleteSubstring=e.deleteSubstring;exports.ellipsis=e.ellipsis;exports.ellipsisMiddle=e.ellipsisMiddle;exports.encodeBase64=e.encodeBase64;exports.filterCharcodes=e.filterCharcodes;exports.filterChars=e.filterChars;exports.humanize=e.humanize;exports.ifEmptyString=e.ifEmptyString;exports.isAlpha=e.isAlpha;exports.isAlphaNum=e.isAlphaNum;exports.isBreakingWhitespace=e.isBreakingWhitespace;exports.isDigitsOnly=e.isDigitsOnly;exports.isEmptyString=e.isEmptyString;exports.isLowerCase=e.isLowerCase;exports.isSpaceAt=e.isSpaceAt;exports.isUpperCase=e.isUpperCase;exports.jsQuote=e.jsQuote;exports.lowerCaseFirst=e.lowerCaseFirst;exports.lpad=e.lpad;exports.mapChars=e.mapChars;exports.quote=e.quote;exports.randomStringSequence=e.randomStringSequence;exports.randomStringSequenceBase64=e.randomStringSequenceBase64;exports.randomSubString=e.randomSubString;exports.reverseString=e.reverseString;exports.rpad=e.rpad;exports.smartQuote=e.smartQuote;exports.splitStringOnFirst=e.splitStringOnFirst;exports.splitStringOnLast=e.splitStringOnLast;exports.splitStringOnce=e.splitStringOnce;exports.stringEndsWithAny=e.stringEndsWithAny;exports.stringHasContent=e.stringHasContent;exports.stringHashCode=e.stringHashCode;exports.stringStartsWithAny=e.stringStartsWithAny;exports.stringToCharcodes=e.stringToCharcodes;exports.stringsDifferAtIndex=e.stringsDifferAtIndex;exports.substringAfter=e.substringAfter;exports.substringAfterLast=e.substringAfterLast;exports.substringBefore=e.substringBefore;exports.substringBeforeLast=e.substringBeforeLast;exports.surroundString=e.surroundString;exports.textContainsCaseInsensitive=e.textContainsCaseInsensitive;exports.textEndsWithAnyCaseInsensitive=e.textEndsWithAnyCaseInsensitive;exports.textEndsWithCaseInsensitive=e.textEndsWithCaseInsensitive;exports.textStartsWithAnyCaseInsensitive=e.textStartsWithAnyCaseInsensitive;exports.textStartsWithCaseInsensitive=e.textStartsWithCaseInsensitive;exports.textToLines=e.textToLines;exports.trimChars=e.trimChars;exports.trimCharsLeft=e.trimCharsLeft;exports.trimCharsRight=e.trimCharsRight;exports.trimStringSlice=e.trimStringSlice;exports.underscore=e.underscore;exports.upperCaseFirst=e.upperCaseFirst;exports.wrapColumns=e.wrapColumns;exports.wrapLine=e.wrapLine;exports.debounce=d.debounce;exports.delayed=d.delayed;exports.delayedAnimationFrame=d.delayedAnimationFrame;exports.interval=d.interval;exports.intervalAnimationFrame=d.intervalAnimationFrame;exports.throttle=d.throttle;exports.buildUrl=l.buildUrl;exports.getBaseName=l.getBaseName;exports.getFileExtension=l.getFileExtension;exports.getFileName=l.getFileName;exports.getQueryParams=l.getQueryParams;exports.isValidUrl=l.isValidUrl;exports.joinPaths=l.joinPaths;exports.normalizePath=l.normalizePath;exports.parseUrl=l.parseUrl;exports.removeQueryParam=l.removeQueryParam;exports.setQueryParam=l.setQueryParam;
|
package/index.d.ts
CHANGED
|
@@ -2,6 +2,20 @@ export * from './array';
|
|
|
2
2
|
export * from './async-result';
|
|
3
3
|
export * from './bigint';
|
|
4
4
|
export * from './boolean';
|
|
5
|
+
export * from './color';
|
|
6
|
+
export * from './color-hsl';
|
|
7
|
+
export * from './color-hsv';
|
|
8
|
+
export * from './color-hwb';
|
|
9
|
+
export * from './color-lab';
|
|
10
|
+
export * from './color-named';
|
|
11
|
+
export * from './color-oklab';
|
|
12
|
+
export * from './color-adjust';
|
|
13
|
+
export * from './color-contrast';
|
|
14
|
+
export * from './color-distance';
|
|
15
|
+
export * from './color-harmony';
|
|
16
|
+
export * from './color-mix';
|
|
17
|
+
export * from './color-rgb';
|
|
18
|
+
export * from './color-utils';
|
|
5
19
|
export * from './date';
|
|
6
20
|
export * from './deferred';
|
|
7
21
|
export * from './domain';
|