@thi.ng/color 3.2.6 → 4.0.3

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.
Files changed (189) hide show
  1. package/CHANGELOG.md +162 -230
  2. package/README.md +31 -15
  3. package/{ops/alpha.d.ts → alpha.d.ts} +1 -1
  4. package/{ops/alpha.js → alpha.js} +1 -1
  5. package/{ops/analog.d.ts → analog.d.ts} +3 -3
  6. package/{ops/analog.js → analog.js} +10 -10
  7. package/api/constants.js +18 -73
  8. package/api/gradients.d.ts +1 -1
  9. package/api/ranges.d.ts +2 -2
  10. package/api.d.ts +7 -2
  11. package/{ops/clamp.d.ts → clamp.d.ts} +1 -1
  12. package/{ops/clamp.js → clamp.js} +6 -5
  13. package/{ops/closest-hue.d.ts → closest-hue.d.ts} +1 -1
  14. package/{ops/closest-hue.js → closest-hue.js} +1 -1
  15. package/{ops/color-range.d.ts → color-range.d.ts} +2 -2
  16. package/{ops/color-range.js → color-range.js} +25 -18
  17. package/color.d.ts +1 -1
  18. package/color.js +16 -16
  19. package/convert.d.ts +1 -1
  20. package/convert.js +4 -4
  21. package/{ops/cosine-gradients.d.ts → cosine-gradients.d.ts} +2 -2
  22. package/{ops/cosine-gradients.js → cosine-gradients.js} +13 -5
  23. package/css/css.d.ts +1 -1
  24. package/css/css.js +12 -11
  25. package/css/parse-css.d.ts +1 -1
  26. package/css/parse-css.js +12 -9
  27. package/defcolor.d.ts +1 -1
  28. package/defcolor.js +24 -11
  29. package/{ops/distance.d.ts → distance.d.ts} +2 -2
  30. package/{ops/distance.js → distance.js} +7 -5
  31. package/{ops/gradients.d.ts → gradients.d.ts} +2 -2
  32. package/{ops/gradients.js → gradients.js} +3 -3
  33. package/hcy/hcy-rgb.d.ts +1 -1
  34. package/hcy/hcy-rgb.js +6 -6
  35. package/hcy/hcy.d.ts +1 -1
  36. package/hcy/hcy.js +4 -2
  37. package/hsi/hsi-rgb.d.ts +1 -1
  38. package/hsi/hsi-rgb.js +2 -2
  39. package/hsi/hsi.d.ts +1 -1
  40. package/hsi/hsi.js +4 -2
  41. package/hsl/hsl-css.d.ts +1 -1
  42. package/hsl/hsl-css.js +5 -4
  43. package/hsl/hsl-hsv.d.ts +1 -1
  44. package/hsl/hsl-hsv.js +1 -1
  45. package/hsl/hsl-rgb.d.ts +1 -1
  46. package/hsl/hsl-rgb.js +5 -5
  47. package/hsl/hsl.d.ts +1 -1
  48. package/hsl/hsl.js +5 -3
  49. package/hsv/hsv-css.d.ts +1 -1
  50. package/hsv/hsv-css.js +2 -2
  51. package/hsv/hsv-hsl.d.ts +1 -1
  52. package/hsv/hsv-hsl.js +1 -1
  53. package/hsv/hsv-rgb.d.ts +1 -1
  54. package/hsv/hsv-rgb.js +3 -3
  55. package/hsv/hsv.d.ts +1 -1
  56. package/hsv/hsv.js +5 -3
  57. package/index.d.ts +87 -87
  58. package/index.js +87 -87
  59. package/int/int-css.js +2 -2
  60. package/int/int-int.js +1 -1
  61. package/int/int-rgb.d.ts +1 -1
  62. package/int/int-rgb.js +2 -2
  63. package/int/int-srgb.d.ts +1 -1
  64. package/int/int-srgb.js +2 -2
  65. package/int/int.d.ts +24 -11
  66. package/int/int.js +59 -19
  67. package/internal/ensure.d.ts +5 -0
  68. package/internal/{ensure-args.js → ensure.js} +4 -1
  69. package/internal/matrix-ops.d.ts +8 -5
  70. package/internal/matrix-ops.js +12 -8
  71. package/internal/scale.d.ts +3 -0
  72. package/internal/scale.js +2 -0
  73. package/{ops/invert.d.ts → invert.d.ts} +1 -1
  74. package/{ops/invert.js → invert.js} +3 -2
  75. package/is-black.d.ts +3 -0
  76. package/{ops/is-black.js → is-black.js} +5 -6
  77. package/is-gray.d.ts +3 -0
  78. package/{ops/is-gray.js → is-gray.js} +6 -7
  79. package/is-white.d.ts +3 -0
  80. package/{ops/is-white.js → is-white.js} +5 -6
  81. package/lab/lab-css.d.ts +1 -1
  82. package/lab/lab-css.js +4 -4
  83. package/lab/lab-lab.d.ts +1 -1
  84. package/lab/lab-lab.js +3 -3
  85. package/lab/lab-lch.d.ts +1 -1
  86. package/lab/lab-lch.js +6 -5
  87. package/lab/lab-rgb.d.ts +1 -1
  88. package/lab/lab-rgb.js +2 -2
  89. package/lab/lab-xyz.d.ts +1 -1
  90. package/lab/lab-xyz.js +4 -4
  91. package/lab/lab50.d.ts +1 -1
  92. package/lab/lab50.js +8 -6
  93. package/lab/lab65.d.ts +1 -1
  94. package/lab/lab65.js +8 -6
  95. package/lch/lch-css.d.ts +1 -1
  96. package/lch/lch-css.js +5 -4
  97. package/lch/lch.d.ts +1 -1
  98. package/lch/lch.js +8 -6
  99. package/{ops/linear.d.ts → linear.d.ts} +0 -0
  100. package/{ops/linear.js → linear.js} +0 -0
  101. package/{ops/luminance-rgb.d.ts → luminance-rgb.d.ts} +1 -1
  102. package/{ops/luminance-rgb.js → luminance-rgb.js} +2 -2
  103. package/{ops/luminance.d.ts → luminance.d.ts} +2 -3
  104. package/{ops/luminance.js → luminance.js} +5 -10
  105. package/{ops/mix.d.ts → mix.d.ts} +2 -2
  106. package/{ops/mix.js → mix.js} +7 -6
  107. package/oklab/oklab-rgb.d.ts +1 -1
  108. package/oklab/oklab-rgb.js +4 -11
  109. package/oklab/oklab-xyz.d.ts +1 -1
  110. package/oklab/oklab-xyz.js +9 -21
  111. package/oklab/oklab.d.ts +1 -1
  112. package/oklab/oklab.js +8 -6
  113. package/package.json +323 -52
  114. package/rgb/hue-rgb.d.ts +1 -1
  115. package/rgb/hue-rgb.js +3 -2
  116. package/rgb/kelvin-rgba.d.ts +1 -1
  117. package/rgb/kelvin-rgba.js +3 -3
  118. package/rgb/rgb-css.d.ts +1 -1
  119. package/rgb/rgb-css.js +2 -2
  120. package/rgb/rgb-hcv.d.ts +1 -1
  121. package/rgb/rgb-hcv.js +4 -3
  122. package/rgb/rgb-hcy.d.ts +1 -1
  123. package/rgb/rgb-hcy.js +4 -4
  124. package/rgb/rgb-hsi.d.ts +1 -1
  125. package/rgb/rgb-hsi.js +4 -3
  126. package/rgb/rgb-hsl.d.ts +1 -1
  127. package/rgb/rgb-hsl.js +2 -2
  128. package/rgb/rgb-hsv.d.ts +1 -1
  129. package/rgb/rgb-hsv.js +2 -2
  130. package/rgb/rgb-lab.d.ts +1 -1
  131. package/rgb/rgb-lab.js +2 -2
  132. package/rgb/rgb-oklab.d.ts +1 -1
  133. package/rgb/rgb-oklab.js +6 -13
  134. package/rgb/rgb-srgb.d.ts +1 -1
  135. package/rgb/rgb-srgb.js +5 -5
  136. package/rgb/rgb-xyz.d.ts +1 -1
  137. package/rgb/rgb-xyz.js +4 -4
  138. package/rgb/rgb-ycc.d.ts +1 -1
  139. package/rgb/rgb-ycc.js +5 -4
  140. package/rgb/rgb.d.ts +1 -1
  141. package/rgb/rgb.js +15 -14
  142. package/{ops/sort.d.ts → sort.d.ts} +16 -5
  143. package/{ops/sort.js → sort.js} +21 -7
  144. package/srgb/srgb-css.d.ts +1 -1
  145. package/srgb/srgb-css.js +8 -8
  146. package/srgb/srgb-int.d.ts +1 -1
  147. package/srgb/srgb-int.js +4 -4
  148. package/srgb/srgb-rgb.d.ts +1 -1
  149. package/srgb/srgb-rgb.js +5 -5
  150. package/srgb/srgb.d.ts +1 -1
  151. package/srgb/srgb.js +9 -7
  152. package/{ops/swatches.d.ts → swatches.d.ts} +1 -1
  153. package/{ops/swatches.js → swatches.js} +0 -0
  154. package/{ops/transform.d.ts → transform.d.ts} +1 -1
  155. package/{ops/transform.js → transform.js} +5 -5
  156. package/xyy/xyy-xyz.d.ts +1 -1
  157. package/xyy/xyy-xyz.js +4 -4
  158. package/xyy/xyy.d.ts +1 -1
  159. package/xyy/xyy.js +6 -3
  160. package/xyz/wavelength-xyz.d.ts +1 -1
  161. package/xyz/wavelength-xyz.js +2 -2
  162. package/xyz/xyz-lab.d.ts +1 -1
  163. package/xyz/xyz-lab.js +5 -4
  164. package/xyz/xyz-oklab.d.ts +1 -1
  165. package/xyz/xyz-oklab.js +4 -4
  166. package/xyz/xyz-rgb.d.ts +1 -1
  167. package/xyz/xyz-rgb.js +3 -3
  168. package/xyz/xyz-xyy.d.ts +1 -1
  169. package/xyz/xyz-xyy.js +4 -4
  170. package/xyz/xyz-xyz.d.ts +1 -1
  171. package/xyz/xyz-xyz.js +4 -4
  172. package/xyz/xyz50.d.ts +1 -1
  173. package/xyz/xyz50.js +10 -8
  174. package/xyz/xyz65.d.ts +1 -1
  175. package/xyz/xyz65.js +10 -8
  176. package/ycc/ycc-rgb.d.ts +1 -1
  177. package/ycc/ycc-rgb.js +4 -4
  178. package/ycc/ycc.d.ts +1 -1
  179. package/ycc/ycc.js +4 -2
  180. package/internal/ensure-alpha.d.ts +0 -2
  181. package/internal/ensure-alpha.js +0 -2
  182. package/internal/ensure-args.d.ts +0 -3
  183. package/lib/index.js +0 -2236
  184. package/lib/index.js.map +0 -1
  185. package/lib/index.umd.js +0 -1
  186. package/lib/index.umd.js.map +0 -1
  187. package/ops/is-black.d.ts +0 -3
  188. package/ops/is-gray.d.ts +0 -3
  189. package/ops/is-white.d.ts +0 -3
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@thi.ng/color",
3
- "version": "3.2.6",
3
+ "version": "4.0.3",
4
4
  "description": "Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets",
