@@ -20,6 +20,12 @@ spec:css-color-4; type:dfn; text:colorspace
20
20
spec:css-color-4; type:dfn; text:gamut
21
21
</pre>
22
22
23
+ <style>
24
+ .swatch {display: inline-block; height: 1.2em; width: 1.2em;}
25
+ .peru {background-color: peru;}
26
+ .darkperu {background-color: rgb(57.58%, 32.47%, 3.82%);}
27
+ </style>
28
+
23
29
Introduction {#intro}
24
30
=====================
25
31
@@ -188,18 +194,18 @@ Adjusting colors: the ''color-adjust'' function {#coloradjust}
188
194
</pre>
189
195
190
196
<div class="example">
191
- This example produces the adjustment of red ,
197
+ This example produces the adjustment of peru (#CD853F) ,
192
198
in ''lch()'' colorspace (the default),
193
- with the lightness being increased by 30 %.
199
+ with the lightness being reduced by 20 %.
194
200
The chroma and hue of red are left unchanged.
195
201
196
- <pre class="lang-css"> adjust-color(red , lightness(30 %));</pre>
202
+ <pre class="lang-css"> adjust-color(peru , lightness(-20 %));</pre>
197
203
198
204
The calculation is as follows:
199
- * sRGB red (#F00) is lch(54.2917 106.8390 40.8526 )
200
- * adjusted lightness is 54.2917 + 30 = 84.2917
201
- * adjusted result is lch(84.2917 106.8390 40.8526 )
202
- * which is a light red color: rgb(218.5126% 218.5197% 218.4963%)
205
+ * peru (#CD853F) <span class="swatch peru"> </span> is lch(62.2532% 54.0114 63.6769 )
206
+ * adjusted lightness is 62.2532% - 20% = 42.2532%
207
+ * adjusted result is lch(42.2532% 54.0114 63.6769 )
208
+ * which is rgb(57.58%, 32.47%, 3.82%) <span class="swatch darkperu"> </span>
203
209
</div>
204
210
205
211
<img src="images/adjust_red_lightness30.png" alt="Result of adjust-color(red, lightness(30%)" />
0 commit comments