@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.
- package/CHANGELOG.md +162 -230
- package/README.md +31 -15
- package/{ops/alpha.d.ts → alpha.d.ts} +1 -1
- package/{ops/alpha.js → alpha.js} +1 -1
- package/{ops/analog.d.ts → analog.d.ts} +3 -3
- package/{ops/analog.js → analog.js} +10 -10
- package/api/constants.js +18 -73
- package/api/gradients.d.ts +1 -1
- package/api/ranges.d.ts +2 -2
- package/api.d.ts +7 -2
- package/{ops/clamp.d.ts → clamp.d.ts} +1 -1
- package/{ops/clamp.js → clamp.js} +6 -5
- package/{ops/closest-hue.d.ts → closest-hue.d.ts} +1 -1
- package/{ops/closest-hue.js → closest-hue.js} +1 -1
- package/{ops/color-range.d.ts → color-range.d.ts} +2 -2
- package/{ops/color-range.js → color-range.js} +25 -18
- package/color.d.ts +1 -1
- package/color.js +16 -16
- package/convert.d.ts +1 -1
- package/convert.js +4 -4
- package/{ops/cosine-gradients.d.ts → cosine-gradients.d.ts} +2 -2
- package/{ops/cosine-gradients.js → cosine-gradients.js} +13 -5
- package/css/css.d.ts +1 -1
- package/css/css.js +12 -11
- package/css/parse-css.d.ts +1 -1
- package/css/parse-css.js +12 -9
- package/defcolor.d.ts +1 -1
- package/defcolor.js +24 -11
- package/{ops/distance.d.ts → distance.d.ts} +2 -2
- package/{ops/distance.js → distance.js} +7 -5
- package/{ops/gradients.d.ts → gradients.d.ts} +2 -2
- package/{ops/gradients.js → gradients.js} +3 -3
- package/hcy/hcy-rgb.d.ts +1 -1
- package/hcy/hcy-rgb.js +6 -6
- package/hcy/hcy.d.ts +1 -1
- package/hcy/hcy.js +4 -2
- package/hsi/hsi-rgb.d.ts +1 -1
- package/hsi/hsi-rgb.js +2 -2
- package/hsi/hsi.d.ts +1 -1
- package/hsi/hsi.js +4 -2
- package/hsl/hsl-css.d.ts +1 -1
- package/hsl/hsl-css.js +5 -4
- package/hsl/hsl-hsv.d.ts +1 -1
- package/hsl/hsl-hsv.js +1 -1
- package/hsl/hsl-rgb.d.ts +1 -1
- package/hsl/hsl-rgb.js +5 -5
- package/hsl/hsl.d.ts +1 -1
- package/hsl/hsl.js +5 -3
- package/hsv/hsv-css.d.ts +1 -1
- package/hsv/hsv-css.js +2 -2
- package/hsv/hsv-hsl.d.ts +1 -1
- package/hsv/hsv-hsl.js +1 -1
- package/hsv/hsv-rgb.d.ts +1 -1
- package/hsv/hsv-rgb.js +3 -3
- package/hsv/hsv.d.ts +1 -1
- package/hsv/hsv.js +5 -3
- package/index.d.ts +87 -87
- package/index.js +87 -87
- package/int/int-css.js +2 -2
- package/int/int-int.js +1 -1
- package/int/int-rgb.d.ts +1 -1
- package/int/int-rgb.js +2 -2
- package/int/int-srgb.d.ts +1 -1
- package/int/int-srgb.js +2 -2
- package/int/int.d.ts +24 -11
- package/int/int.js +59 -19
- package/internal/ensure.d.ts +5 -0
- package/internal/{ensure-args.js → ensure.js} +4 -1
- package/internal/matrix-ops.d.ts +8 -5
- package/internal/matrix-ops.js +12 -8
- package/internal/scale.d.ts +3 -0
- package/internal/scale.js +2 -0
- package/{ops/invert.d.ts → invert.d.ts} +1 -1
- package/{ops/invert.js → invert.js} +3 -2
- package/is-black.d.ts +3 -0
- package/{ops/is-black.js → is-black.js} +5 -6
- package/is-gray.d.ts +3 -0
- package/{ops/is-gray.js → is-gray.js} +6 -7
- package/is-white.d.ts +3 -0
- package/{ops/is-white.js → is-white.js} +5 -6
- package/lab/lab-css.d.ts +1 -1
- package/lab/lab-css.js +4 -4
- package/lab/lab-lab.d.ts +1 -1
- package/lab/lab-lab.js +3 -3
- package/lab/lab-lch.d.ts +1 -1
- package/lab/lab-lch.js +6 -5
- package/lab/lab-rgb.d.ts +1 -1
- package/lab/lab-rgb.js +2 -2
- package/lab/lab-xyz.d.ts +1 -1
- package/lab/lab-xyz.js +4 -4
- package/lab/lab50.d.ts +1 -1
- package/lab/lab50.js +8 -6
- package/lab/lab65.d.ts +1 -1
- package/lab/lab65.js +8 -6
- package/lch/lch-css.d.ts +1 -1
- package/lch/lch-css.js +5 -4
- package/lch/lch.d.ts +1 -1
- package/lch/lch.js +8 -6
- package/{ops/linear.d.ts → linear.d.ts} +0 -0
- package/{ops/linear.js → linear.js} +0 -0
- package/{ops/luminance-rgb.d.ts → luminance-rgb.d.ts} +1 -1
- package/{ops/luminance-rgb.js → luminance-rgb.js} +2 -2
- package/{ops/luminance.d.ts → luminance.d.ts} +2 -3
- package/{ops/luminance.js → luminance.js} +5 -10
- package/{ops/mix.d.ts → mix.d.ts} +2 -2
- package/{ops/mix.js → mix.js} +7 -6
- package/oklab/oklab-rgb.d.ts +1 -1
- package/oklab/oklab-rgb.js +4 -11
- package/oklab/oklab-xyz.d.ts +1 -1
- package/oklab/oklab-xyz.js +9 -21
- package/oklab/oklab.d.ts +1 -1
- package/oklab/oklab.js +8 -6
- package/package.json +323 -52
- package/rgb/hue-rgb.d.ts +1 -1
- package/rgb/hue-rgb.js +3 -2
- package/rgb/kelvin-rgba.d.ts +1 -1
- package/rgb/kelvin-rgba.js +3 -3
- package/rgb/rgb-css.d.ts +1 -1
- package/rgb/rgb-css.js +2 -2
- package/rgb/rgb-hcv.d.ts +1 -1
- package/rgb/rgb-hcv.js +4 -3
- package/rgb/rgb-hcy.d.ts +1 -1
- package/rgb/rgb-hcy.js +4 -4
- package/rgb/rgb-hsi.d.ts +1 -1
- package/rgb/rgb-hsi.js +4 -3
- package/rgb/rgb-hsl.d.ts +1 -1
- package/rgb/rgb-hsl.js +2 -2
- package/rgb/rgb-hsv.d.ts +1 -1
- package/rgb/rgb-hsv.js +2 -2
- package/rgb/rgb-lab.d.ts +1 -1
- package/rgb/rgb-lab.js +2 -2
- package/rgb/rgb-oklab.d.ts +1 -1
- package/rgb/rgb-oklab.js +6 -13
- package/rgb/rgb-srgb.d.ts +1 -1
- package/rgb/rgb-srgb.js +5 -5
- package/rgb/rgb-xyz.d.ts +1 -1
- package/rgb/rgb-xyz.js +4 -4
- package/rgb/rgb-ycc.d.ts +1 -1
- package/rgb/rgb-ycc.js +5 -4
- package/rgb/rgb.d.ts +1 -1
- package/rgb/rgb.js +15 -14
- package/{ops/sort.d.ts → sort.d.ts} +16 -5
- package/{ops/sort.js → sort.js} +21 -7
- package/srgb/srgb-css.d.ts +1 -1
- package/srgb/srgb-css.js +8 -8
- package/srgb/srgb-int.d.ts +1 -1
- package/srgb/srgb-int.js +4 -4
- package/srgb/srgb-rgb.d.ts +1 -1
- package/srgb/srgb-rgb.js +5 -5
- package/srgb/srgb.d.ts +1 -1
- package/srgb/srgb.js +9 -7
- package/{ops/swatches.d.ts → swatches.d.ts} +1 -1
- package/{ops/swatches.js → swatches.js} +0 -0
- package/{ops/transform.d.ts → transform.d.ts} +1 -1
- package/{ops/transform.js → transform.js} +5 -5
- package/xyy/xyy-xyz.d.ts +1 -1
- package/xyy/xyy-xyz.js +4 -4
- package/xyy/xyy.d.ts +1 -1
- package/xyy/xyy.js +6 -3
- package/xyz/wavelength-xyz.d.ts +1 -1
- package/xyz/wavelength-xyz.js +2 -2
- package/xyz/xyz-lab.d.ts +1 -1
- package/xyz/xyz-lab.js +5 -4
- package/xyz/xyz-oklab.d.ts +1 -1
- package/xyz/xyz-oklab.js +4 -4
- package/xyz/xyz-rgb.d.ts +1 -1
- package/xyz/xyz-rgb.js +3 -3
- package/xyz/xyz-xyy.d.ts +1 -1
- package/xyz/xyz-xyy.js +4 -4
- package/xyz/xyz-xyz.d.ts +1 -1
- package/xyz/xyz-xyz.js +4 -4
- package/xyz/xyz50.d.ts +1 -1
- package/xyz/xyz50.js +10 -8
- package/xyz/xyz65.d.ts +1 -1
- package/xyz/xyz65.js +10 -8
- package/ycc/ycc-rgb.d.ts +1 -1
- package/ycc/ycc-rgb.js +4 -4
- package/ycc/ycc.d.ts +1 -1
- package/ycc/ycc.js +4 -2
- package/internal/ensure-alpha.d.ts +0 -2
- package/internal/ensure-alpha.js +0 -2
- package/internal/ensure-args.d.ts +0 -3
- package/lib/index.js +0 -2236
- package/lib/index.js.map +0 -1
- package/lib/index.umd.js +0 -1
- package/lib/index.umd.js.map +0 -1
- package/ops/is-black.d.ts +0 -3
- package/ops/is-gray.d.ts +0 -3
- 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
|
+
"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 &&
|
|
28
|
-
"
|
|
29
|
-
"
|
|
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
|
-
"
|
|
39
|
-
"
|
|
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": "^
|
|
43
|
-
"@thi.ng/arrays": "^
|
|
44
|
-
"@thi.ng/binary": "^
|
|
45
|
-
"@thi.ng/checks": "^
|
|
46
|
-
"@thi.ng/compare": "^
|
|
47
|
-
"@thi.ng/compose": "^
|
|
48
|
-
"@thi.ng/defmulti": "^
|
|
49
|
-
"@thi.ng/errors": "^
|
|
50
|
-
"@thi.ng/math": "^
|
|
51
|
-
"@thi.ng/random": "^
|
|
52
|
-
"@thi.ng/strings": "^
|
|
53
|
-
"@thi.ng/transducers": "^
|
|
54
|
-
"@thi.ng/vectors": "^
|
|
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
|
-
"
|
|
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": "
|
|
397
|
+
"gitHead": "1fb38cac74d6c009d96855c28784a267a81badf1"
|
|
127
398
|
}
|
package/rgb/hue-rgb.d.ts
CHANGED
package/rgb/hue-rgb.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { clamp01
|
|
2
|
-
import {
|
|
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).
|
package/rgb/kelvin-rgba.d.ts
CHANGED
package/rgb/kelvin-rgba.js
CHANGED
|
@@ -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
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
package/rgb/rgb-hcv.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
package/rgb/rgb-hcy.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { EPS } from "@thi.ng/math";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
package/rgb/rgb-hsi.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { atan2Abs
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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
package/rgb/rgb-hsl.js
CHANGED
package/rgb/rgb-hsv.d.ts
CHANGED
package/rgb/rgb-hsv.js
CHANGED
package/rgb/rgb-lab.d.ts
CHANGED
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
|
*
|
package/rgb/rgb-oklab.d.ts
CHANGED
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 {
|
|
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.
|
|
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) =>
|
|
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
package/rgb/rgb-srgb.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { setC4 } from "@thi.ng/vectors";
|
|
2
|
-
import {
|
|
3
|
-
import { linearSrgb } from "../
|
|
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]),
|
|
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,
|
|
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
package/rgb/rgb-xyz.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
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) =>
|
|
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