5
+ "type": "module",
5
6
  "module": "./index.js",
6
- "main": "./lib/index.js",
7
- "umd:main": "./lib/index.umd.js",
8
7
  "typings": "./index.d.ts",
8
+ "sideEffects": false,
9
9
  "repository": {
10
10
  "type": "git",
11
11
  "url": "https://github.com/thi-ng/umbrella.git"
@@ -24,57 +24,34 @@
24
24
  "author": "Karsten Schmidt <k+npm@thi.ng>",
25
25
  "license": "Apache-2.0",
26
26
  "scripts": {
27
- "build": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module",
28
- "build:release": "yarn clean && yarn build:es6 && node ../../scripts/bundle-module all",
29
- "build:es6": "tsc --declaration",
30
- "build:test": "rimraf build && tsc -p test/tsconfig.json",
31
- "build:check": "tsc --isolatedModules --noEmit",
32
- "test": "mocha test",
33
- "cover": "nyc mocha test && nyc report --reporter=lcov",
34
- "clean": "rimraf *.js *.d.ts *.map .nyc_output build coverage doc lib api css hcy hsi hsl hsv int internal lab lch oklab ops rgb srgb xyy xyz ycc",
35
- "doc:readme": "ts-node -P ../../tools/tsconfig.json ../../tools/src/readme.ts",
36
- "doc": "typedoc --excludePrivate --out doc --theme ../../tools/doc/typedoc-theme src/index.ts",
27
+ "build": "yarn clean && tsc --declaration",
28
+ "clean": "rimraf *.js *.d.ts *.map doc api css hcy hsi hsl hsv int internal lab lch oklab rgb srgb xyy xyz ycc",
29
+ "doc": "typedoc --excludePrivate --excludeInternal --out doc src/index.ts",
37
30
  "doc:ae": "mkdir -p .ae/doc .ae/temp && node_modules/.bin/api-extractor run --local --verbose",
38
- "pub": "yarn build:release && yarn publish --access public",
39
- "tool:swatches": "ts-node -P tools/tsconfig.json tools/index.ts"
31
+ "doc:readme": "yarn doc:stats && ../../scripts/node-esm ../../tools/src/readme.ts",
32
+ "doc:stats": "../../scripts/node-esm ../../tools/src/module-stats.ts",
33
+ "pub": "yarn build && yarn publish --access public",
34
+ "test": "testament test",
35
+ "tool:swatches": "../../scripts/node-esm tools/index.ts"
40
36
  },
41
37
  "dependencies": {
42
- "@thi.ng/api": "^7.1.9",
43
- "@thi.ng/arrays": "^1.0.2",
44
- "@thi.ng/binary": "^2.2.10",
45
- "@thi.ng/checks": "^2.9.10",
46
- "@thi.ng/compare": "^1.3.33",
47
- "@thi.ng/compose": "^1.4.35",
48
- "@thi.ng/defmulti": "^1.3.16",
49
- "@thi.ng/errors": "^1.3.4",
50
- "@thi.ng/math": "^4.0.5",
51
- "@thi.ng/random": "^2.4.7",
52
- "@thi.ng/strings": "^2.1.6",
53
- "@thi.ng/transducers": "^7.9.1",
54
- "@thi.ng/vectors": "^6.1.2"
38
+ "@thi.ng/api": "^8.0.3",
39
+ "@thi.ng/arrays": "^2.0.3",
40
+ "@thi.ng/binary": "^3.0.3",
41
+ "@thi.ng/checks": "^3.0.3",
42
+ "@thi.ng/compare": "^2.0.3",
43
+ "@thi.ng/compose": "^2.0.3",
44
+ "@thi.ng/defmulti": "^2.0.3",
45
+ "@thi.ng/errors": "^2.0.3",
46
+ "@thi.ng/math": "^5.0.3",
47
+ "@thi.ng/random": "^3.0.3",
48
+ "@thi.ng/strings": "^3.0.3",
49
+ "@thi.ng/transducers": "^8.0.3",
50
+ "@thi.ng/vectors": "^7.0.3"
51
+ },
52
+ "devDependencies": {
53
+ "@thi.ng/testament": "^0.1.3"
55
54
  },
56
- "files": [
57
- "*.js",
58
- "*.d.ts",
59
- "lib",
60
- "api",
61
- "css",
62
- "hcy",
63
- "hsi",
64
- "hsl",
65
- "hsv",
66
- "int",
67
- "internal",
68
- "lab",
69
- "lch",
70
- "oklab",
71
- "ops",
72
- "rgb",
73
- "srgb",
74
- "xyy",
75
- "xyz",
76
- "ycc"
77
- ],
78
55
  "keywords": [
79
56
  "color",
80
57
  "conversion",
@@ -116,12 +93,306 @@
116
93
  "process": false,
117
94
  "setTimeout": false
118
95
  },
119
- "sideEffects": false,
96
+ "engines": {
97
+ "node": ">=12.7"
98
+ },
99
+ "files": [
100
+ "*.js",
101
+ "*.d.ts",
102
+ "api",
103
+ "css",
104
+ "hcy",
105
+ "hsi",
106
+ "hsl",
107
+ "hsv",
108
+ "int",
109
+ "internal",
110
+ "lab",
111
+ "lch",
112
+ "oklab",
113
+ "rgb",
114
+ "srgb",
115
+ "xyy",
116
+ "xyz",
117
+ "ycc"
118
+ ],
119
+ "exports": {
120
+ ".": {
121
+ "import": "./index.js"
122
+ },
123
+ "./alpha": {
124
+ "import": "./alpha.js"
125
+ },
126
+ "./analog": {
127
+ "import": "./analog.js"
128
+ },
129
+ "./api/constants": {
130
+ "import": "./api/constants.js"
131
+ },
132
+ "./api/gradients": {
133
+ "import": "./api/gradients.js"
134
+ },
135
+ "./api/names": {
136
+ "import": "./api/names.js"
137
+ },
138
+ "./api/ranges": {
139
+ "import": "./api/ranges.js"
140
+ },
141
+ "./api/system": {
142
+ "import": "./api/system.js"
143
+ },
144
+ "./api": {
145
+ "import": "./api.js"
146
+ },
147
+ "./clamp": {
148
+ "import": "./clamp.js"
149
+ },
150
+ "./closest-hue": {
151
+ "import": "./closest-hue.js"
152
+ },
153
+ "./color-range": {
154
+ "import": "./color-range.js"
155
+ },
156
+ "./color": {
157
+ "import": "./color.js"
158
+ },
159
+ "./convert": {
160
+ "import": "./convert.js"
161
+ },
162
+ "./cosine-gradients": {
163
+ "import": "./cosine-gradients.js"
164
+ },
165
+ "./css/css": {
166
+ "import": "./css/css.js"
167
+ },
168
+ "./css/parse-css": {
169
+ "import": "./css/parse-css.js"
170
+ },
171
+ "./defcolor": {
172
+ "import": "./defcolor.js"
173
+ },
174
+ "./distance": {
175
+ "import": "./distance.js"
176
+ },
177
+ "./gradients": {
178
+ "import": "./gradients.js"
179
+ },
180
+ "./hcy/hcy-rgb": {
181
+ "import": "./hcy/hcy-rgb.js"
182
+ },
183
+ "./hcy/hcy": {
184
+ "import": "./hcy/hcy.js"
185
+ },
186
+ "./hsi/hsi-rgb": {
187
+ "import": "./hsi/hsi-rgb.js"
188
+ },
189
+ "./hsi/hsi": {
190
+ "import": "./hsi/hsi.js"
191
+ },
192
+ "./hsl/hsl-css": {
193
+ "import": "./hsl/hsl-css.js"
194
+ },
195
+ "./hsl/hsl-hsv": {
196
+ "import": "./hsl/hsl-hsv.js"
197
+ },
198
+ "./hsl/hsl-rgb": {
199
+ "import": "./hsl/hsl-rgb.js"
200
+ },
201
+ "./hsl/hsl": {
202
+ "import": "./hsl/hsl.js"
203
+ },
204
+ "./hsv/hsv-css": {
205
+ "import": "./hsv/hsv-css.js"
206
+ },
207
+ "./hsv/hsv-hsl": {
208
+ "import": "./hsv/hsv-hsl.js"
209
+ },
210
+ "./hsv/hsv-rgb": {
211
+ "import": "./hsv/hsv-rgb.js"
212
+ },
213
+ "./hsv/hsv": {
214
+ "import": "./hsv/hsv.js"
215
+ },
216
+ "./int/int-css": {
217
+ "import": "./int/int-css.js"
218
+ },
219
+ "./int/int-int": {
220
+ "import": "./int/int-int.js"
221
+ },
222
+ "./int/int-rgb": {
223
+ "import": "./int/int-rgb.js"
224
+ },
225
+ "./int/int-srgb": {
226
+ "import": "./int/int-srgb.js"
227
+ },
228
+ "./int/int": {
229
+ "import": "./int/int.js"
230
+ },
231
+ "./invert": {
232
+ "import": "./invert.js"
233
+ },
234
+ "./is-black": {
235
+ "import": "./is-black.js"
236
+ },
237
+ "./is-gray": {
238
+ "import": "./is-gray.js"
239
+ },
240
+ "./is-white": {
241
+ "import": "./is-white.js"
242
+ },
243
+ "./lab/lab-css": {
244
+ "import": "./lab/lab-css.js"
245
+ },
246
+ "./lab/lab-lab": {
247
+ "import": "./lab/lab-lab.js"
248
+ },
249
+ "./lab/lab-lch": {
250
+ "import": "./lab/lab-lch.js"
251
+ },
252
+ "./lab/lab-rgb": {
253
+ "import": "./lab/lab-rgb.js"
254
+ },
255
+ "./lab/lab-xyz": {
256
+ "import": "./lab/lab-xyz.js"
257
+ },
258
+ "./lab/lab50": {
259
+ "import": "./lab/lab50.js"
260
+ },
261
+ "./lab/lab65": {
262
+ "import": "./lab/lab65.js"
263
+ },
264
+ "./lch/lch-css": {
265
+ "import": "./lch/lch-css.js"
266
+ },
267
+ "./lch/lch": {
268
+ "import": "./lch/lch.js"
269
+ },
270
+ "./linear": {
271
+ "import": "./linear.js"
272
+ },
273
+ "./luminance-rgb": {
274
+ "import": "./luminance-rgb.js"
275
+ },
276
+ "./luminance": {
277
+ "import": "./luminance.js"
278
+ },
279
+ "./mix": {
280
+ "import": "./mix.js"
281
+ },
282
+ "./oklab/oklab-rgb": {
283
+ "import": "./oklab/oklab-rgb.js"
284
+ },
285
+ "./oklab/oklab-xyz": {
286
+ "import": "./oklab/oklab-xyz.js"
287
+ },
288
+ "./oklab/oklab": {
289
+ "import": "./oklab/oklab.js"
290
+ },
291
+ "./rgb/hue-rgb": {
292
+ "import": "./rgb/hue-rgb.js"
293
+ },
294
+ "./rgb/kelvin-rgba": {
295
+ "import": "./rgb/kelvin-rgba.js"
296
+ },
297
+ "./rgb/rgb-css": {
298
+ "import": "./rgb/rgb-css.js"
299
+ },
300
+ "./rgb/rgb-hcv": {
301
+ "import": "./rgb/rgb-hcv.js"
302
+ },
303
+ "./rgb/rgb-hcy": {
304
+ "import": "./rgb/rgb-hcy.js"
305
+ },
306
+ "./rgb/rgb-hsi": {
307
+ "import": "./rgb/rgb-hsi.js"
308
+ },
309
+ "./rgb/rgb-hsl": {
310
+ "import": "./rgb/rgb-hsl.js"
311
+ },
312
+ "./rgb/rgb-hsv": {
313
+ "import": "./rgb/rgb-hsv.js"
314
+ },
315
+ "./rgb/rgb-lab": {
316
+ "import": "./rgb/rgb-lab.js"
317
+ },
318
+ "./rgb/rgb-oklab": {
319
+ "import": "./rgb/rgb-oklab.js"
320
+ },
321
+ "./rgb/rgb-srgb": {
322
+ "import": "./rgb/rgb-srgb.js"
323
+ },
324
+ "./rgb/rgb-xyz": {
325
+ "import": "./rgb/rgb-xyz.js"
326
+ },
327
+ "./rgb/rgb-ycc": {
328
+ "import": "./rgb/rgb-ycc.js"
329
+ },
330
+ "./rgb/rgb": {
331
+ "import": "./rgb/rgb.js"
332
+ },
333
+ "./sort": {
334
+ "import": "./sort.js"
335
+ },
336
+ "./srgb/srgb-css": {
337
+ "import": "./srgb/srgb-css.js"
338
+ },
339
+ "./srgb/srgb-int": {
340
+ "import": "./srgb/srgb-int.js"
341
+ },
342
+ "./srgb/srgb-rgb": {
343
+ "import": "./srgb/srgb-rgb.js"
344
+ },
345
+ "./srgb/srgb": {
346
+ "import": "./srgb/srgb.js"
347
+ },
348
+ "./swatches": {
349
+ "import": "./swatches.js"
350
+ },
351
+ "./transform": {
352
+ "import": "./transform.js"
353
+ },
354
+ "./xyy/xyy-xyz": {
355
+ "import": "./xyy/xyy-xyz.js"
356
+ },
357
+ "./xyy/xyy": {
358
+ "import": "./xyy/xyy.js"
359
+ },
360
+ "./xyz/wavelength-xyz": {
361
+ "import": "./xyz/wavelength-xyz.js"
362
+ },
363
+ "./xyz/xyz-lab": {
364
+ "import": "./xyz/xyz-lab.js"
365
+ },
366
+ "./xyz/xyz-oklab": {
367
+ "import": "./xyz/xyz-oklab.js"
368
+ },
369
+ "./xyz/xyz-rgb": {
370
+ "import": "./xyz/xyz-rgb.js"
371
+ },
372
+ "./xyz/xyz-xyy": {
373
+ "import": "./xyz/xyz-xyy.js"
374
+ },
375
+ "./xyz/xyz-xyz": {
376
+ "import": "./xyz/xyz-xyz.js"
377
+ },
378
+ "./xyz/xyz50": {
379
+ "import": "./xyz/xyz50.js"
380
+ },
381
+ "./xyz/xyz65": {
382
+ "import": "./xyz/xyz65.js"
383
+ },
384
+ "./ycc/ycc-rgb": {
385
+ "import": "./ycc/ycc-rgb.js"
386
+ },
387
+ "./ycc/ycc": {
388
+ "import": "./ycc/ycc.js"
389
+ }
390
+ },
120
391
  "thi.ng": {
121
392
  "related": [
122
393
  "pixel",
123
394
  "vectors"
124
395
  ]
125
396
  },
126
- "gitHead": "84a067278ef79ccd538eeb652046eb8e03f3e34e"
397
+ "gitHead": "1fb38cac74d6c009d96855c28784a267a81badf1"
127
398
  }
