Skip to content

Commit

Permalink
[css-color-5] change example to demonstrate longer hue arc #4735
Browse files Browse the repository at this point in the history
  • Loading branch information
svgeesus committed May 27, 2020
1 parent 4c3ed17 commit 2e68776
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion css-color-5/Overview.bs
Expand Up @@ -248,9 +248,10 @@ are copied across from the <em>first</em> color.
in ''lch()'' colorspace (the default),
with the hue being 75.23% of that of the red
(and thus, 24.77% of that of the blue).
The longer hue arc has been specified.
The chroma and lightness of the red are left unchanged.

<pre class="lang-css">color-mix(lch(52% 58.1 22.7) lch(56% 49.1 257.1) hue(75.23%));</pre>
<pre class="lang-css">color-mix(lch(52% 58.1 22.7) lch(56% 49.1 257.1) hue(75.23% longer));</pre>

<figure>
<img src="images/CH-mixing2.svg" style="width: 50vmin">
Expand All @@ -267,6 +268,7 @@ are copied across from the <em>first</em> color.
The calculation is as follows:
* <span class="swatch" style="--color: rgb(82.02% 30.21% 35.02%)"></span> lch(52% 58.1 22.7)
* <span class="swatch" style="--color: rgb(5.64% 55.94% 85.31%)"></span> lch(56% 49.1 257.1)
* hue difference is |257.1 - 22.7| = 234.4, which is greater than 180, but the long arc was requested.
* mixed hue is 22.7 * 0.7523 + 257.1 * 0.2477 = 80.76
* mixed result is <span class="swatch" style="--color: rgb(61.11% 45.85% 0.41%)"></span> lch(52% 58.1 80.76)

Expand Down

0 comments on commit 2e68776

Please sign in to comment.