@csstools/convert-colors 1.3.0 → 1.4.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/CHANGELOG.md +8 -0
- package/README.md +43 -34
- package/index.bundle.js +604 -213
- package/index.js +183 -17
- package/lib/hsl-hsv.js +9 -2
- package/lib/hwb-hsv.js +9 -2
- package/lib/lab-lch.js +31 -0
- package/lib/lab-xyz.js +12 -5
- package/lib/rgb-hsl.js +14 -7
- package/lib/rgb-hsv.js +25 -14
- package/lib/rgb-hwb.js +14 -7
- package/lib/rgb-xyz.js +10 -0
- package/lib/util.js +38 -36
- package/package.json +9 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changes to Convert Colors
|
|
2
2
|
|
|
3
|
+
### 1.4.0 (January 27, 2018)
|
|
4
|
+
|
|
5
|
+
- Add LCH conversions
|
|
6
|
+
- Allow fallbacks in RGB conversions (for gray conversions)
|
|
7
|
+
- Add Lab and LCH tests
|
|
8
|
+
- Simplify test array joining
|
|
9
|
+
- Rename references from "LAB" to "Lab"
|
|
10
|
+
|
|
3
11
|
### 1.3.0 (January 25, 2018)
|
|
4
12
|
|
|
5
13
|
- Export all converter combinations of `rgb`, `hsl`, `hwb`, `lab`, `hsv`,
|
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
[![Linux Build Status][cli-img]][cli-url]
|
|
5
5
|
[![Windows Build Status][win-img]][win-url]
|
|
6
6
|
|
|
7
|
-
[Convert Colors] converts colors between RGB, HSL, and
|
|
7
|
+
[Convert Colors] converts colors between RGB, HSL, HWB, Lab, LCH, HSV, and XYZ.
|
|
8
8
|
|
|
9
9
|
```js
|
|
10
10
|
import convert from '@csstools/convert-colors';
|
|
@@ -34,39 +34,48 @@ npm install @csstools/convert-colors --save-dev
|
|
|
34
34
|
Conversions work by taking arguments that represents a color in one color space
|
|
35
35
|
and returning an array of that same color in another color space.
|
|
36
36
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
37
|
+
- rgb2hsl(r, g, b)
|
|
38
|
+
- rgb2hwb(r, g, b)
|
|
39
|
+
- rgb2lab(r, g, b)
|
|
40
|
+
- rgb2lch(r, g, b)
|
|
41
|
+
- rgb2hsv(r, g, b)
|
|
42
|
+
- rgb2xyz(r, g, b)
|
|
43
|
+
- hsl2rgb(h, s, l)
|
|
44
|
+
- hsl2hwb(h, s, l)
|
|
45
|
+
- hsl2lab(h, s, l)
|
|
46
|
+
- hsl2lch(h, s, l)
|
|
47
|
+
- hsl2hsv(h, s, l)
|
|
48
|
+
- hsl2xyz(h, s, l)
|
|
49
|
+
- hwb2rgb(h, w, b)
|
|
50
|
+
- hwb2hsl(h, w, b)
|
|
51
|
+
- hwb2lab(h, w, b)
|
|
52
|
+
- hwb2lch(h, w, b)
|
|
53
|
+
- hwb2hsv(h, w, b)
|
|
54
|
+
- hwb2xyz(h, w, b)
|
|
55
|
+
- lab2rgb(l, a, b)
|
|
56
|
+
- lab2hsl(l, a, b)
|
|
57
|
+
- lab2hwb(l, a, b)
|
|
58
|
+
- lab2lch(l, a, b)
|
|
59
|
+
- lab2hsv(l, a, b)
|
|
60
|
+
- lab2xyz(l, a, b)
|
|
61
|
+
- lch2rgb(l, c, h)
|
|
62
|
+
- lch2hsl(l, c, h)
|
|
63
|
+
- lch2hwb(l, c, h)
|
|
64
|
+
- lch2lab(l, c, h)
|
|
65
|
+
- lch2hsv(l, c, h)
|
|
66
|
+
- lch2xyz(l, c, h)
|
|
67
|
+
- hsv2rgb(h, s, v)
|
|
68
|
+
- hsv2hsl(h, s, v)
|
|
69
|
+
- hsv2hwb(h, s, v)
|
|
70
|
+
- hsv2lab(h, s, v)
|
|
71
|
+
- hsv2lch(h, s, v)
|
|
72
|
+
- hsv2xyz(h, s, v)
|
|
73
|
+
- xyz2rgb(x, y, z)
|
|
74
|
+
- xyz2hsl(x, y, z)
|
|
75
|
+
- xyz2hwb(x, y, z)
|
|
76
|
+
- xyz2lab(x, y, z)
|
|
77
|
+
- xyz2lch(x, y, z)
|
|
78
|
+
- xyz2hsv(x, y, z)
|
|
70
79
|
|
|
71
80
|
[npm-url]: https://www.npmjs.com/package/@csstools/convert-colors
|
|
72
81
|
[npm-img]: https://img.shields.io/npm/v/@csstools/convert-colors.svg
|