@@ -74,6 +74,29 @@ Introduction {#intro}
74
74
However, other colorspaces can be specified,
75
75
including ``hsl()`` or ``srgb`` if desired.
76
76
77
+ Colorspaces {#colorspaces-section}
78
+ ==============
79
+
80
+ Mixing or otherwise combining colors
81
+ has different results depending on the colorspace used.
82
+ In some cases, the result of physically mixing two colored lights is desired
83
+ (in that case, the CIE XYZ colorspace is appropriate, because it is linear in light intensity).
84
+ In other cases, colors which are evenly spaced perceptually are desired
85
+ (in which case, the CIE Lab colorspace is designed to be perceptually uniform).
86
+ Alternatively, maximising chroma so that color mixtures follow along the hue wheel is wanted
87
+ (CIE LCH works well for this).
88
+ Lastly, compatibility with legacy Web content may be the most important consideration.
89
+ (the sRGB colorspace, which is neither linear-light nor perceptually uniform, is the choice here).
90
+
91
+
92
+ <pre class='prod'>
93
+ <dfn><colorspace></dfn> = srgb | hsl | hwb | xyz | lab | lch
94
+ </pre>
95
+
96
+ When no [=colorspace=] is specified,
97
+ the mixing is done in the ''lch'' colorspace.
98
+ The [=xyz=] colorspace is CIE XYZ, with a D50 whitepoint, and allows computation to be done
99
+ in a linear-light-intensity space.
77
100
78
101
79
102
Mixing colors: the ''color-mix()'' function {#color-mix}
@@ -95,9 +118,6 @@ Mixing colors: the ''color-mix()'' function {#color-mix}
95
118
<dfn><mix-component></dfn> = <<color>> [ <<percentage>> | <<color-adjuster>> + ]?
96
119
</pre>
97
120
98
- <pre class='prod'>
99
- <dfn><colorspace></dfn> = srgb | hsl | hwb | xyz | lab | lch
100
- </pre>
101
121
102
122
<pre class='prod'>
103
123
<dfn><color-adjuster></dfn> = [ [
@@ -113,11 +133,6 @@ Mixing colors: the ''color-mix()'' function {#color-mix}
113
133
<dfn><hue-adjuster></dfn> = hue [shorter | longer | increasing | decreasing | specified ]?
114
134
</pre>
115
135
116
- When no [=colorspace=] is specified,
117
- the mixing is done in the ''lch'' colorspace.
118
- The [=xyz=] colorspace is CIE XYZ, with a D50 whitepoint, and allows computation to be done
119
- in a linear-light-intensity space.
120
-
121
136
Arguments are normalized as follows:
122
137
123
138
1. When a percentage is specified without any [=color-adjuster=] s,
0 commit comments