Skip to content

Commit

Permalink
[css-color-5] Ceterum censeo Comma esse delendam
Browse files Browse the repository at this point in the history
  • Loading branch information
svgeesus committed Feb 4, 2020
1 parent a395cea commit c30f441
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions css-color-5/Overview.bs
Expand Up @@ -86,7 +86,7 @@ Mixing colors: the ''color-mix'' function {#colormix}
(and thus, 60% of the lightness of the blue).
The chroma and hue of the green are left unchanged.

<pre class="lang-css">mix-color(rgb(0% 42.35% 33.33%), rgb(41.2% 69.88% 96.64%), lightness(40%));</pre>
<pre class="lang-css">mix-color(rgb(0% 42.35% 33.33%) rgb(41.2% 69.88% 96.64%), lightness(40%));</pre>

This comment has been minimized.

Copy link
@jonathantneal

jonathantneal Feb 4, 2020

Contributor
	<pre class="lang-css">mix-color(rgb(0% 42.35% 33.33%) rgb(41.2% 69.88% 96.64%) lightness(40%));</pre>

This comment has been minimized.

Copy link
@svgeesus

svgeesus Feb 4, 2020

Author Contributor

oops, yes


The calculation is as follows:
* <span class="swatch" style="--color: rgb(0% 42.35% 33.33%)"></span> rgb(0% 42.35% 33.33%) is lch(40.083% 32.808 171.175)
Expand All @@ -104,7 +104,7 @@ Mixing colors: the ''color-mix'' function {#colormix}
(and thus, 62% of that of the blue).
The chroma and lightness of the red are left unchanged.

<pre class="lang-css">mix-color(rgb(82.02% 30.21% 35.02%), rgb(5.64% 55.94% 85.31%), hue(75.23%));</pre>
<pre class="lang-css">mix-color(rgb(82.02% 30.21% 35.02%) rgb(5.64% 55.94% 85.31%) hue(75.23%));</pre>

The calculation is as follows:
* <span class="swatch" style="--color: rgb(82.02% 30.21% 35.02%)"></span> rgb(82.02% 30.21% 35.02%) is lch(52% 58.1 22.7)
Expand All @@ -124,7 +124,7 @@ Mixing colors: the ''color-mix'' function {#colormix}
This time, the lightness is set to 68.4% and
the chroma is left unchanged.

<pre class="lang-css">mix-color(rgb(82.02% 30.21% 35.02%), rgb(5.64% 55.94% 85.31%), hue(75.23%) lightness(68.4%));</pre>
<pre class="lang-css">mix-color(rgb(82.02% 30.21% 35.02%) rgb(5.64% 55.94% 85.31%) hue(75.23%) lightness(68.4%));</pre>

The calculation is as follows:
* <span class="swatch" style="--color: rgb(82.02% 30.21% 35.02%)"></span> rgb(82.02% 30.21% 35.02%) is lch(52% 58.1 22.7)
Expand All @@ -149,7 +149,7 @@ Mixing colors: the ''color-mix'' function {#colormix}
(and thus, 70% of the lightness of yellow).
The chroma and hue of red are left unchanged.

<pre class="lang-css">mix-color(red, yellow, lightness(30%));</pre>
<pre class="lang-css">mix-color(red yellow lightness(30%));</pre>

The calculation is as follows:
* sRGB <span class="swatch" style="--color: red"></span> red (#F00) is lch(54.2917% 106.8390 40.8526)
Expand Down Expand Up @@ -182,7 +182,7 @@ which applies to all color channels.
keeps the intermediate colors
as saturated as the endpoint colors.

<pre class="lang-css">mix-color(red, yellow, 65%);</pre>
<pre class="lang-css">mix-color(red yellow 65%);</pre>

The calculation is as follows:
* sRGB <span class="swatch" style="--color: red"></span> red (#F00) is lch(54.2917% 106.8390 40.8526)
Expand Down Expand Up @@ -245,7 +245,7 @@ which is rgb(52.446% 45.821% 62.953%)

This shows a desaturated result, compared to LCH interpolation.

<pre class="lang-css">mix-color(rgb(82.02% 30.21% 35.02%), rgb(5.64% 55.94% 85.31%), lab() a(38%) b(38%));</pre>
<pre class="lang-css">mix-color(rgb(82.02% 30.21% 35.02%) rgb(5.64% 55.94% 85.31%) lab() a(38%) b(38%));</pre>

<!-- is that right, lab() or lab ? -->

Expand Down Expand Up @@ -365,7 +365,7 @@ Adjusting colors: the ''color-adjust'' function {#coloradjust}
with the lightness being reduced by 20%.
The chroma and hue of red are left unchanged.

<pre class="lang-css">color-adjust(peru, lightness(-20%));</pre>
<pre class="lang-css">color-adjust(peru lightness(-20%));</pre>

The calculation is as follows:
* <span class="swatch" style="--color: peru"></span> peru (#CD853F) is lch(62.2532% 54.0114 63.6769)
Expand Down Expand Up @@ -406,7 +406,7 @@ When an origin color is present, the following keywords can also be used in this
To manipulate color channels in the sRGB colorspace:

<pre>
rgb(from <span class="swatch" style="--color: indianred"></span> indianred, 255 g b)
rgb(from <span class="swatch" style="--color: indianred"></span> indianred 255 g b)
</pre>

This takes the sRGB value of indianred (205 92 92) and replaces the red channel with 255 to give <span class="swatch" style="--color: rgb(255 92 92)"></span> rgb(255 92 92).
Expand All @@ -432,7 +432,7 @@ When an origin color is present, the following keywords can also be used in this
This adds 180 degrees to the hue angle, giving a complementary color.
<pre>
--accent: <span class="swatch" style="--color: lightseagreen"></span> lightseagreen;
--complement: <span class="swatch" style="--color: hsl(357deg 70% 41%)"></span> hsl(from var(--accent), calc(h+180) s l);
--complement: <span class="swatch" style="--color: hsl(357deg 70% 41%)"></span> hsl(from var(--accent) calc(h+180) s l);
</pre>
lightseagreen is hsl(177deg 70% 41%), so --complement is <span class="swatch" style="--color: hsl(357deg 70% 41%)"></span> hsl(357deg 70% 41%)
</div>
Expand Down

0 comments on commit c30f441

Please sign in to comment.