@thi.ng/color 4.1.7 → 5.0.2
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/CHANGELOG.md +31 -1
- package/README.md +3 -3
- package/analog.d.ts +15 -15
- package/analog.js +16 -15
- package/api/constants.d.ts +1 -1
- package/api/constants.js +1 -1
- package/api/system.d.ts +1 -1
- package/api/system.js +1 -1
- package/api.d.ts +13 -6
- package/color-range.d.ts +6 -6
- package/color-range.js +6 -6
- package/convert.d.ts +1 -1
- package/convert.js +1 -1
- package/cosine-gradients.d.ts +5 -5
- package/cosine-gradients.js +5 -5
- package/css/parse-css.d.ts +1 -1
- package/css/parse-css.js +1 -1
- package/defcolor.js +5 -1
- package/distance.d.ts +17 -17
- package/distance.js +17 -17
- package/gradients.d.ts +2 -2
- package/gradients.js +2 -2
- package/hcy/hcy.js +5 -1
- package/hsi/hsi.js +5 -1
- package/hsl/hsl.js +10 -1
- package/hsv/hsv.js +10 -1
- package/index.d.ts +8 -0
- package/index.js +8 -0
- package/int/int-int.d.ts +1 -1
- package/int/int-int.js +1 -1
- package/internal/dispatch.d.ts +4 -0
- package/internal/dispatch.js +2 -0
- package/invert.d.ts +8 -1
- package/invert.js +34 -1
- package/is-black.d.ts +1 -1
- package/is-black.js +10 -7
- package/is-gamut.d.ts +9 -0
- package/is-gamut.js +16 -0
- package/is-gray.d.ts +1 -1
- package/is-gray.js +10 -8
- package/is-white.d.ts +1 -1
- package/is-white.js +9 -6
- package/lab/lab-css.d.ts +1 -1
- package/lab/lab-css.js +1 -1
- package/lab/lab-rgb.d.ts +4 -4
- package/lab/lab-rgb.js +4 -4
- package/lab/lab-xyz.d.ts +5 -5
- package/lab/lab-xyz.js +5 -5
- package/lch/lch-css.d.ts +1 -1
- package/lch/lch-css.js +1 -1
- package/lch/lch.js +1 -0
- package/lighten.d.ts +11 -0
- package/lighten.js +21 -0
- package/luminance-rgb.d.ts +2 -2
- package/luminance-rgb.js +2 -2
- package/luminance.d.ts +2 -2
- package/luminance.js +3 -2
- package/max-chroma.d.ts +8 -0
- package/max-chroma.js +240 -0
- package/mix.d.ts +8 -8
- package/mix.js +9 -8
- package/oklab/oklab-rgb.d.ts +2 -2
- package/oklab/oklab-rgb.js +2 -2
- package/package.json +131 -109
- package/rgb/rgb-lab.d.ts +4 -4
- package/rgb/rgb-lab.js +4 -4
- package/rgb/rgb-oklab.d.ts +2 -2
- package/rgb/rgb-oklab.js +2 -2
- package/rgb/rgb-xyz.d.ts +2 -2
- package/rgb/rgb-xyz.js +2 -2
- package/rgb/rgb-ycc.d.ts +3 -3
- package/rgb/rgb-ycc.js +3 -3
- package/rotate.d.ts +4 -0
- package/rotate.js +10 -0
- package/sort.d.ts +7 -7
- package/sort.js +7 -7
- package/strategies.d.ts +90 -0
- package/strategies.js +122 -0
- package/tint.d.ts +6 -0
- package/tint.js +11 -0
- package/transform.d.ts +11 -11
- package/transform.js +11 -11
- package/variations.d.ts +29 -0
- package/variations.js +14 -0
- package/xyy/xyy-xyz.d.ts +2 -2
- package/xyy/xyy-xyz.js +2 -2
- package/xyz/wavelength-xyz.d.ts +3 -3
- package/xyz/wavelength-xyz.js +3 -3
- package/xyz/xyz-lab.d.ts +5 -5
- package/xyz/xyz-lab.js +5 -5
- package/xyz/xyz-rgb.d.ts +2 -2
- package/xyz/xyz-rgb.js +2 -2
- package/xyz/xyz-xyy.d.ts +2 -2
- package/xyz/xyz-xyy.js +2 -2
- package/ycc/ycc-rgb.d.ts +3 -3
- package/ycc/ycc-rgb.js +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/color",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -32,30 +32,31 @@
|
|
|
32
32
|
"doc:stats": "tools:module-stats",
|
|
33
33
|
"pub": "yarn npm publish --access public",
|
|
34
34
|
"test": "testament test",
|
|
35
|
+
"tool:maxchroma": "tools:node-esm tools/max-chroma.ts",
|
|
35
36
|
"tool:swatches": "tools:node-esm tools/index.ts"
|
|
36
37
|
},
|
|
37
38
|
"dependencies": {
|
|
38
|
-
"@thi.ng/api": "^8.3.
|
|
39
|
-
"@thi.ng/arrays": "^2.1
|
|
40
|
-
"@thi.ng/binary": "^3.1
|
|
41
|
-
"@thi.ng/checks": "^3.1.
|
|
42
|
-
"@thi.ng/compare": "^2.1.
|
|
43
|
-
"@thi.ng/compose": "^2.1.
|
|
44
|
-
"@thi.ng/defmulti": "^2.1.
|
|
45
|
-
"@thi.ng/errors": "^2.1.
|
|
46
|
-
"@thi.ng/math": "^5.
|
|
47
|
-
"@thi.ng/random": "^3.2.
|
|
48
|
-
"@thi.ng/strings": "^3.3.
|
|
49
|
-
"@thi.ng/transducers": "^8.
|
|
50
|
-
"@thi.ng/vectors": "^7.
|
|
39
|
+
"@thi.ng/api": "^8.3.5",
|
|
40
|
+
"@thi.ng/arrays": "^2.2.1",
|
|
41
|
+
"@thi.ng/binary": "^3.2.1",
|
|
42
|
+
"@thi.ng/checks": "^3.1.5",
|
|
43
|
+
"@thi.ng/compare": "^2.1.5",
|
|
44
|
+
"@thi.ng/compose": "^2.1.5",
|
|
45
|
+
"@thi.ng/defmulti": "^2.1.5",
|
|
46
|
+
"@thi.ng/errors": "^2.1.5",
|
|
47
|
+
"@thi.ng/math": "^5.3.1",
|
|
48
|
+
"@thi.ng/random": "^3.2.5",
|
|
49
|
+
"@thi.ng/strings": "^3.3.3",
|
|
50
|
+
"@thi.ng/transducers": "^8.3.1",
|
|
51
|
+
"@thi.ng/vectors": "^7.5.2"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
|
-
"@microsoft/api-extractor": "^7.19.
|
|
54
|
-
"@thi.ng/testament": "^0.2.
|
|
54
|
+
"@microsoft/api-extractor": "^7.19.4",
|
|
55
|
+
"@thi.ng/testament": "^0.2.5",
|
|
55
56
|
"rimraf": "^3.0.2",
|
|
56
57
|
"tools": "^0.0.1",
|
|
57
|
-
"typedoc": "^0.22.
|
|
58
|
-
"typescript": "^4.
|
|
58
|
+
"typedoc": "^0.22.13",
|
|
59
|
+
"typescript": "^4.6.2"
|
|
59
60
|
},
|
|
60
61
|
"keywords": [
|
|
61
62
|
"color",
|
|
@@ -123,274 +124,295 @@
|
|
|
123
124
|
],
|
|
124
125
|
"exports": {
|
|
125
126
|
".": {
|
|
126
|
-
"
|
|
127
|
+
"default": "./index.js"
|
|
127
128
|
},
|
|
128
129
|
"./alpha": {
|
|
129
|
-
"
|
|
130
|
+
"default": "./alpha.js"
|
|
130
131
|
},
|
|
131
132
|
"./analog": {
|
|
132
|
-
"
|
|
133
|
+
"default": "./analog.js"
|
|
133
134
|
},
|
|
134
135
|
"./api/constants": {
|
|
135
|
-
"
|
|
136
|
+
"default": "./api/constants.js"
|
|
136
137
|
},
|
|
137
138
|
"./api/gradients": {
|
|
138
|
-
"
|
|
139
|
+
"default": "./api/gradients.js"
|
|
139
140
|
},
|
|
140
141
|
"./api/names": {
|
|
141
|
-
"
|
|
142
|
+
"default": "./api/names.js"
|
|
142
143
|
},
|
|
143
144
|
"./api/ranges": {
|
|
144
|
-
"
|
|
145
|
+
"default": "./api/ranges.js"
|
|
145
146
|
},
|
|
146
147
|
"./api/system": {
|
|
147
|
-
"
|
|
148
|
+
"default": "./api/system.js"
|
|
148
149
|
},
|
|
149
150
|
"./api": {
|
|
150
|
-
"
|
|
151
|
+
"default": "./api.js"
|
|
151
152
|
},
|
|
152
153
|
"./clamp": {
|
|
153
|
-
"
|
|
154
|
+
"default": "./clamp.js"
|
|
154
155
|
},
|
|
155
156
|
"./closest-hue": {
|
|
156
|
-
"
|
|
157
|
+
"default": "./closest-hue.js"
|
|
157
158
|
},
|
|
158
159
|
"./color-range": {
|
|
159
|
-
"
|
|
160
|
+
"default": "./color-range.js"
|
|
160
161
|
},
|
|
161
162
|
"./color": {
|
|
162
|
-
"
|
|
163
|
+
"default": "./color.js"
|
|
163
164
|
},
|
|
164
165
|
"./convert": {
|
|
165
|
-
"
|
|
166
|
+
"default": "./convert.js"
|
|
166
167
|
},
|
|
167
168
|
"./cosine-gradients": {
|
|
168
|
-
"
|
|
169
|
+
"default": "./cosine-gradients.js"
|
|
169
170
|
},
|
|
170
171
|
"./css/css": {
|
|
171
|
-
"
|
|
172
|
+
"default": "./css/css.js"
|
|
172
173
|
},
|
|
173
174
|
"./css/parse-css": {
|
|
174
|
-
"
|
|
175
|
+
"default": "./css/parse-css.js"
|
|
175
176
|
},
|
|
176
177
|
"./defcolor": {
|
|
177
|
-
"
|
|
178
|
+
"default": "./defcolor.js"
|
|
178
179
|
},
|
|
179
180
|
"./distance": {
|
|
180
|
-
"
|
|
181
|
+
"default": "./distance.js"
|
|
181
182
|
},
|
|
182
183
|
"./gradients": {
|
|
183
|
-
"
|
|
184
|
+
"default": "./gradients.js"
|
|
184
185
|
},
|
|
185
186
|
"./hcy/hcy-rgb": {
|
|
186
|
-
"
|
|
187
|
+
"default": "./hcy/hcy-rgb.js"
|
|
187
188
|
},
|
|
188
189
|
"./hcy/hcy": {
|
|
189
|
-
"
|
|
190
|
+
"default": "./hcy/hcy.js"
|
|
190
191
|
},
|
|
191
192
|
"./hsi/hsi-rgb": {
|
|
192
|
-
"
|
|
193
|
+
"default": "./hsi/hsi-rgb.js"
|
|
193
194
|
},
|
|
194
195
|
"./hsi/hsi": {
|
|
195
|
-
"
|
|
196
|
+
"default": "./hsi/hsi.js"
|
|
196
197
|
},
|
|
197
198
|
"./hsl/hsl-css": {
|
|
198
|
-
"
|
|
199
|
+
"default": "./hsl/hsl-css.js"
|
|
199
200
|
},
|
|
200
201
|
"./hsl/hsl-hsv": {
|
|
201
|
-
"
|
|
202
|
+
"default": "./hsl/hsl-hsv.js"
|
|
202
203
|
},
|
|
203
204
|
"./hsl/hsl-rgb": {
|
|
204
|
-
"
|
|
205
|
+
"default": "./hsl/hsl-rgb.js"
|
|
205
206
|
},
|
|
206
207
|
"./hsl/hsl": {
|
|
207
|
-
"
|
|
208
|
+
"default": "./hsl/hsl.js"
|
|
208
209
|
},
|
|
209
210
|
"./hsv/hsv-css": {
|
|
210
|
-
"
|
|
211
|
+
"default": "./hsv/hsv-css.js"
|
|
211
212
|
},
|
|
212
213
|
"./hsv/hsv-hsl": {
|
|
213
|
-
"
|
|
214
|
+
"default": "./hsv/hsv-hsl.js"
|
|
214
215
|
},
|
|
215
216
|
"./hsv/hsv-rgb": {
|
|
216
|
-
"
|
|
217
|
+
"default": "./hsv/hsv-rgb.js"
|
|
217
218
|
},
|
|
218
219
|
"./hsv/hsv": {
|
|
219
|
-
"
|
|
220
|
+
"default": "./hsv/hsv.js"
|
|
220
221
|
},
|
|
221
222
|
"./int/int-css": {
|
|
222
|
-
"
|
|
223
|
+
"default": "./int/int-css.js"
|
|
223
224
|
},
|
|
224
225
|
"./int/int-int": {
|
|
225
|
-
"
|
|
226
|
+
"default": "./int/int-int.js"
|
|
226
227
|
},
|
|
227
228
|
"./int/int-rgb": {
|
|
228
|
-
"
|
|
229
|
+
"default": "./int/int-rgb.js"
|
|
229
230
|
},
|
|
230
231
|
"./int/int-srgb": {
|
|
231
|
-
"
|
|
232
|
+
"default": "./int/int-srgb.js"
|
|
232
233
|
},
|
|
233
234
|
"./int/int": {
|
|
234
|
-
"
|
|
235
|
+
"default": "./int/int.js"
|
|
235
236
|
},
|
|
236
237
|
"./invert": {
|
|
237
|
-
"
|
|
238
|
+
"default": "./invert.js"
|
|
238
239
|
},
|
|
239
240
|
"./is-black": {
|
|
240
|
-
"
|
|
241
|
+
"default": "./is-black.js"
|
|
242
|
+
},
|
|
243
|
+
"./is-gamut": {
|
|
244
|
+
"default": "./is-gamut.js"
|
|
241
245
|
},
|
|
242
246
|
"./is-gray": {
|
|
243
|
-
"
|
|
247
|
+
"default": "./is-gray.js"
|
|
244
248
|
},
|
|
245
249
|
"./is-white": {
|
|
246
|
-
"
|
|
250
|
+
"default": "./is-white.js"
|
|
247
251
|
},
|
|
248
252
|
"./lab/lab-css": {
|
|
249
|
-
"
|
|
253
|
+
"default": "./lab/lab-css.js"
|
|
250
254
|
},
|
|
251
255
|
"./lab/lab-lab": {
|
|
252
|
-
"
|
|
256
|
+
"default": "./lab/lab-lab.js"
|
|
253
257
|
},
|
|
254
258
|
"./lab/lab-lch": {
|
|
255
|
-
"
|
|
259
|
+
"default": "./lab/lab-lch.js"
|
|
256
260
|
},
|
|
257
261
|
"./lab/lab-rgb": {
|
|
258
|
-
"
|
|
262
|
+
"default": "./lab/lab-rgb.js"
|
|
259
263
|
},
|
|
260
264
|
"./lab/lab-xyz": {
|
|
261
|
-
"
|
|
265
|
+
"default": "./lab/lab-xyz.js"
|
|
262
266
|
},
|
|
263
267
|
"./lab/lab50": {
|
|
264
|
-
"
|
|
268
|
+
"default": "./lab/lab50.js"
|
|
265
269
|
},
|
|
266
270
|
"./lab/lab65": {
|
|
267
|
-
"
|
|
271
|
+
"default": "./lab/lab65.js"
|
|
268
272
|
},
|
|
269
273
|
"./lch/lch-css": {
|
|
270
|
-
"
|
|
274
|
+
"default": "./lch/lch-css.js"
|
|
271
275
|
},
|
|
272
276
|
"./lch/lch": {
|
|
273
|
-
"
|
|
277
|
+
"default": "./lch/lch.js"
|
|
278
|
+
},
|
|
279
|
+
"./lighten": {
|
|
280
|
+
"default": "./lighten.js"
|
|
274
281
|
},
|
|
275
282
|
"./linear": {
|
|
276
|
-
"
|
|
283
|
+
"default": "./linear.js"
|
|
277
284
|
},
|
|
278
285
|
"./luminance-rgb": {
|
|
279
|
-
"
|
|
286
|
+
"default": "./luminance-rgb.js"
|
|
280
287
|
},
|
|
281
288
|
"./luminance": {
|
|
282
|
-
"
|
|
289
|
+
"default": "./luminance.js"
|
|
290
|
+
},
|
|
291
|
+
"./max-chroma": {
|
|
292
|
+
"default": "./max-chroma.js"
|
|
283
293
|
},
|
|
284
294
|
"./mix": {
|
|
285
|
-
"
|
|
295
|
+
"default": "./mix.js"
|
|
286
296
|
},
|
|
287
297
|
"./oklab/oklab-rgb": {
|
|
288
|
-
"
|
|
298
|
+
"default": "./oklab/oklab-rgb.js"
|
|
289
299
|
},
|
|
290
300
|
"./oklab/oklab-xyz": {
|
|
291
|
-
"
|
|
301
|
+
"default": "./oklab/oklab-xyz.js"
|
|
292
302
|
},
|
|
293
303
|
"./oklab/oklab": {
|
|
294
|
-
"
|
|
304
|
+
"default": "./oklab/oklab.js"
|
|
295
305
|
},
|
|
296
306
|
"./rgb/hue-rgb": {
|
|
297
|
-
"
|
|
307
|
+
"default": "./rgb/hue-rgb.js"
|
|
298
308
|
},
|
|
299
309
|
"./rgb/kelvin-rgba": {
|
|
300
|
-
"
|
|
310
|
+
"default": "./rgb/kelvin-rgba.js"
|
|
301
311
|
},
|
|
302
312
|
"./rgb/rgb-css": {
|
|
303
|
-
"
|
|
313
|
+
"default": "./rgb/rgb-css.js"
|
|
304
314
|
},
|
|
305
315
|
"./rgb/rgb-hcv": {
|
|
306
|
-
"
|
|
316
|
+
"default": "./rgb/rgb-hcv.js"
|
|
307
317
|
},
|
|
308
318
|
"./rgb/rgb-hcy": {
|
|
309
|
-
"
|
|
319
|
+
"default": "./rgb/rgb-hcy.js"
|
|
310
320
|
},
|
|
311
321
|
"./rgb/rgb-hsi": {
|
|
312
|
-
"
|
|
322
|
+
"default": "./rgb/rgb-hsi.js"
|
|
313
323
|
},
|
|
314
324
|
"./rgb/rgb-hsl": {
|
|
315
|
-
"
|
|
325
|
+
"default": "./rgb/rgb-hsl.js"
|
|
316
326
|
},
|
|
317
327
|
"./rgb/rgb-hsv": {
|
|
318
|
-
"
|
|
328
|
+
"default": "./rgb/rgb-hsv.js"
|
|
319
329
|
},
|
|
320
330
|
"./rgb/rgb-lab": {
|
|
321
|
-
"
|
|
331
|
+
"default": "./rgb/rgb-lab.js"
|
|
322
332
|
},
|
|
323
333
|
"./rgb/rgb-oklab": {
|
|
324
|
-
"
|
|
334
|
+
"default": "./rgb/rgb-oklab.js"
|
|
325
335
|
},
|
|
326
336
|
"./rgb/rgb-srgb": {
|
|
327
|
-
"
|
|
337
|
+
"default": "./rgb/rgb-srgb.js"
|
|
328
338
|
},
|
|
329
339
|
"./rgb/rgb-xyz": {
|
|
330
|
-
"
|
|
340
|
+
"default": "./rgb/rgb-xyz.js"
|
|
331
341
|
},
|
|
332
342
|
"./rgb/rgb-ycc": {
|
|
333
|
-
"
|
|
343
|
+
"default": "./rgb/rgb-ycc.js"
|
|
334
344
|
},
|
|
335
345
|
"./rgb/rgb": {
|
|
336
|
-
"
|
|
346
|
+
"default": "./rgb/rgb.js"
|
|
347
|
+
},
|
|
348
|
+
"./rotate": {
|
|
349
|
+
"default": "./rotate.js"
|
|
337
350
|
},
|
|
338
351
|
"./sort": {
|
|
339
|
-
"
|
|
352
|
+
"default": "./sort.js"
|
|
340
353
|
},
|
|
341
354
|
"./srgb/srgb-css": {
|
|
342
|
-
"
|
|
355
|
+
"default": "./srgb/srgb-css.js"
|
|
343
356
|
},
|
|
344
357
|
"./srgb/srgb-int": {
|
|
345
|
-
"
|
|
358
|
+
"default": "./srgb/srgb-int.js"
|
|
346
359
|
},
|
|
347
360
|
"./srgb/srgb-rgb": {
|
|
348
|
-
"
|
|
361
|
+
"default": "./srgb/srgb-rgb.js"
|
|
349
362
|
},
|
|
350
363
|
"./srgb/srgb": {
|
|
351
|
-
"
|
|
364
|
+
"default": "./srgb/srgb.js"
|
|
365
|
+
},
|
|
366
|
+
"./strategies": {
|
|
367
|
+
"default": "./strategies.js"
|
|
352
368
|
},
|
|
353
369
|
"./swatches": {
|
|
354
|
-
"
|
|
370
|
+
"default": "./swatches.js"
|
|
371
|
+
},
|
|
372
|
+
"./tint": {
|
|
373
|
+
"default": "./tint.js"
|
|
355
374
|
},
|
|
356
375
|
"./transform": {
|
|
357
|
-
"
|
|
376
|
+
"default": "./transform.js"
|
|
377
|
+
},
|
|
378
|
+
"./variations": {
|
|
379
|
+
"default": "./variations.js"
|
|
358
380
|
},
|
|
359
381
|
"./xyy/xyy-xyz": {
|
|
360
|
-
"
|
|
382
|
+
"default": "./xyy/xyy-xyz.js"
|
|
361
383
|
},
|
|
362
384
|
"./xyy/xyy": {
|
|
363
|
-
"
|
|
385
|
+
"default": "./xyy/xyy.js"
|
|
364
386
|
},
|
|
365
387
|
"./xyz/wavelength-xyz": {
|
|
366
|
-
"
|
|
388
|
+
"default": "./xyz/wavelength-xyz.js"
|
|
367
389
|
},
|
|
368
390
|
"./xyz/xyz-lab": {
|
|
369
|
-
"
|
|
391
|
+
"default": "./xyz/xyz-lab.js"
|
|
370
392
|
},
|
|
371
393
|
"./xyz/xyz-oklab": {
|
|
372
|
-
"
|
|
394
|
+
"default": "./xyz/xyz-oklab.js"
|
|
373
395
|
},
|
|
374
396
|
"./xyz/xyz-rgb": {
|
|
375
|
-
"
|
|
397
|
+
"default": "./xyz/xyz-rgb.js"
|
|
376
398
|
},
|
|
377
399
|
"./xyz/xyz-xyy": {
|
|
378
|
-
"
|
|
400
|
+
"default": "./xyz/xyz-xyy.js"
|
|
379
401
|
},
|
|
380
402
|
"./xyz/xyz-xyz": {
|
|
381
|
-
"
|
|
403
|
+
"default": "./xyz/xyz-xyz.js"
|
|
382
404
|
},
|
|
383
405
|
"./xyz/xyz50": {
|
|
384
|
-
"
|
|
406
|
+
"default": "./xyz/xyz50.js"
|
|
385
407
|
},
|
|
386
408
|
"./xyz/xyz65": {
|
|
387
|
-
"
|
|
409
|
+
"default": "./xyz/xyz65.js"
|
|
388
410
|
},
|
|
389
411
|
"./ycc/ycc-rgb": {
|
|
390
|
-
"
|
|
412
|
+
"default": "./ycc/ycc-rgb.js"
|
|
391
413
|
},
|
|
392
414
|
"./ycc/ycc": {
|
|
393
|
-
"
|
|
415
|
+
"default": "./ycc/ycc.js"
|
|
394
416
|
}
|
|
395
417
|
},
|
|
396
418
|
"thi.ng": {
|
|
@@ -399,5 +421,5 @@
|
|
|
399
421
|
"vectors"
|
|
400
422
|
]
|
|
401
423
|
},
|
|
402
|
-
"gitHead": "
|
|
424
|
+
"gitHead": "542bf14bd0c7a56b4e6297718189eea772a824b7\n"
|
|
403
425
|
}
|
package/rgb/rgb-lab.d.ts
CHANGED
|
@@ -6,15 +6,15 @@ import type { ColorOp } from "../api.js";
|
|
|
6
6
|
* Important: We're using a normalized Lab space w/ all three coordinates
|
|
7
7
|
* divided by 100 (normalized to 100% luminance).
|
|
8
8
|
*
|
|
9
|
-
* @param out
|
|
10
|
-
* @param src
|
|
9
|
+
* @param out -
|
|
10
|
+
* @param src -
|
|
11
11
|
*/
|
|
12
12
|
export declare const rgbLab: ColorOp;
|
|
13
13
|
/**
|
|
14
14
|
* Same as {@link rgbLab}, but using {@link D65} white point.
|
|
15
15
|
*
|
|
16
|
-
* @param out
|
|
17
|
-
* @param src
|
|
16
|
+
* @param out -
|
|
17
|
+
* @param src -
|
|
18
18
|
*/
|
|
19
19
|
export declare const rgbLabD65: ColorOp;
|
|
20
20
|
//# sourceMappingURL=rgb-lab.d.ts.map
|
package/rgb/rgb-lab.js
CHANGED
|
@@ -7,14 +7,14 @@ import { xyzLab, xyzLabD65 } from "../xyz/xyz-lab.js";
|
|
|
7
7
|
* Important: We're using a normalized Lab space w/ all three coordinates
|
|
8
8
|
* divided by 100 (normalized to 100% luminance).
|
|
9
9
|
*
|
|
10
|
-
* @param out
|
|
11
|
-
* @param src
|
|
10
|
+
* @param out -
|
|
11
|
+
* @param src -
|
|
12
12
|
*/
|
|
13
13
|
export const rgbLab = (out, src) => xyzLab(null, rgbXyz(out, src));
|
|
14
14
|
/**
|
|
15
15
|
* Same as {@link rgbLab}, but using {@link D65} white point.
|
|
16
16
|
*
|
|
17
|
-
* @param out
|
|
18
|
-
* @param src
|
|
17
|
+
* @param out -
|
|
18
|
+
* @param src -
|
|
19
19
|
*/
|
|
20
20
|
export const rgbLabD65 = (out, src) => xyzLabD65(null, rgbXyzD65(out, src));
|
package/rgb/rgb-oklab.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import type { ColorOp } from "../api.js";
|
|
|
3
3
|
* @remarks
|
|
4
4
|
* Reference: https://bottosson.github.io/posts/oklab/
|
|
5
5
|
*
|
|
6
|
-
* @param out
|
|
7
|
-
* @param src
|
|
6
|
+
* @param out -
|
|
7
|
+
* @param src -
|
|
8
8
|
*/
|
|
9
9
|
export declare const rgbOklab: ColorOp;
|
|
10
10
|
//# sourceMappingURL=rgb-oklab.d.ts.map
|
package/rgb/rgb-oklab.js
CHANGED
|
@@ -9,7 +9,7 @@ const CONE_LMS = [
|
|
|
9
9
|
* @remarks
|
|
10
10
|
* Reference: https://bottosson.github.io/posts/oklab/
|
|
11
11
|
*
|
|
12
|
-
* @param out
|
|
13
|
-
* @param src
|
|
12
|
+
* @param out -
|
|
13
|
+
* @param src -
|
|
14
14
|
*/
|
|
15
15
|
export const rgbOklab = (out, src) => __mulV33(null, OKLAB_M2, powN3(null, __mulV33(out, CONE_LMS, src), 1 / 3));
|
package/rgb/rgb-xyz.d.ts
CHANGED
|
@@ -14,8 +14,8 @@ export declare const rgbXyz: (out: Color | null, src: ReadonlyColor, mat?: numbe
|
|
|
14
14
|
* Same as {@link rgbXyz}, but hard coded to use {@link D65} white point (via
|
|
15
15
|
* {@link RGB_XYZ_D65} matrix).
|
|
16
16
|
*
|
|
17
|
-
* @param out
|
|
18
|
-
* @param src
|
|
17
|
+
* @param out -
|
|
18
|
+
* @param src -
|
|
19
19
|
*/
|
|
20
20
|
export declare const rgbXyzD65: ColorOp;
|
|
21
21
|
//# sourceMappingURL=rgb-xyz.d.ts.map
|
package/rgb/rgb-xyz.js
CHANGED
|
@@ -16,7 +16,7 @@ export const rgbXyz = (out, src, mat = RGB_XYZ_D50) => __mulV33(null, mat, clamp
|
|
|
16
16
|
* Same as {@link rgbXyz}, but hard coded to use {@link D65} white point (via
|
|
17
17
|
* {@link RGB_XYZ_D65} matrix).
|
|
18
18
|
*
|
|
19
|
-
* @param out
|
|
20
|
-
* @param src
|
|
19
|
+
* @param out -
|
|
20
|
+
* @param src -
|
|
21
21
|
*/
|
|
22
22
|
export const rgbXyzD65 = (out, src) => rgbXyz(out, src, RGB_XYZ_D65);
|
package/rgb/rgb-ycc.d.ts
CHANGED
|
@@ -9,9 +9,9 @@ import type { Color, ReadonlyColor } from "../api.js";
|
|
|
9
9
|
* - https://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.709_conversion
|
|
10
10
|
* - https://en.wikipedia.org/wiki/Rec._709
|
|
11
11
|
*
|
|
12
|
-
* @param out
|
|
13
|
-
* @param src
|
|
14
|
-
* @param luma
|
|
12
|
+
* @param out -
|
|
13
|
+
* @param src -
|
|
14
|
+
* @param luma -
|
|
15
15
|
*/
|
|
16
16
|
export declare const rgbYcc: (out: Color | null, src: ReadonlyColor, luma?: number[]) => import("@thi.ng/vectors").Vec;
|
|
17
17
|
//# sourceMappingURL=rgb-ycc.d.ts.map
|
package/rgb/rgb-ycc.js
CHANGED
|
@@ -12,9 +12,9 @@ import { __ensureAlpha } from "../internal/ensure.js";
|
|
|
12
12
|
* - https://en.wikipedia.org/wiki/YCbCr#ITU-R_BT.709_conversion
|
|
13
13
|
* - https://en.wikipedia.org/wiki/Rec._709
|
|
14
14
|
*
|
|
15
|
-
* @param out
|
|
16
|
-
* @param src
|
|
17
|
-
* @param luma
|
|
15
|
+
* @param out -
|
|
16
|
+
* @param src -
|
|
17
|
+
* @param luma -
|
|
18
18
|
*/
|
|
19
19
|
export const rgbYcc = (out, src, luma = RGB_LUMINANCE_REC709) => {
|
|
20
20
|
const y = dot3(src, luma);
|
package/rotate.d.ts
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { Color, TypedColor } from "./api.js";
|
|
2
|
+
export declare const rotate: import("@thi.ng/defmulti").MultiFn3<import("@thi.ng/vectors").Vec | null, TypedColor<any>, number, import("@thi.ng/vectors").Vec>;
|
|
3
|
+
export declare const complementary: (out: Color | null, src: TypedColor<any>) => import("@thi.ng/vectors").Vec;
|
|
4
|
+
//# sourceMappingURL=rotate.d.ts.map
|
package/rotate.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { defmulti } from "@thi.ng/defmulti/defmulti";
|
|
2
|
+
import { fract } from "@thi.ng/math/prec";
|
|
3
|
+
import { setC4 } from "@thi.ng/vectors/setc";
|
|
4
|
+
import { __dispatch1 } from "./internal/dispatch.js";
|
|
5
|
+
import { __ensureAlpha } from "./internal/ensure.js";
|
|
6
|
+
export const rotate = defmulti(__dispatch1, { hsv: "hsl", hsi: "hsl", hcy: "hsl" }, {
|
|
7
|
+
hsl: (out, src, theta) => setC4(out || src, fract(src[0] + theta), src[1], src[2], __ensureAlpha(src[3])),
|
|
8
|
+
lch: (out, src, theta) => setC4(out || src, src[0], src[1], fract(src[2] + theta), __ensureAlpha(src[3])),
|
|
9
|
+
});
|
|
10
|
+
export const complementary = (out, src) => rotate(out, src, 0.5);
|
package/sort.d.ts
CHANGED
|
@@ -7,8 +7,8 @@ export declare const selectChannel: (id: number) => (col: ReadonlyColor) => numb
|
|
|
7
7
|
* function for {@link sort} to compute the distance metric of a color to the
|
|
8
8
|
* given `target`.
|
|
9
9
|
*
|
|
10
|
-
* @param target
|
|
11
|
-
* @param dist
|
|
10
|
+
* @param target -
|
|
11
|
+
* @param dist -
|
|
12
12
|
*/
|
|
13
13
|
export declare const proximity: (target: ReadonlyColor, dist?: ColorDistance) => (col: ReadonlyColor) => number;
|
|
14
14
|
/**
|
|
@@ -17,8 +17,8 @@ export declare const proximity: (target: ReadonlyColor, dist?: ColorDistance) =>
|
|
|
17
17
|
* function (default: {@link distEucledian3}) and will be in sRGB space. Hence
|
|
18
18
|
* given `target` color should be provided in the same space too.
|
|
19
19
|
*
|
|
20
|
-
* @param target
|
|
21
|
-
* @param dist
|
|
20
|
+
* @param target -
|
|
21
|
+
* @param dist -
|
|
22
22
|
*/
|
|
23
23
|
export declare const proximityABGR32: (target: ReadonlyColor, dist?: ColorDistance) => (col: ReadonlyColor) => number;
|
|
24
24
|
export declare const sort: (colors: ReadonlyColor[], key: Fn<ReadonlyColor, number>, isReverse?: boolean) => import("@thi.ng/vectors").ReadonlyVec[];
|
|
@@ -56,9 +56,9 @@ export declare const sort: (colors: ReadonlyColor[], key: Fn<ReadonlyColor, numb
|
|
|
56
56
|
* // ]
|
|
57
57
|
* ```
|
|
58
58
|
*
|
|
59
|
-
* @param colors
|
|
60
|
-
* @param key
|
|
61
|
-
* @param isReverse
|
|
59
|
+
* @param colors -
|
|
60
|
+
* @param key -
|
|
61
|
+
* @param isReverse -
|
|
62
62
|
*/
|
|
63
63
|
export declare const sortMapped: <T extends TypedColor<any>>(colors: T[], key: Fn<ReadonlyColor, number>, isReverse?: boolean) => T[];
|
|
64
64
|
//# sourceMappingURL=sort.d.ts.map
|
package/sort.js
CHANGED
|
@@ -12,8 +12,8 @@ export const selectChannel = (id) => (col) => col[id];
|
|
|
12
12
|
* function for {@link sort} to compute the distance metric of a color to the
|
|
13
13
|
* given `target`.
|
|
14
14
|
*
|
|
15
|
-
* @param target
|
|
16
|
-
* @param dist
|
|
15
|
+
* @param target -
|
|
16
|
+
* @param dist -
|
|
17
17
|
*/
|
|
18
18
|
export const proximity = (target, dist = distEucledian3) => (col) => dist(target, col);
|
|
19
19
|
/**
|
|
@@ -22,8 +22,8 @@ export const proximity = (target, dist = distEucledian3) => (col) => dist(target
|
|
|
22
22
|
* function (default: {@link distEucledian3}) and will be in sRGB space. Hence
|
|
23
23
|
* given `target` color should be provided in the same space too.
|
|
24
24
|
*
|
|
25
|
-
* @param target
|
|
26
|
-
* @param dist
|
|
25
|
+
* @param target -
|
|
26
|
+
* @param dist -
|
|
27
27
|
*/
|
|
28
28
|
export const proximityABGR32 = (target, dist = distEucledian3) => (col) => dist(target, intAbgr32Srgb([], col[0]));
|
|
29
29
|
export const sort = (colors, key, isReverse = false) => sortByCachedKey(colors, key, isReverse ? compareNumDesc : compareNumAsc);
|
|
@@ -61,9 +61,9 @@ export const sort = (colors, key, isReverse = false) => sortByCachedKey(colors,
|
|
|
61
61
|
* // ]
|
|
62
62
|
* ```
|
|
63
63
|
*
|
|
64
|
-
* @param colors
|
|
65
|
-
* @param key
|
|
66
|
-
* @param isReverse
|
|
64
|
+
* @param colors -
|
|
65
|
+
* @param key -
|
|
66
|
+
* @param isReverse -
|
|
67
67
|
*/
|
|
68
68
|
export const sortMapped = (colors, key, isReverse = false) => {
|
|
69
69
|
if (!colors.length)
|