@@ -82,18 +82,18 @@ Mixing colors: the ''color-mix'' function {#colormix}
8282<div class="example">
8383 This example produces the mixture of a deep green and a sky blue,
8484 in ''lch()'' colorspace (the default),
85- with the lightness being 50 % of the lightness of the green
86- (and thus, 50 % of the lightness of the blue).
85+ with the lightness being 40 % of the lightness of the green
86+ (and thus, 60 % of the lightness of the blue).
8787 The chroma and hue of the green are left unchanged.
8888
89- <pre class="lang-css"> mix-color(rgb(0% 42.35% 33.33%), rgb(41.2% 69.88% 96.64%), lightness(50 %));</pre>
89+ <pre class="lang-css"> mix-color(rgb(0% 42.35% 33.33%), rgb(41.2% 69.88% 96.64%), lightness(40 %));</pre>
9090
9191 The calculation is as follows:
9292 * <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)
9393 * <span class="swatch" style="--color: rgb(41.2% 69.88% 96.64%)"></span> rgb(41.2% 69.88% 96.64%) is lch(70% 42.5 258.2)
94- * mix lightness is 40.083 * 0.5 + 70% * 0.5 = 55.0415
95- * mixed result is <span class="swatch" style="--color: rgb(22.87% 57.56% 47.73 %)"></span> lch(55.0415 32.808 171.175)
96- * which is a <span class="swatch" style="--color: rgb(22.87% 57.56% 47.73 %)"></span> rgb(22.87% 57.56% 47.73 %), a lighter green
94+ * mix lightness is 40.083 * 0.4 + 70% * (1 - 0.4) = 58.0332
95+ * mixed result is <span class="swatch" style="--color: rgb(26.25% 60.68% 50.72 %)"></span> lch(58.0332 32.808 171.175)
96+ * which is a <span class="swatch" style="--color: rgb(26.25% 60.68% 50.72 %)"></span> rgb(26.25% 60.68% 50.72 %), a lighter green
9797
9898</div>
9999
0 commit comments