package/rgb/hue-rgb.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Color, Hue } from "../api";
1
+ import type { Color, Hue } from "../api.js";
2
2
  /**
3
3
  * Converts a normalized hue to RGBA with given optional `alpha`
4
4
  * value (default: 1).
package/rgb/hue-rgb.js CHANGED
@@ -1,5 +1,6 @@
1
- import { clamp01, fract } from "@thi.ng/math";
2
- import { setC4 } from "@thi.ng/vectors";
1
+ import { clamp01 } from "@thi.ng/math/interval";
2
+ import { fract } from "@thi.ng/math/prec";
3
+ import { setC4 } from "@thi.ng/vectors/setc";
3
4
  /**
4
5
  * Converts a normalized hue to RGBA with given optional `alpha`
5
6
  * value (default: 1).
@@ -1,4 +1,4 @@
1
- import { SRGB } from "../srgb/srgb";
1
+ import { SRGB } from "../srgb/srgb.js";
2
2
  /**
3
3
  * Based on:
4
4
  * - {@link https://github.com/neilbartlett/color-temperature/blob/develop/index.js}
@@ -1,6 +1,6 @@
1
- import { clamp01 } from "@thi.ng/math";
2
- import { setC4 } from "@thi.ng/vectors";
3
- import { srgb } from "../srgb/srgb";
1
+ import { clamp01 } from "@thi.ng/math/interval";
2
+ import { setC4 } from "@thi.ng/vectors/setc";
3
+ import { srgb } from "../srgb/srgb.js";
4
4
  const G1 = -0.6088425710866344;
5
5
  const G2 = -0.001748900018414868;
6
6
  const G3 = 0.4097731842899564;
package/rgb/rgb-css.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { ReadonlyColor } from "../api";
1
+ import type { ReadonlyColor } from "../api.js";
2
2
  export declare const rgbCss: (src: ReadonlyColor) => string;
3
3
  //# sourceMappingURL=rgb-css.d.ts.map
package/rgb/rgb-css.js CHANGED
@@ -1,3 +1,3 @@
1
- import { rgbSrgb } from "./rgb-srgb";
2
- import { srgbCss } from "../srgb/srgb-css";
1
+ import { rgbSrgb } from "./rgb-srgb.js";
2
+ import { srgbCss } from "../srgb/srgb-css.js";
3
3
  export const rgbCss = (src) => srgbCss(rgbSrgb([], src));
package/rgb/rgb-hcv.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ColorOp } from "../api";
1
+ import type { ColorOp } from "../api.js";
2
2
  /**
3
3
  * Based on:
4
4
  * {@link https://github.com/tobspr/GLSL-Color-Spaces/blob/develop/ColorSpaces.inc.glsl#L159}
package/rgb/rgb-hcv.js CHANGED
@@ -1,6 +1,7 @@
1
- import { clamp01, EPS } from "@thi.ng/math";
2
- import { setC3 } from "@thi.ng/vectors";
3
- import { clamp } from "../ops/clamp";
1
+ import { EPS } from "@thi.ng/math/api";
2
+ import { clamp01 } from "@thi.ng/math/interval";
3
+ import { setC3 } from "@thi.ng/vectors/setc";
4
+ import { clamp } from "../clamp.js";
4
5
  /**
5
6
  * Based on:
6
7
  * {@link https://github.com/tobspr/GLSL-Color-Spaces/blob/develop/ColorSpaces.inc.glsl#L159}
package/rgb/rgb-hcy.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ColorOp } from "../api";
1
+ import type { ColorOp } from "../api.js";
2
2
  /**
3
3
  * Ported from:
4
4
  * {@link https://github.com/tobspr/GLSL-Color-Spaces/blob/develop/ColorSpaces.inc.glsl#L226}
package/rgb/rgb-hcy.js CHANGED
@@ -1,7 +1,7 @@
1
- import { EPS } from "@thi.ng/math";
2
- import { hueRgb } from "./hue-rgb";
3
- import { luminanceRgb } from "../ops/luminance-rgb";
4
- import { rgbHcv } from "./rgb-hcv";
1
+ import { EPS } from "@thi.ng/math/api";
2
+ import { luminanceRgb } from "../luminance-rgb.js";
3
+ import { hueRgb } from "./hue-rgb.js";
4
+ import { rgbHcv } from "./rgb-hcv.js";
5
5
  /**
6
6
  * Ported from:
7
7
  * {@link https://github.com/tobspr/GLSL-Color-Spaces/blob/develop/ColorSpaces.inc.glsl#L226}
package/rgb/rgb-hsi.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { ColorOp } from "../api";
1
+ import type { ColorOp } from "../api.js";
2
2
  export declare const rgbHsi: ColorOp;
3
3
  //# sourceMappingURL=rgb-hsi.d.ts.map
package/rgb/rgb-hsi.js CHANGED
@@ -1,6 +1,7 @@
1
- import { atan2Abs, SQRT3, TAU, THIRD } from "@thi.ng/math";
2
- import { setC3 } from "@thi.ng/vectors";
3
- import { clamp } from "../ops/clamp";
1
+ import { atan2Abs } from "@thi.ng/math/angle";
2
+ import { SQRT3, TAU, THIRD } from "@thi.ng/math/api";
3
+ import { setC3 } from "@thi.ng/vectors/setc";
4
+ import { clamp } from "../clamp.js";
4
5
  // https://en.wikipedia.org/wiki/HSL_and_HSV#Hue_and_chroma
5
6
  const SQRT32 = SQRT3 / 2;
6
7
  export const rgbHsi = (out, src) => {
package/rgb/rgb-hsl.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { ColorOp } from "../api";
1
+ import type { ColorOp } from "../api.js";
2
2
  export declare const rgbHsl: ColorOp;
3
3
  //# sourceMappingURL=rgb-hsl.d.ts.map
package/rgb/rgb-hsl.js CHANGED
@@ -1,5 +1,5 @@
1
- import { EPS } from "@thi.ng/math";
2
- import { rgbHcv } from "./rgb-hcv";
1
+ import { EPS } from "@thi.ng/math/api";
2
+ import { rgbHcv } from "./rgb-hcv.js";
3
3
  export const rgbHsl = (out, src) => {
4
4
  out = rgbHcv(out, src);
5
5
  out[2] -= out[1] * 0.5;
package/rgb/rgb-hsv.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import type { ColorOp } from "../api";
1
+ import type { ColorOp } from "../api.js";
2
2
  export declare const rgbHsv: ColorOp;
3
3
  //# sourceMappingURL=rgb-hsv.d.ts.map
package/rgb/rgb-hsv.js CHANGED
@@ -1,5 +1,5 @@
1
- import { EPS } from "@thi.ng/math";
2
- import { rgbHcv } from "./rgb-hcv";
1
+ import { EPS } from "@thi.ng/math/api";
2
+ import { rgbHcv } from "./rgb-hcv.js";
3
3
  export const rgbHsv = (out, src) => {
4
4
  out = rgbHcv(out, src);
5
5
  out[1] /= out[2] + EPS;
package/rgb/rgb-lab.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ColorOp } from "../api";
1
+ import type { ColorOp } from "../api.js";
2
2
  /**
3
3
  * Converts linear RGB to Lab (via XYZ) using {@link D50} white point.
4
4
  *
package/rgb/rgb-lab.js CHANGED
@@ -1,5 +1,5 @@
1
- import { rgbXyz, rgbXyzD65 } from "./rgb-xyz";
2
- import { xyzLab, xyzLabD65 } from "../xyz/xyz-lab";
1
+ import { rgbXyz, rgbXyzD65 } from "./rgb-xyz.js";
2
+ import { xyzLab, xyzLabD65 } from "../xyz/xyz-lab.js";
3
3
  /**
4
4
  * Converts linear RGB to Lab (via XYZ) using {@link D50} white point.
5
5
  *
@@ -1,4 +1,4 @@
1
- import type { ColorOp } from "../api";
1
+ import type { ColorOp } from "../api.js";
2
2
  /**
3
3
  * @remarks
4
4
  * Reference: https://bottosson.github.io/posts/oklab/
package/rgb/rgb-oklab.js CHANGED
@@ -1,16 +1,9 @@
1
- import { powN3 } from "@thi.ng/vectors";
2
- import { OKLAB_M2 } from "../api/constants";
3
- import { mulV33 } from "../internal/matrix-ops";
1
+ import { powN3 } from "@thi.ng/vectors/pown";
2
+ import { OKLAB_M2 } from "../api/constants.js";
3
+ import { __mulV33 } from "../internal/matrix-ops.js";
4
4
  const CONE_LMS = [
5
- 0.412165612,
6
- 0.211859107,
7
- 0.0883097947,
8
- 0.536275208,
9
- 0.6807189584,
10
- 0.2818474174,
11
- 0.0514575653,
12
- 0.107406579,
13
- 0.6302613616,
5
+ 0.412165612, 0.211859107, 0.0883097947, 0.536275208, 0.6807189584,
6
+ 0.2818474174, 0.0514575653, 0.107406579, 0.6302613616,
14
7
  ];
15
8
  /**
16
9
  * @remarks
@@ -19,4 +12,4 @@ const CONE_LMS = [
19
12
  * @param out
20
13
  * @param src
21
14
  */
