Skip to content

Commit

Permalink
[css-color-5] Update hsl example which still used preliminary gamut m…
Browse files Browse the repository at this point in the history
…apping step
  • Loading branch information
svgeesus committed Aug 23, 2023
1 parent 91f68d0 commit 9b3bff8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions css-color-5/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -441,18 +441,17 @@ The choice of mixing color space can have a large effect on the end result.
The calcuation is as follows:
* <span class="swatch oog" style="--color: white"></span> color(display-p3 0 1 0)
is color(srgb -0.5116 1.01827 -0.3107) which is outside the sRGB gamut
* after CSS gamut mapping,the new color is
<span class="swatch" style="--color: rgb(0% 99.797% 0%)"></span> color(srgb 0 0.99797 0)
which can now be converted to ''hsl''
<span class="swatch" style="--color: rgb(0% 99.797% 0%)"></span> hsl(120 100% 49.898%)
* Converted to ''hsl''
<span class="swatch oog" style="--color: rgb(0% 99.797% 0%)"></span>
hsl(127.879 301.946 25.334)
* <span class="swatch" style="--color: yellow"></span> yellow is
<span class="swatch" style="--color: yellow"></span> hsl(60 100% 50%)
* the hue is 120 × 0.8 + 60 × 0.2 = 108
* the saturation is 100%
* the lightness is 49.898 × 0.8 + 50 × 0.2 = 49.9184
* the hue is 127.879 × 0.8 + 60 × 0.2 = 114.3032
* the saturation is 301.946 × 0.8 + 100 × 0.2 = 261.5568
* the lightness is 25.334 × 0.8 + 50 × 0.2 = 30.2672
* the mixed result is
<span class="swatch" style="--color: rgb(19.969% 99.837% 0%)"></span> hsl(108 100% 49.9184%) which is
<span class="swatch" style="--color: rgb(19.969% 99.837% 0%)"></span> color(display-p3 0.48903 0.98415 0.29889)
<span class="swatch oog" style="--color: rgb(72.66% 100% 0%)"></span> hsl(114.3032 261.5568 30.2672) which is
<span class="swatch oog" style="--color: rgb(72.66% 100% 0%)"></span> color(srgb -0.3387 1.0943, -0.48899)
</div>

<h3 id="color-mix-with-alpha">
Expand Down

0 comments on commit 9b3bff8

Please sign in to comment.