You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/color-spaces.md
+33-32Lines changed: 33 additions & 32 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,37 +37,38 @@ The [RGB color model](https://en.wikipedia.org/wiki/RGB_color_model) describes c
37
37
38
38
The [sRGB color space](https://en.wikipedia.org/wiki/SRGB), which most people refer to when talking about RGB colors.
39
39
40
-
Serialized as `color(srgb r g b/ alpha)`.
40
+
Serialized as `color(srgb r g b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
41
41
42
42
#### `lrgb`
43
43
44
44
The linear-light form of the sRGB color space.
45
45
46
-
Serialized as `color(--srgb-linear r g b/ alpha)`.
46
+
Serialized as `color(--srgb-linear r g b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
47
47
48
48
#### `a98`
49
49
50
50
The A98 RGB color space, compatible with the [Adobe RGB (1998) color space](https://en.wikipedia.org/wiki/Adobe_RGB_color_space).
51
51
52
-
Serialized as `color(a98-rgb r g b/ alpha)`.
52
+
Serialized as `color(a98-rgb r g b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
53
53
54
54
#### `p3`
55
55
56
56
The [Display P3 color space](https://en.wikipedia.org/wiki/DCI-P3#Display_P3).
57
57
58
-
Serialized as `color(display-p3 r g b / alpha)`.
58
+
Serialized as `color(display-p3 r g b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as ` / alpha`.
59
+
59
60
60
61
#### `prophoto`
61
62
62
63
The [ProPhoto RGB color space](https://en.wikipedia.org/wiki/ProPhoto_RGB_color_space).
63
64
64
-
Serialized as `color(prophoto-rgb r g b/ alpha)`.
65
+
Serialized as `color(prophoto-rgb r g b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
65
66
66
67
#### `rec2020`
67
68
68
69
The [Rec. 2020 color space](https://en.wikipedia.org/wiki/Rec._2020).
69
70
70
-
Serialized as `color(rec2020 r g b/ alpha)`.
71
+
Serialized as `color(rec2020 r g b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
71
72
72
73
### The HSL/HSV/HSI family
73
74
@@ -87,7 +88,7 @@ The HSL color space.
87
88
|`s`|`[0, 1]`| Saturation in HSL |
88
89
|`l`|`[0, 1]`| Lightness |
89
90
90
-
Serialized as `hsl(h s% l%/ alpha)`.
91
+
Serialized as `hsl(h s% l%)`. A missing hue is serialized as `0`, with the `none` keyword for any other missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
91
92
92
93
#### `hsv`
93
94
@@ -99,7 +100,7 @@ The HSV color space.
99
100
|`s`|`[0, 1]`| Saturation in HSV |
100
101
|`v`|`[0, 1]`| Value |
101
102
102
-
Serialized as `color(--hsv h s v/ alpha)`.
103
+
Serialized as `color(--hsv h s v)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
103
104
104
105
#### `hsi`
105
106
@@ -111,7 +112,7 @@ The HSI color space.
111
112
|`s`|`[0, 1]`| Saturation in HSI |
112
113
|`i`|`[0, 1]`| Intensity |
113
114
114
-
Serialized as `color(--hsi h s i/ alpha)`.
115
+
Serialized as `color(--hsi h s i)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
115
116
116
117
### HWB
117
118
@@ -123,7 +124,9 @@ Serialized as `color(--hsi h s i / alpha)`.
123
124
|`w`|`[0, 1]`| Whiteness |
124
125
|`b`|`[0, 1]`| Blackness |
125
126
126
-
Serialized as `hwb(h w% b% / alpha)`.
127
+
Serialized as `hwb(h w% b%)`.
128
+
129
+
Serialized as `hwb(h w% b%)`. A missing hue is serialized as `0`, with the `none` keyword for any other missing color channel. An explicit `alpha < 1` is included as ` / alpha`.
127
130
128
131
> Smith, Alvy Ray (1996) — ["HWB — A More Intuitive Hue-Based Color Model"](http://alvyray.com/Papers/CG/HWB_JGTv208.pdf), Journal of Graphics, GPU and Game tools.
129
132
@@ -141,7 +144,7 @@ The CIELAB color space using the [D50 standard illuminant](https://en.wikipedia.
Serialized as `lab(l% a b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
145
148
146
149
#### `lch`
147
150
@@ -153,7 +156,7 @@ The CIELCh color space using the D50 standard illuminant.
153
156
|`c`|`[0, 131.207]`≈ | Chroma |
154
157
|`h`|`[0, 360)`| Hue |
155
158
156
-
Serialized as `lch(l% c h/ alpha)`.
159
+
Serialized as `lch(l% c h)`. A missing hue is serialized as `0`, with the `none` keyword for any other missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
157
160
158
161
#### `lab65`
159
162
@@ -165,7 +168,7 @@ CIELAB relative to the D65 standard illuminant.
Serialized as `color(--luv l u v)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
201
204
202
205
#### `lchuv`
203
206
@@ -207,11 +210,11 @@ Serialized as `color(--luv l u v / alpha)`.
207
210
|`c`|`[0, 176.956]`≈ | Chroma |
208
211
|`h`|`[0, 360)`| Hue |
209
212
210
-
Serialized as `color(--lchuv l c h/ alpha)`.
213
+
Serialized as `color(--lchuv l c h)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
211
214
212
215
### DIN99 Lab / LCh
213
216
214
-
The [DIN99][din99o] color space "squishes" the CIELAB D65 color space to obtain an [effective color difference](#culoriDifferenceDin99o) metric that can be expressed as a simple Euclidean distance. The latest iteration of the the standard, DIN99o, is available in Cartesian (`dlab`) and plar (`dlch`) form.
217
+
The [DIN99](https://de.wikipedia.org/wiki/DIN99-Farbraum) color space "squishes" the CIELAB D65 color space to obtain an [effective color difference](#culoriDifferenceDin99o) metric that can be expressed as a simple Euclidean distance. The latest iteration of the the standard, DIN99o, is available in Cartesian (`dlab`) and plar (`dlch`) form.
215
218
216
219
> ["Industrial Color Physics"](https://www.springer.com/us/book/9781441911964), Georg A. Klein, Springer (2010)
217
220
@@ -225,7 +228,7 @@ The DIN99o color space in Cartesian form.
225
228
|`a`|`[-40.09, 45.501]`≈ |
226
229
|`b`|`[-40.469, 44.344]`≈ |
227
230
228
-
Serialized as `color(--din99o-lab l a b/ alpha)`.
231
+
Serialized as `color(--din99o-lab l a b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
229
232
230
233
#### `dlch`
231
234
@@ -237,7 +240,7 @@ The DIN99o color space in cylindrical form.
237
240
|`c`|`[0, 51.484]`≈ | Chroma |
238
241
|`h`|`[0, 360)`| Hue |
239
242
240
-
Serialized as `color(--din99o-lch l c h/ alpha)`.
243
+
Serialized as `color(--din99o-lch l c h)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
241
244
242
245
### Oklab, Oklch, Okhsl, Okhsv
243
246
@@ -255,7 +258,7 @@ The Oklab color space in Cartesian form.
255
258
|`a`|`[-0.233, 0.276]`≈ | Green–red component |
256
259
|`b`|`[-0.311, 0.198]`≈ | Blue–yellow component |
257
260
258
-
Serialized as `color(--oklab l a b/ alpha)`.
261
+
Serialized as `color(--oklab l a b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
259
262
260
263
#### `oklch`
261
264
@@ -267,7 +270,7 @@ The Oklab color space in cylindrical form.
267
270
|`c`|`[0, 0.322]`≈ | Chroma |
268
271
|`h`|`[0, 360)`| Hue |
269
272
270
-
Serialized as `color(--oklch l c h/ alpha)`.
273
+
Serialized as `color(--oklch l c h)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
271
274
272
275
### `okhsl`
273
276
@@ -277,7 +280,7 @@ Serialized as `color(--oklch l c h / alpha)`.
277
280
|`s`|`[0, 1]`| Saturation (Okhsl) |
278
281
|`l`|`[0, 1]`| Lightness |
279
282
280
-
Serialized as `color(--okhsl h s l/ alpha)`.
283
+
Serialized as `color(--okhsl h s l)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
281
284
282
285
### `okhsv`
283
286
@@ -287,7 +290,7 @@ Serialized as `color(--okhsl h s l / alpha)`.
287
290
|`s`|`[0, 1]`| Saturation (Okhsv) |
288
291
|`v`|`[0, 1]`| Value |
289
292
290
-
Serialized as `color(--okhsv h s v/ alpha)`.
293
+
Serialized as `color(--okhsv h s v)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
291
294
292
295
#### Further reading
293
296
@@ -311,7 +314,7 @@ The J<sub>z</sub>a<sub>z</sub>b<sub>z</sub> color space in Cartesian form.
311
314
|`a`|`[-0.109, 0.129]`≈ | Green–red component |
312
315
|`b`|`[-0.185, 0.134]`≈ | Blue–yellow component |
313
316
314
-
Serialized as `color(--jzazbz j a b/ alpha)`.
317
+
Serialized as `color(--jzazbz j a b)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
315
318
316
319
#### `jch`
317
320
@@ -323,19 +326,19 @@ The J<sub>z</sub>a<sub>z</sub>b<sub>z</sub> color space in cylindrical form.
323
326
|`c`|`[0, 0.190]`≈ | Chroma |
324
327
|`h`|`[0, 360)`| Hue |
325
328
326
-
Serialized as `color(--jzczhz j c h/ alpha)`.
329
+
Serialized as `color(--jzczhz j c h)`, with the `none` keyword for any missing color channel. An explicit `alpha < 1` is included as `/ alpha`.
327
330
328
331
### YIQ
329
332
330
-
[YIQ][yiq] is the color space used by the NTSC color TV system. It contains the following channels:
333
+
[YIQ](https://en.wikipedia.org/wiki/YIQ) is the color space used by the NTSC color TV system. It contains the following channels:
Copy file name to clipboardExpand all lines: docs/guides/migration.md
+53Lines changed: 53 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,59 @@
2
2
title: 'Migration guide'
3
3
---
4
4
5
+
## Migrating from version 1.x to 2.0
6
+
7
+
* all color components in all CSS color syntaxes now accept the `none` keyword. ([w3c/csswg-drafts#6107](https://github.com/w3c/csswg-drafts/issues/6107))
8
+
9
+
### XYZ D50 vs. D65
10
+
11
+
The CSS Color Module Level 4 specification has been updated so that the `xyz` predefined color profile refers to the D65-relative XYZ color space, rather than the D50-relative XYZ color space. ([w3c/csswg-drafts#6722](https://github.com/w3c/csswg-drafts/issues/6722)).
12
+
13
+
In Culori, this has resulted in the D50-relative XYZ color space being changed to use `mode: 'xyz50'` instead of `mode: 'xyz'`. The latter is no longer supported. In addition:
14
+
15
+
* colors in the `xyz50` mode will be serialized as `color(xyz-d50 x y z / alpha)` when using the [`formatCss()`](/api#formatCss) method, instead of `color(--xyz-d50 x y z)`, to reflect the addition of `xyz-d50` to the list of predefined CSS color profiles.
16
+
* colors in the `xyz65` mode will be serialized as `color(xyz-d65 x y z / alpha)` instead of `color(--xyz-d65 x y z / alpha)`, to reflect the addition of `xyz-d65` to the list of predefined CSS color profiles.
17
+
* CSS colors in the `color(xyz x y z / alpha)` format will be parsed as `mode: 'xyz65'` instead of `mode: 'xyz50'`.
18
+
19
+
As a result of this rename, the following exports have been renamed in [all applicable entry points](/guides/tree-shaking):
0 commit comments