colorizr 2.0.0-1 → 2.1.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/README.md +311 -101
- package/esm/brightness-difference.js +8 -7
- package/esm/brightness-difference.js.map +1 -1
- package/esm/chroma.d.ts +4 -0
- package/esm/chroma.js +14 -0
- package/esm/chroma.js.map +1 -0
- package/esm/color-difference.js +6 -5
- package/esm/color-difference.js.map +1 -1
- package/esm/{wcag.d.ts → compare.d.ts} +1 -1
- package/esm/compare.js +36 -0
- package/esm/compare.js.map +1 -0
- package/esm/contrast.js +9 -13
- package/esm/contrast.js.map +1 -1
- package/esm/darken.d.ts +4 -0
- package/esm/darken.js +8 -0
- package/esm/darken.js.map +1 -0
- package/esm/desaturate.d.ts +4 -0
- package/esm/desaturate.js +8 -0
- package/esm/desaturate.js.map +1 -0
- package/esm/fade.d.ts +5 -0
- package/esm/fade.js +23 -0
- package/esm/fade.js.map +1 -0
- package/esm/format-css.js +10 -11
- package/esm/format-css.js.map +1 -1
- package/esm/format-hex.js +7 -7
- package/esm/format-hex.js.map +1 -1
- package/esm/hex2hsl.js +2 -2
- package/esm/hex2hsl.js.map +1 -1
- package/esm/hex2rgb.js +3 -3
- package/esm/hex2rgb.js.map +1 -1
- package/esm/hsl2hex.js +2 -5
- package/esm/hsl2hex.js.map +1 -1
- package/esm/hsl2rgb.d.ts +1 -1
- package/esm/hsl2rgb.js +13 -13
- package/esm/hsl2rgb.js.map +1 -1
- package/esm/index.d.ts +35 -39
- package/esm/index.js +138 -190
- package/esm/index.js.map +1 -1
- package/esm/is-valid-color.d.ts +1 -0
- package/esm/is-valid-color.js +11 -0
- package/esm/is-valid-color.js.map +1 -0
- package/esm/is-valid-hex.js +2 -2
- package/esm/is-valid-hex.js.map +1 -1
- package/esm/lighten.d.ts +4 -0
- package/esm/lighten.js +8 -0
- package/esm/lighten.js.map +1 -0
- package/esm/luminance.js +9 -8
- package/esm/luminance.js.map +1 -1
- package/esm/modules/css-colors.d.ts +152 -0
- package/esm/modules/css-colors.js +153 -0
- package/esm/modules/css-colors.js.map +1 -0
- package/esm/{hue2rgb.d.ts → modules/hue2rgb.d.ts} +0 -0
- package/esm/{hue2rgb.js → modules/hue2rgb.js} +2 -2
- package/esm/modules/hue2rgb.js.map +1 -0
- package/esm/{parse-color.d.ts → modules/parse-color.d.ts} +1 -1
- package/esm/{parse-color.js → modules/parse-color.js} +14 -14
- package/esm/modules/parse-color.js.map +1 -0
- package/esm/modules/updater.d.ts +4 -0
- package/esm/modules/updater.js +19 -0
- package/esm/modules/updater.js.map +1 -0
- package/esm/{utils.d.ts → modules/utils.d.ts} +14 -5
- package/esm/{utils.js → modules/utils.js} +61 -61
- package/esm/modules/utils.js.map +1 -0
- package/esm/name.d.ts +1 -0
- package/esm/name.js +10 -0
- package/esm/name.js.map +1 -0
- package/esm/palette.js +16 -25
- package/esm/palette.js.map +1 -1
- package/esm/parse-css.d.ts +3 -3
- package/esm/parse-css.js +60 -43
- package/esm/parse-css.js.map +1 -1
- package/esm/random.js +1 -1
- package/esm/random.js.map +1 -1
- package/esm/rgb2hex.d.ts +1 -1
- package/esm/rgb2hex.js +11 -12
- package/esm/rgb2hex.js.map +1 -1
- package/esm/rgb2hsl.d.ts +1 -1
- package/esm/rgb2hsl.js +14 -14
- package/esm/rgb2hsl.js.map +1 -1
- package/esm/rotate.d.ts +3 -0
- package/esm/rotate.js +13 -8
- package/esm/rotate.js.map +1 -1
- package/esm/saturate.d.ts +4 -0
- package/esm/saturate.js +8 -0
- package/esm/saturate.js.map +1 -0
- package/esm/scheme.d.ts +5 -0
- package/esm/scheme.js +44 -0
- package/esm/scheme.js.map +1 -0
- package/esm/shift.d.ts +4 -1
- package/esm/shift.js +9 -18
- package/esm/shift.js.map +1 -1
- package/esm/text-color.js +6 -5
- package/esm/text-color.js.map +1 -1
- package/esm/types/index.d.ts +4 -1
- package/lib/brightness-difference.js +10 -9
- package/lib/brightness-difference.js.map +1 -1
- package/lib/chroma.d.ts +4 -0
- package/lib/chroma.js +17 -0
- package/lib/chroma.js.map +1 -0
- package/lib/color-difference.js +7 -6
- package/lib/color-difference.js.map +1 -1
- package/lib/{wcag.d.ts → compare.d.ts} +1 -1
- package/lib/compare.js +39 -0
- package/lib/compare.js.map +1 -0
- package/lib/contrast.js +10 -14
- package/lib/contrast.js.map +1 -1
- package/lib/darken.d.ts +4 -0
- package/lib/darken.js +11 -0
- package/lib/darken.js.map +1 -0
- package/lib/desaturate.d.ts +4 -0
- package/lib/desaturate.js +11 -0
- package/lib/desaturate.js.map +1 -0
- package/lib/fade.d.ts +5 -0
- package/lib/fade.js +26 -0
- package/lib/fade.js.map +1 -0
- package/lib/format-css.js +16 -17
- package/lib/format-css.js.map +1 -1
- package/lib/format-hex.js +8 -8
- package/lib/format-hex.js.map +1 -1
- package/lib/hex2hsl.js +5 -5
- package/lib/hex2hsl.js.map +1 -1
- package/lib/hex2rgb.js +4 -4
- package/lib/hex2rgb.js.map +1 -1
- package/lib/hsl2hex.js +5 -8
- package/lib/hsl2hex.js.map +1 -1
- package/lib/hsl2rgb.d.ts +1 -1
- package/lib/hsl2rgb.js +16 -16
- package/lib/hsl2rgb.js.map +1 -1
- package/lib/index.d.ts +35 -39
- package/lib/index.js +162 -203
- package/lib/index.js.map +1 -1
- package/lib/is-valid-color.d.ts +1 -0
- package/lib/is-valid-color.js +14 -0
- package/lib/is-valid-color.js.map +1 -0
- package/lib/is-valid-hex.js +3 -3
- package/lib/is-valid-hex.js.map +1 -1
- package/lib/lighten.d.ts +4 -0
- package/lib/lighten.js +11 -0
- package/lib/lighten.js.map +1 -0
- package/lib/luminance.js +11 -10
- package/lib/luminance.js.map +1 -1
- package/lib/modules/css-colors.d.ts +152 -0
- package/lib/modules/css-colors.js +156 -0
- package/lib/modules/css-colors.js.map +1 -0
- package/lib/{hue2rgb.d.ts → modules/hue2rgb.d.ts} +0 -0
- package/lib/modules/hue2rgb.js +28 -0
- package/lib/modules/hue2rgb.js.map +1 -0
- package/lib/{parse-color.d.ts → modules/parse-color.d.ts} +1 -1
- package/lib/modules/parse-color.js +59 -0
- package/lib/modules/parse-color.js.map +1 -0
- package/lib/modules/updater.d.ts +4 -0
- package/lib/modules/updater.js +22 -0
- package/lib/modules/updater.js.map +1 -0
- package/lib/{utils.d.ts → modules/utils.d.ts} +14 -5
- package/lib/{utils.js → modules/utils.js} +60 -60
- package/lib/modules/utils.js.map +1 -0
- package/lib/name.d.ts +1 -0
- package/lib/name.js +13 -0
- package/lib/name.js.map +1 -0
- package/lib/palette.js +19 -28
- package/lib/palette.js.map +1 -1
- package/lib/parse-css.d.ts +3 -3
- package/lib/parse-css.js +66 -49
- package/lib/parse-css.js.map +1 -1
- package/lib/random.js +3 -3
- package/lib/random.js.map +1 -1
- package/lib/rgb2hex.d.ts +1 -1
- package/lib/rgb2hex.js +12 -13
- package/lib/rgb2hex.js.map +1 -1
- package/lib/rgb2hsl.d.ts +1 -1
- package/lib/rgb2hsl.js +14 -14
- package/lib/rgb2hsl.js.map +1 -1
- package/lib/rotate.d.ts +3 -0
- package/lib/rotate.js +14 -9
- package/lib/rotate.js.map +1 -1
- package/lib/saturate.d.ts +4 -0
- package/lib/saturate.js +11 -0
- package/lib/saturate.js.map +1 -0
- package/lib/scheme.d.ts +5 -0
- package/lib/scheme.js +47 -0
- package/lib/scheme.js.map +1 -0
- package/lib/shift.d.ts +4 -1
- package/lib/shift.js +12 -20
- package/lib/shift.js.map +1 -1
- package/lib/text-color.js +7 -6
- package/lib/text-color.js.map +1 -1
- package/lib/types/index.d.ts +4 -1
- package/package.json +35 -44
- package/src/brightness-difference.ts +7 -5
- package/src/chroma.ts +17 -0
- package/src/color-difference.ts +6 -5
- package/src/{wcag.ts → compare.ts} +4 -5
- package/src/contrast.ts +11 -14
- package/src/darken.ts +8 -0
- package/src/desaturate.ts +8 -0
- package/src/fade.ts +30 -0
- package/src/format-css.ts +3 -3
- package/src/format-hex.ts +4 -4
- package/src/hex2hsl.ts +2 -3
- package/src/hex2rgb.ts +2 -3
- package/src/hsl2hex.ts +2 -7
- package/src/hsl2rgb.ts +5 -6
- package/src/index.ts +58 -73
- package/src/is-valid-color.ts +11 -0
- package/src/is-valid-hex.ts +2 -2
- package/src/lighten.ts +8 -0
- package/src/luminance.ts +8 -7
- package/src/modules/css-colors.ts +152 -0
- package/src/{hue2rgb.ts → modules/hue2rgb.ts} +1 -4
- package/src/{parse-color.ts → modules/parse-color.ts} +14 -14
- package/src/modules/updater.ts +22 -0
- package/src/{utils.ts → modules/utils.ts} +50 -46
- package/src/name.ts +13 -0
- package/src/palette.ts +13 -10
- package/src/parse-css.ts +70 -49
- package/src/rgb2hex.ts +6 -9
- package/src/rgb2hsl.ts +4 -5
- package/src/rotate.ts +12 -6
- package/src/saturate.ts +8 -0
- package/src/scheme.ts +50 -0
- package/src/shift.ts +9 -9
- package/src/text-color.ts +5 -4
- package/src/types/index.ts +15 -10
- package/esm/harmony.d.ts +0 -5
- package/esm/harmony.js +0 -54
- package/esm/harmony.js.map +0 -1
- package/esm/hue2rgb.js.map +0 -1
- package/esm/parse-color.js.map +0 -1
- package/esm/utils.js.map +0 -1
- package/esm/wcag.js +0 -36
- package/esm/wcag.js.map +0 -1
- package/lib/harmony.d.ts +0 -5
- package/lib/harmony.js +0 -57
- package/lib/harmony.js.map +0 -1
- package/lib/hue2rgb.js +0 -28
- package/lib/hue2rgb.js.map +0 -1
- package/lib/parse-color.js +0 -59
- package/lib/parse-color.js.map +0 -1
- package/lib/utils.js.map +0 -1
- package/lib/wcag.js +0 -39
- package/lib/wcag.js.map +0 -1
- package/src/harmony.ts +0 -58
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
# Colorizr
|
|
2
2
|
|
|
3
|
-
[](https://www.npmjs.com/package/colorizr) [](https://www.npmjs.com/package/colorizr) [](https://bundlephobia.com/result?p=colorizr) [](https://github.com/gilbarbara/colorizr/actions/workflows/main.yml) [](https://codeclimate.com/github/gilbarbara/colorizr/maintainability) [](https://codeclimate.com/github/gilbarbara/colorizr/test_coverage)
|
|
4
4
|
|
|
5
|
-
Color conversion, manipulation and
|
|
5
|
+
Color conversion, manipulation, comparison, and analysis.
|
|
6
6
|
|
|
7
7
|
## Highlights
|
|
8
8
|
|
|
9
9
|
- 🏖 **Easy to use**: Works with HSL and RGB, including CSS strings
|
|
10
|
-
- ♿️ **
|
|
11
|
-
- 🛠 **Small:** Less than
|
|
10
|
+
- ♿️ **Accessibility:** WCAG analysis and comparison.
|
|
11
|
+
- 🛠 **Small:** Less than 6k (gzipped) and zero dependencies.
|
|
12
12
|
- 🟦 **Modern:** Written in Typescript.
|
|
13
13
|
|
|
14
14
|
## Setup
|
|
@@ -19,173 +19,383 @@ Color conversion, manipulation and comparison.
|
|
|
19
19
|
npm install --save colorizr
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
## Usage
|
|
23
23
|
|
|
24
|
-
```
|
|
25
|
-
import
|
|
24
|
+
```typescript
|
|
25
|
+
import { luminance } from 'colorizr';
|
|
26
|
+
|
|
27
|
+
const lux = luminance('#ff0044'); // 0.2168
|
|
26
28
|
```
|
|
27
29
|
|
|
28
|
-
|
|
30
|
+
Or you can create an instance to access all methods:
|
|
29
31
|
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
+
```typescript
|
|
33
|
+
import Colorizr from 'Colorizr';
|
|
32
34
|
|
|
33
|
-
colorizr
|
|
34
|
-
colorizr.hsl // { h: 344, s: 100, l: 50 };
|
|
35
|
-
colorizr.rgb // { r: 255, g: 0, b: 68 };
|
|
35
|
+
const colorizr = new Colorizr('#ff0044');
|
|
36
36
|
```
|
|
37
37
|
|
|
38
|
-
##
|
|
38
|
+
## Methods
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
> String inputs accept css values: hex, rgb(a), hsl(a) and named colors.
|
|
41
41
|
|
|
42
|
-
**
|
|
43
|
-
|
|
42
|
+
**brightnessDifference(left: string, right: string): number**
|
|
43
|
+
_get the brightness difference between 2 colors_
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
```typescript
|
|
46
|
+
import { brightnessDifference } from 'colorizr';
|
|
47
47
|
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
brightnessDifference('#fff', 'rgb(255, 0, 68)'); // 171.003
|
|
49
|
+
```
|
|
50
50
|
|
|
51
|
-
**
|
|
52
|
-
|
|
51
|
+
**chroma(input: string): number**
|
|
52
|
+
_get the chroma of a color_
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
```typescript
|
|
55
|
+
import { chroma } from 'colorizr';
|
|
56
56
|
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
chroma('#ff0044'); // 1
|
|
58
|
+
chroma('#ffc0cb'); // 0.2471
|
|
59
|
+
```
|
|
59
60
|
|
|
60
|
-
**
|
|
61
|
-
|
|
61
|
+
**colorDifference(left: string, right: string): number**
|
|
62
|
+
_get the color difference between 2 colors_
|
|
62
63
|
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
```typescript
|
|
65
|
+
import { colorDifference } from 'colorizr';
|
|
65
66
|
|
|
66
|
-
|
|
67
|
-
|
|
67
|
+
colorDifference('hsl(0, 0%, 100%)', '#f04'); // 442
|
|
68
|
+
```
|
|
68
69
|
|
|
69
|
-
**
|
|
70
|
-
|
|
70
|
+
**compare(left: string, right: string): Analysis**
|
|
71
|
+
_get the WCAG analysis for two colors_
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
73
|
+
```typescript
|
|
74
|
+
import { compare } from 'colorizr';
|
|
74
75
|
|
|
75
|
-
|
|
76
|
-
*returns a hex value with the contrasted color*
|
|
76
|
+
compare('#ff0044', '#fff');
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
{
|
|
79
|
+
"brightnessDifference": 171.003,
|
|
80
|
+
"colorDifference": 442,
|
|
81
|
+
"compliant": 1,
|
|
82
|
+
"contrast": 3.94,
|
|
83
|
+
"largeAA": true,
|
|
84
|
+
"largeAAA": false,
|
|
85
|
+
"normalAA": false,
|
|
86
|
+
"normalAAA": false,
|
|
87
|
+
}
|
|
88
|
+
```
|
|
79
89
|
|
|
80
|
-
**
|
|
81
|
-
|
|
90
|
+
**contrast(left: string, right: string): number**
|
|
91
|
+
_get the WCAG contrast ratio between 2 colors_
|
|
82
92
|
|
|
83
|
-
|
|
84
|
-
|
|
93
|
+
```typescript
|
|
94
|
+
import { contrast } from 'colorizr';
|
|
85
95
|
|
|
86
|
-
|
|
87
|
-
|
|
96
|
+
contrast('hsl(0, 0%, 100%)', 'rgb(255, 0, 68)'); // 3.94
|
|
97
|
+
```
|
|
88
98
|
|
|
89
|
-
**
|
|
90
|
-
|
|
99
|
+
**darken(input: string, amount = 10): string**
|
|
100
|
+
_get a color with decreased lightness_
|
|
91
101
|
|
|
92
|
-
|
|
93
|
-
|
|
102
|
+
```typescript
|
|
103
|
+
import { darken } from 'colorizr';
|
|
94
104
|
|
|
95
|
-
|
|
96
|
-
|
|
105
|
+
darken('#ff0044', 10); // #cc0036
|
|
106
|
+
```
|
|
97
107
|
|
|
98
|
-
|
|
108
|
+
**desaturate(input: string, amount: number): string**
|
|
109
|
+
_get a color with decreased saturation_
|
|
99
110
|
|
|
100
|
-
|
|
101
|
-
|
|
111
|
+
```typescript
|
|
112
|
+
import { desaturate } from 'colorizr';
|
|
102
113
|
|
|
103
|
-
|
|
114
|
+
desaturate('#ff0044', 10); // #f20d4a
|
|
115
|
+
```
|
|
104
116
|
|
|
105
|
-
|
|
117
|
+
**fade(input: string, amount: number = 10, output?: ColorTypes = 'rgb'): string**
|
|
118
|
+
_get a transparent color_
|
|
106
119
|
|
|
107
120
|
```typescript
|
|
108
|
-
import {
|
|
121
|
+
import { fade } from 'colorizr';
|
|
122
|
+
|
|
123
|
+
fade('hsl(344, 100, 50)', 10); // rgba(255, 0, 68, 0.9)
|
|
124
|
+
fade('#ff0044', 50, 'hsl'); // hsla(344, 100%, 50%, 0.5)
|
|
109
125
|
```
|
|
110
126
|
|
|
111
|
-
**
|
|
112
|
-
|
|
127
|
+
**formatCSS(input: HSL | RGB, options?: FormatOptions): string**
|
|
128
|
+
_get the css string for a color model object_
|
|
113
129
|
|
|
114
|
-
|
|
115
|
-
|
|
130
|
+
```typescript
|
|
131
|
+
import { formatCSS } from 'colorizr';
|
|
116
132
|
|
|
117
|
-
|
|
118
|
-
|
|
133
|
+
formatCSS({ h: 344, s: 100, l: 50 }, { model: 'rgb' }); // 'rgb(255, 0, 68)'
|
|
134
|
+
formatCSS({ r: 255, g: 0, b: 68 }, { alpha: 0.5, model: 'hsl' }); // 'hsla(344, 100%, 50%, 0.5)'
|
|
135
|
+
```
|
|
119
136
|
|
|
120
|
-
**
|
|
121
|
-
|
|
137
|
+
**formatHex(input: string): string**
|
|
138
|
+
_format a short hex string of 3 (or 4) digits into 6 (or 8) digits._
|
|
122
139
|
|
|
123
|
-
|
|
124
|
-
|
|
140
|
+
```typescript
|
|
141
|
+
import { formatHex } from 'colorizr';
|
|
125
142
|
|
|
126
|
-
|
|
127
|
-
|
|
143
|
+
formatHex('#07e'); // '#0077ee'
|
|
144
|
+
formatHex('#f058'); // '#ff005588'
|
|
145
|
+
```
|
|
128
146
|
|
|
129
147
|
**hex2hsl(input: string): HSL**
|
|
130
|
-
|
|
148
|
+
_convert a hex string into an HSL object_
|
|
149
|
+
|
|
150
|
+
```typescript
|
|
151
|
+
import { hex2hsl } from 'colorizr';
|
|
152
|
+
|
|
153
|
+
hex2hsl('#ff0044'); // { h: 344, s: 100, l: 50 }
|
|
154
|
+
```
|
|
131
155
|
|
|
132
156
|
**hex2rgb(input: string): RGB**
|
|
133
|
-
|
|
157
|
+
_convert a hex string into an RGB object_
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
import { hex2rgb } from 'colorizr';
|
|
161
|
+
|
|
162
|
+
hex2rgb('#ff0044'); // { r: 255, g: 0, b: 68 }
|
|
163
|
+
```
|
|
134
164
|
|
|
135
165
|
**hsl2hex(input: HSL): string**
|
|
136
|
-
|
|
166
|
+
_convert an HSL object into a hex string_
|
|
167
|
+
|
|
168
|
+
```typescript
|
|
169
|
+
import { hsl2hex } from 'colorizr';
|
|
170
|
+
|
|
171
|
+
hsl2hex({ h: 344, s: 100, l: 50 }); // '#ff0044'
|
|
172
|
+
```
|
|
137
173
|
|
|
138
174
|
**hsl2rgb(input: HSL): RGB**
|
|
139
|
-
|
|
175
|
+
_convert an HSL object into an RGB object_
|
|
140
176
|
|
|
141
|
-
|
|
177
|
+
```typescript
|
|
178
|
+
import { hsl2rgb } from 'colorizr';
|
|
179
|
+
|
|
180
|
+
hsl2rgb({ h: 344, s: 100, l: 50 }); // { r: 255, g: 0, b: 68 }
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
**isValidColor(input: any): boolean**
|
|
184
|
+
_check if the input can be parsed correctly_
|
|
185
|
+
|
|
186
|
+
```typescript
|
|
187
|
+
import { isValidColor } from 'colorizr';
|
|
188
|
+
|
|
189
|
+
isValidColor('#f04'); // true
|
|
190
|
+
isValidColor('#ff0044'); // true
|
|
191
|
+
isValidColor('#ff004400'); // true
|
|
192
|
+
isValidColor('rgb(100, 255, 0)'); // true
|
|
193
|
+
isValidColor('hsla(344, 100%, 50%)'); // true
|
|
194
|
+
isValidColor('blue'); // true
|
|
195
|
+
isValidColor('aliceblue'); // true
|
|
196
|
+
isValidColor('#mmff00'); // false
|
|
197
|
+
isValidColor('blue-ish'); // false
|
|
198
|
+
```
|
|
142
199
|
|
|
143
200
|
**isValidHex(input: any): boolean**
|
|
144
|
-
|
|
201
|
+
_check if the input is a valid hex_
|
|
202
|
+
|
|
203
|
+
```typescript
|
|
204
|
+
import { isValidHex } from 'colorizr';
|
|
205
|
+
|
|
206
|
+
isValidHex('#f04'); // true
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
**lighten(input: string, amount: number): string**
|
|
210
|
+
_get a color with increased lightness_
|
|
211
|
+
|
|
212
|
+
```typescript
|
|
213
|
+
import { lighten } from 'colorizr';
|
|
214
|
+
|
|
215
|
+
lighten('#ff0044', 10); // #ff3369
|
|
216
|
+
```
|
|
145
217
|
|
|
146
218
|
**luminance(input: string): number**
|
|
147
|
-
|
|
219
|
+
_get the relative brightness according to the [WCAG definition](https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef). Normalized to `0` for black and `1` for white._
|
|
220
|
+
|
|
221
|
+
```typescript
|
|
222
|
+
import { luminance } from 'colorizr';
|
|
223
|
+
|
|
224
|
+
luminance('#ff0044'); // 0.2168
|
|
225
|
+
```
|
|
226
|
+
|
|
227
|
+
**name(input: string): string**
|
|
228
|
+
_get the named color. return the hex code if it can't be named_
|
|
229
|
+
|
|
230
|
+
```typescript
|
|
231
|
+
import { name } from 'colorizr';
|
|
232
|
+
|
|
233
|
+
name('#ffc0cb', 10); // pink
|
|
234
|
+
name('rgb(176, 224, 230)'); // 'powderblue'
|
|
235
|
+
name('hsl(344, 100, 50)'); // #ff0044
|
|
236
|
+
```
|
|
148
237
|
|
|
149
238
|
**palette(input: string, options?: PaletteOptions): string[]**
|
|
150
|
-
|
|
239
|
+
_get a palette for a color_
|
|
240
|
+
|
|
241
|
+
```typescript
|
|
242
|
+
import { palette } from 'colorizr';
|
|
151
243
|
|
|
152
|
-
|
|
153
|
-
|
|
244
|
+
palette('#ff0044');
|
|
245
|
+
// ['#ff0044', '#ff7700', '#88ff00', '#00ff77', '#0088ff', '#7700ff'];
|
|
246
|
+
|
|
247
|
+
palette('#ff0044', { type: 'monochromatic' });
|
|
248
|
+
// ['#ff99b4', '#ff5582', '#ff1150', '#cc0036', '#880024', '#440012']
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
**parseCSS(input: string, output: ColorTypes = 'hex'): string | HSL | RGB**
|
|
252
|
+
_parse a css string to hex, hsl, or RGB_
|
|
253
|
+
|
|
254
|
+
```typescript
|
|
255
|
+
import { parseCSS } from 'colorizr';
|
|
256
|
+
|
|
257
|
+
parseCSS('hsl(270 60% 70%)'); // '#b385e0'
|
|
258
|
+
parseCSS('#ff0044', 'hsl'); // { h: 344, l: 50, s: 100 }
|
|
259
|
+
```
|
|
154
260
|
|
|
155
261
|
**random(): string**
|
|
156
|
-
|
|
262
|
+
_get a random color_
|
|
263
|
+
|
|
264
|
+
```typescript
|
|
265
|
+
import { random } from 'colorizr';
|
|
266
|
+
|
|
267
|
+
random(); // '#b385e0'
|
|
268
|
+
```
|
|
157
269
|
|
|
158
270
|
**rgb2hex(input: RGB | RGBArray): string**
|
|
159
|
-
|
|
271
|
+
_convert an RGB object into a hex string_
|
|
272
|
+
|
|
273
|
+
```typescript
|
|
274
|
+
import { rgb2hex } from 'colorizr';
|
|
275
|
+
|
|
276
|
+
rgb2hex({ r: 255, g: 55, b: 75 }); // '#ff374b'
|
|
277
|
+
rgb2hex([255, 0, 68]); // '#ff0044'
|
|
278
|
+
```
|
|
160
279
|
|
|
161
280
|
**rgb2hsl(input: RGB | RGBArray): HSL**
|
|
162
|
-
|
|
281
|
+
_convert an RGB object into an HSL object_
|
|
163
282
|
|
|
164
|
-
|
|
283
|
+
```typescript
|
|
284
|
+
import { rgb2hsl } from 'colorizr';
|
|
285
|
+
|
|
286
|
+
rgb2hsl({ r: 255, g: 55, b: 75 }); // { h: 354, s: 100, l: 60.78 }
|
|
287
|
+
rgb2hsl([255, 0, 68]); // { h: 344, s: 100, l: 50 }
|
|
288
|
+
```
|
|
165
289
|
|
|
166
|
-
**
|
|
290
|
+
**rotate(input: string, degrees = 15): string** _get a color with changed hue_
|
|
167
291
|
|
|
168
|
-
|
|
169
|
-
|
|
292
|
+
```typescript
|
|
293
|
+
import { rotate } from 'colorizr';
|
|
294
|
+
|
|
295
|
+
rotate('#ff0044', 30); // #ff3b00
|
|
296
|
+
```
|
|
170
297
|
|
|
171
|
-
**
|
|
172
|
-
|
|
298
|
+
**saturate(input: string, amount: number): string**
|
|
299
|
+
_get a color with increased saturation_
|
|
173
300
|
|
|
174
301
|
```typescript
|
|
175
|
-
{
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
contrast: 10.67,
|
|
180
|
-
largeAA: true,
|
|
181
|
-
largeAAA: true,
|
|
182
|
-
normalAA: true,
|
|
183
|
-
normalAAA: true,
|
|
184
|
-
}
|
|
302
|
+
import { saturate } from 'colorizr';
|
|
303
|
+
|
|
304
|
+
saturate('#ff0044', 10); // #ff0044 (already at the maximum)
|
|
305
|
+
saturate('pink', 10); // #ffc0cb
|
|
185
306
|
```
|
|
186
307
|
|
|
308
|
+
**scheme(input: string, type: Scheme): string[]**
|
|
309
|
+
_get the scheme for a color_
|
|
310
|
+
|
|
311
|
+
```typescript
|
|
312
|
+
import { scheme } from 'colorizr';
|
|
313
|
+
|
|
314
|
+
const complementary = scheme('rgb(255, 0, 68)'); // ['#ff0044', '#00ffbb']
|
|
315
|
+
const triadic = scheme('#ff0044', 'triadic'); // ['#ff0044', '#44ff00', '#0044ff']
|
|
316
|
+
```
|
|
317
|
+
|
|
318
|
+
**textColor(input: string): string**
|
|
319
|
+
_get a contrasting color to use with the text_
|
|
320
|
+
|
|
321
|
+
```typescript
|
|
322
|
+
import { textColor } from 'colorizr';
|
|
323
|
+
|
|
324
|
+
textColor('#ff0044'); // #ffffff
|
|
325
|
+
textColor('#fff800'); // #000000
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Instance API
|
|
329
|
+
|
|
330
|
+
```typescript
|
|
331
|
+
import Colorizr from 'Colorizr';
|
|
332
|
+
|
|
333
|
+
const colorizr = new Colorizr('#ff0044');
|
|
334
|
+
|
|
335
|
+
colorizr.hex; // #ff0044
|
|
336
|
+
colorizr.hsl; // { h: 344, s: 100, l: 50 };
|
|
337
|
+
colorizr.rgb; // { r: 255, g: 0, b: 68 };
|
|
338
|
+
```
|
|
339
|
+
|
|
340
|
+
### Getters
|
|
341
|
+
|
|
342
|
+
**colorizr.hex**
|
|
343
|
+
_returns the hex_
|
|
344
|
+
|
|
345
|
+
**colorizr.hsl**
|
|
346
|
+
_returns the HSL object_
|
|
347
|
+
|
|
348
|
+
**colorizr.rgb**
|
|
349
|
+
_returns the RGB object_
|
|
350
|
+
|
|
351
|
+
**colorizr.hue**
|
|
352
|
+
_returns the color hue, between 0 and 360_
|
|
353
|
+
|
|
354
|
+
**colorizr.saturation**
|
|
355
|
+
_returns the color saturation, between 0 and 100_
|
|
356
|
+
|
|
357
|
+
**colorizr.lightness**
|
|
358
|
+
_returns the color lightness, between 0 and 100_
|
|
359
|
+
|
|
360
|
+
**colorizr.red**
|
|
361
|
+
_returns the color red level, between 0 and 255_
|
|
362
|
+
|
|
363
|
+
**colorizr.green**
|
|
364
|
+
_returns the color green level, between 0 and 255_
|
|
365
|
+
|
|
366
|
+
**colorizr.blue**
|
|
367
|
+
_returns the color blue level, between 0 and 255_
|
|
368
|
+
|
|
369
|
+
**colorizr.luminance**
|
|
370
|
+
|
|
371
|
+
**colorizr.chroma**
|
|
372
|
+
|
|
373
|
+
**colorizr.textColor**
|
|
374
|
+
|
|
375
|
+
### Manipulation
|
|
376
|
+
|
|
377
|
+
**colorizr.lighten(percentage = 10)**
|
|
378
|
+
|
|
379
|
+
**colorizr.darken(percentage = 10)**
|
|
380
|
+
|
|
381
|
+
**colorizr.saturate(percentage = 10)**
|
|
382
|
+
|
|
383
|
+
**colorizr.saturate(percentage = 10)**
|
|
384
|
+
|
|
385
|
+
**colorizr.rotate(degrees = 15)**
|
|
386
|
+
|
|
387
|
+
**colorizr.invert()**
|
|
388
|
+
|
|
389
|
+
**colorizr.fade(percentage = 10)**
|
|
390
|
+
|
|
391
|
+
### Comparison
|
|
392
|
+
|
|
393
|
+
**colorizr.compare(color: string)**
|
|
394
|
+
_returns an object with the analysis (check the compare output above)_
|
|
187
395
|
|
|
188
396
|
## References
|
|
397
|
+
|
|
189
398
|
[calculating-color-contrast](https://24ways.org/2010/calculating-color-contrast/)
|
|
190
|
-
[Colour Contrast Check](https://snook.ca/technical/colour_contrast/colour.html)
|
|
191
|
-
[Contrast Checker](https://webaim.org/resources/contrastchecker/)
|
|
399
|
+
[Colour Contrast Check](https://snook.ca/technical/colour_contrast/colour.html)
|
|
400
|
+
[Contrast Checker](https://webaim.org/resources/contrastchecker/)
|
|
401
|
+
[Converting Color Spaces in typescript](https://css-tricks.com/converting-color-spaces-in-typescript/)
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
import hex2rgb from './hex2rgb';
|
|
2
|
-
import { invariant,
|
|
2
|
+
import { invariant, isString, messages, round } from './modules/utils';
|
|
3
|
+
import parseCSS from './parse-css';
|
|
3
4
|
/**
|
|
4
5
|
* Get the brightness difference between 2 colors.
|
|
5
6
|
*/
|
|
6
7
|
export default function brightnessDifference(left, right) {
|
|
7
|
-
invariant(
|
|
8
|
-
invariant(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
invariant(isString(left), messages.left);
|
|
9
|
+
invariant(isString(right), messages.right);
|
|
10
|
+
const RGBLeft = hex2rgb(parseCSS(left));
|
|
11
|
+
const RGBRight = hex2rgb(parseCSS(right));
|
|
12
|
+
const rightY = (RGBRight.r * 299 + RGBRight.g * 587 + RGBRight.b * 114) / 1000;
|
|
13
|
+
const leftY = (RGBLeft.r * 299 + RGBLeft.g * 587 + RGBLeft.b * 114) / 1000;
|
|
13
14
|
return round(Math.abs(rightY - leftY), 4);
|
|
14
15
|
}
|
|
15
16
|
//# sourceMappingURL=brightness-difference.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"brightness-difference.js","sourceRoot":"","sources":["../src/brightness-difference.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"brightness-difference.js","sourceRoot":"","sources":["../src/brightness-difference.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,oBAAoB,CAAC,IAAY,EAAE,KAAa;IACtE,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE3C,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1C,MAAM,MAAM,GAAG,CAAC,QAAQ,CAAC,CAAC,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC,GAAG,GAAG,GAAG,QAAQ,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;IAC/E,MAAM,KAAK,GAAG,CAAC,OAAO,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,CAAC,GAAG,GAAG,CAAC,GAAG,IAAI,CAAC;IAE3E,OAAO,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,GAAG,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC;AAC5C,CAAC"}
|
package/esm/chroma.d.ts
ADDED
package/esm/chroma.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import hex2rgb from './hex2rgb';
|
|
2
|
+
import { invariant, isString, messages, round } from './modules/utils';
|
|
3
|
+
import parseCSS from './parse-css';
|
|
4
|
+
/**
|
|
5
|
+
* Get the chroma of a color.
|
|
6
|
+
*/
|
|
7
|
+
export default function chroma(input) {
|
|
8
|
+
invariant(isString(input), messages.inputString);
|
|
9
|
+
const { r, g, b } = hex2rgb(parseCSS(input));
|
|
10
|
+
const max = Math.max(r, g, b);
|
|
11
|
+
const min = Math.min(r, g, b);
|
|
12
|
+
return round((max - min) / 255, 4);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=chroma.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chroma.js","sourceRoot":"","sources":["../src/chroma.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,MAAM,CAAC,KAAa;IAC1C,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,WAAW,CAAC,CAAC;IAEjD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAE7C,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC9B,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAE9B,OAAO,KAAK,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AACrC,CAAC"}
|
package/esm/color-difference.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import hex2rgb from './hex2rgb';
|
|
2
|
-
import { invariant, isString } from './utils';
|
|
2
|
+
import { invariant, isString, messages } from './modules/utils';
|
|
3
|
+
import parseCSS from './parse-css';
|
|
3
4
|
/**
|
|
4
5
|
* Get the difference between 2 colors.
|
|
5
6
|
*/
|
|
6
7
|
export default function colorDifference(left, right) {
|
|
7
|
-
invariant(
|
|
8
|
-
invariant(
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
invariant(isString(left), messages.left);
|
|
9
|
+
invariant(isString(right), messages.right);
|
|
10
|
+
const RGBLeft = hex2rgb(parseCSS(left));
|
|
11
|
+
const RGBRight = hex2rgb(parseCSS(right));
|
|
11
12
|
return (Math.max(RGBLeft.r, RGBRight.r) -
|
|
12
13
|
Math.min(RGBLeft.r, RGBRight.r) +
|
|
13
14
|
(Math.max(RGBLeft.g, RGBRight.g) - Math.min(RGBLeft.g, RGBRight.g)) +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"color-difference.js","sourceRoot":"","sources":["../src/color-difference.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"color-difference.js","sourceRoot":"","sources":["../src/color-difference.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,QAAQ,MAAM,aAAa,CAAC;AAEnC;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,IAAY,EAAE,KAAa;IACjE,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE3C,MAAM,OAAO,GAAG,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC;IACxC,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC;IAE1C,OAAO,CACL,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC/B,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC;QAC/B,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC;QACnE,CAAC,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,CACpE,CAAC;AACJ,CAAC"}
|
package/esm/compare.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import getBrightnessDifference from './brightness-difference';
|
|
2
|
+
import getColorDifference from './color-difference';
|
|
3
|
+
import getContrast from './contrast';
|
|
4
|
+
import { invariant, isString, messages } from './modules/utils';
|
|
5
|
+
/**
|
|
6
|
+
* Check 2 colors for WCAG compliance.
|
|
7
|
+
*/
|
|
8
|
+
export default function compare(left, right) {
|
|
9
|
+
invariant(isString(left), messages.left);
|
|
10
|
+
invariant(isString(right), messages.right);
|
|
11
|
+
const colorThreshold = 500;
|
|
12
|
+
const brightnessThreshold = 125;
|
|
13
|
+
const colorDifference = getColorDifference(left, right);
|
|
14
|
+
const contrast = getContrast(left, right);
|
|
15
|
+
const brightnessDifference = getBrightnessDifference(left, right);
|
|
16
|
+
const isBright = brightnessDifference >= brightnessThreshold;
|
|
17
|
+
const hasEnoughDifference = colorDifference >= colorThreshold;
|
|
18
|
+
let compliant = 0;
|
|
19
|
+
if (isBright && hasEnoughDifference) {
|
|
20
|
+
compliant = 2;
|
|
21
|
+
}
|
|
22
|
+
else if (isBright || hasEnoughDifference) {
|
|
23
|
+
compliant = 1;
|
|
24
|
+
}
|
|
25
|
+
return {
|
|
26
|
+
brightnessDifference,
|
|
27
|
+
colorDifference,
|
|
28
|
+
compliant,
|
|
29
|
+
contrast,
|
|
30
|
+
largeAA: contrast >= 3,
|
|
31
|
+
largeAAA: contrast >= 4.5,
|
|
32
|
+
normalAA: contrast >= 4.5,
|
|
33
|
+
normalAAA: contrast >= 7,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=compare.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare.js","sourceRoot":"","sources":["../src/compare.ts"],"names":[],"mappings":"AAAA,OAAO,uBAAuB,MAAM,yBAAyB,CAAC;AAC9D,OAAO,kBAAkB,MAAM,oBAAoB,CAAC;AACpD,OAAO,WAAW,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAGhE;;GAEG;AACH,MAAM,CAAC,OAAO,UAAU,OAAO,CAAC,IAAY,EAAE,KAAa;IACzD,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,IAAI,CAAC,CAAC;IACzC,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE3C,MAAM,cAAc,GAAG,GAAG,CAAC;IAC3B,MAAM,mBAAmB,GAAG,GAAG,CAAC;IAEhC,MAAM,eAAe,GAAG,kBAAkB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IACxD,MAAM,QAAQ,GAAG,WAAW,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC1C,MAAM,oBAAoB,GAAG,uBAAuB,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAElE,MAAM,QAAQ,GAAG,oBAAoB,IAAI,mBAAmB,CAAC;IAC7D,MAAM,mBAAmB,GAAG,eAAe,IAAI,cAAc,CAAC;IAE9D,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,IAAI,QAAQ,IAAI,mBAAmB,EAAE;QACnC,SAAS,GAAG,CAAC,CAAC;KACf;SAAM,IAAI,QAAQ,IAAI,mBAAmB,EAAE;QAC1C,SAAS,GAAG,CAAC,CAAC;KACf;IAED,OAAO;QACL,oBAAoB;QACpB,eAAe;QACf,SAAS;QACT,QAAQ;QACR,OAAO,EAAE,QAAQ,IAAI,CAAC;QACtB,QAAQ,EAAE,QAAQ,IAAI,GAAG;QACzB,QAAQ,EAAE,QAAQ,IAAI,GAAG;QACzB,SAAS,EAAE,QAAQ,IAAI,CAAC;KACzB,CAAC;AACJ,CAAC"}
|