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: technical-reports/color/color-type.md
+19-10Lines changed: 19 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -100,7 +100,9 @@ While both examples will render as white, the first example is more explicit abo
100
100
The following values are supported for the `colorSpace` property. The `components` array will vary depending on the color space.
101
101
102
102
<asideclass="ednote"title="Syntax for expressing ranges">
103
-
<p>In this table, brackets <code>[]</code> indicate that an extrema are included, parentheses <code>()</code> indicate that the <ahref="https://en.wikipedia.org/wiki/Maximum_and_minimum">extrema</a> are excluded. For example, in the HSL color space, hue is in the range of <ahref="https://www.w3.org/TR/css-color-4/#hue-syntax">[0 - 360)</a>, which means that <code>0</code> MAY be used but <code>360</code> MUST NOT be used.</p>
103
+
104
+
In this table, brackets `[]` indicate that [extrema](https://en.wikipedia.org/wiki/Maximum_and_minimum) are _included_, parentheses `()` indicate that the extrema are _excluded_. For example, in the HSL color space, hue is in the range of [[0 - 360)](https://www.w3.org/TR/css-color-4/#hue-syntax), which means that `0` MAY be used but `360` MUST NOT be used.
105
+
104
106
</aside>
105
107
106
108
<tableclass="data">
@@ -324,6 +326,7 @@ The following values are supported for the `colorSpace` property. The `component
324
326
</tr>
325
327
</tbody>
326
328
</table>
329
+
327
330
<div>
328
331
<span><spanid="fn-1">*</span> In CIELAB, A and B are unbounded but in practice don't exceed -160 to 160</span><br />
329
332
<span><spanid="fn-2">**</span> In LCH, C is unbounded but in practice doesn't exceed 230</span><br />
@@ -332,21 +335,27 @@ The following values are supported for the `colorSpace` property. The `component
332
335
</div>
333
336
334
337
<asideclass="ednote"title="Precision in examples">
335
-
<p>The examples below have varying degrees of precision (i.e. numbers after the decimal). This is done to ensure that the <code>fallback</code> color is exactly the same as the defined color when converted to HEX. In practice, the numbers used to define each component can have any degree of precision.</p>
338
+
339
+
The examples below have varying degrees of precision (i.e. numbers after the decimal). This is done to ensure that the `fallback` color is exactly the same as the defined color when converted to HEX. In practice, the numbers used to define each component can have any degree of precision.
340
+
336
341
</aside>
337
342
338
343
<asideclass="ednote"title="Optional values in examples">
339
-
<p>The examples below are given with all optional values (alpha, hex) included for the purpose of completeness. Defining the alpha property for fully-opaque colors is not required, see <ahref="#format">#format</a>.</p>
344
+
345
+
The examples below are given with all optional values (alpha, hex) included for the purpose of completeness. Defining the alpha property for fully-opaque colors is not required, see [Format](#format).
346
+
340
347
</aside>
341
348
342
349
<asideclass="ednote"title="How does this conform to CSS Color Module 4?">
343
-
<p>To provide a logically consistent approach without creating ambiguity around the format, this spec takes the following approach:</p>
344
-
<ul>
345
-
<li>If CSS Color Module 4 allows a color space to be referenced by <strong>both</strong> a named function (like <code>srgb()</code>) <strong>and</strong> a keyword in the <code>color()</code> function, use the format intended for the <code>color()</code> function.</li>
346
-
<li>If CSS Color Module 4 only defines a color space <strong>either</strong> as a named function (like <code>hwb()</code>) <strong>or</strong> a keyword in the <code>color()</code> function (like <code>rec-2020</code>), use the syntax indicated.</li>
347
-
<li>If CSS Color Module 4 allows <strong>both</strong> unit values (like <code>50</code>) <strong>and</strong> percentages (like <code>50%</code>) for a component, use the unit value.</li>
348
-
</ul>
349
-
<p>Using this spec as a reference allows us to focus on the design and implementation of the tokens themselves, rather than the underlying color science.</p>
350
+
351
+
To provide a logically consistent approach without creating ambiguity around the format, this spec takes the following approach:
352
+
353
+
- If CSS Color Module 4 allows a color space to be referenced by **both** a named function (like `srgb()`) **and** a keyword in the `color()` function, use the format intended for the `color()` function.
354
+
- If CSS Color Module 4 only defines a color space **either** as a named function (like `hwb()`) **or** a keyword in the `color()` function (like `rec-2020`), use the syntax indicated.
355
+
- If CSS Color Module 4 allows **both** unit values (like `50`) **and** percentages (like `50%`) for a component, use the unit value.
356
+
357
+
Using this spec as a reference allows us to focus on the design and implementation of the tokens themselves, rather than the underlying color science.
0 commit comments