22
- export const rgbOklab = (out, src) => mulV33(null, OKLAB_M2, powN3(null, mulV33(out, CONE_LMS, src), 1 / 3));
15
+ export const rgbOklab = (out, src) => __mulV33(null, OKLAB_M2, powN3(null, __mulV33(out, CONE_LMS, src), 1 / 3));
package/rgb/rgb-srgb.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { ColorOp } from "../api";
1
+ import type { ColorOp } from "../api.js";
2
2
  /**
3
3
  * Converts linear RGB to sRGB.
4
4
  *
package/rgb/rgb-srgb.js CHANGED
@@ -1,12 +1,12 @@
1
- import { setC4 } from "@thi.ng/vectors";
2
- import { ensureAlpha } from "../internal/ensure-alpha";
3
- import { linearSrgb } from "../ops/linear";
1
+ import { setC4 } from "@thi.ng/vectors/setc";
2
+ import { __ensureAlpha } from "../internal/ensure.js";
3
+ import { linearSrgb } from "../linear.js";
4
4
  /**
5
5
  * Converts linear RGB to sRGB.
6
6
  *
7
7
  * @param out - result
8
8
  * @param src - source color
9
9
  */
10
- export const rgbSrgb = (out, src) => setC4(out || src, linearSrgb(src[0]), linearSrgb(src[1]), linearSrgb(src[2]), ensureAlpha(src[3]));
10
+ export const rgbSrgb = (out, src) => setC4(out || src, linearSrgb(src[0]), linearSrgb(src[1]), linearSrgb(src[2]), __ensureAlpha(src[3]));
11
11
  const GAMMA = 1 / 2.2;
12
- export const rgbSrgbApprox = (out, src) => setC4(out || src, src[0] ** GAMMA, src[1] ** GAMMA, src[2] ** GAMMA, ensureAlpha(src[3]));
12
+ export const rgbSrgbApprox = (out, src) => setC4(out || src, src[0] ** GAMMA, src[1] ** GAMMA, src[2] ** GAMMA, __ensureAlpha(src[3]));
package/rgb/rgb-xyz.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Color, ColorOp, ReadonlyColor } from "../api";
1
+ import type { Color, ColorOp, ReadonlyColor } from "../api.js";
2
2
  /**
3
3
  * Converts RGB to XYZ using provided transformation matrix (default:
4
4
  * {@link RGB_XYZ_D50}).
package/rgb/rgb-xyz.js CHANGED
@@ -1,6 +1,6 @@
1
- import { clamp } from "../ops/clamp";
2
- import { RGB_XYZ_D50, RGB_XYZ_D65 } from "../api/constants";
3
- import { mulV33 } from "../internal/matrix-ops";
1
+ import { RGB_XYZ_D50, RGB_XYZ_D65 } from "../api/constants.js";
2
+ import { clamp } from "../clamp.js";
3
+ import { __mulV33 } from "../internal/matrix-ops.js";
4
4
  /**
5
5
  * Converts RGB to XYZ using provided transformation matrix (default:
6
6
  * {@link RGB_XYZ_D50}).
@@ -11,7 +11,7 @@ import { mulV33 } from "../internal/matrix-ops";
11
11
  * @param src - source color
12
12
  * @param mat - transform matrix
13
13
  */
14
- export const rgbXyz = (out, src, mat = RGB_XYZ_D50) => mulV33(null, mat, clamp(out, src));
14
+ export const rgbXyz = (out, src, mat = RGB_XYZ_D50) => __mulV33(null, mat, clamp(out, src));
15
15
  /**
16
16
  * Same as {@link rgbXyz}, but hard coded to use {@link D65} white point (via
17
17
  * {@link RGB_XYZ_D65} matrix).
package/rgb/rgb-ycc.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { Color, ReadonlyColor } from "../api";
1
+ import type { Color, ReadonlyColor } from "../api.js";
2
2
  /**
3
3
  * @remarks
4
4
  * https://en.wikipedia.org/wiki/YCbCr#YCbCr