@@ -143,6 +143,30 @@ Mixing colors: the ''color-mix()'' function {#color-mix}
143143 and
144144 <var> p2</var> becomes <var> p2</var> / (<var> p1</var> + <var> p2</var> ).
145145
146+ <div class="example">
147+ These syntactic forms are thus all equivalent:
148+
149+ <pre class="lang-css">
150+ color-mix(in lch, purple 50%, plum 50%)
151+ color-mix(in lch, purple 50%, plum)
152+ color-mix(in lch, purple, plum 50%)
153+ color-mix(in lch, purple, plum)
154+ color-mix(in lch, plum, purple)
155+ color-mix(in lch, purple 80%, plum 80%)
156+ </pre>
157+
158+ All produce a 50-50 mix of <span class="swatch" style="--color: purple"></span> purple and <span class="swatch" style="--color: plum"></span> plum,
159+ in lch: <span class="swatch" style="--color: rgb(68.51%, 36.01%, 68.29%)"></span> lch(51.51% 52.21 325.8) which is <span class="swatch" style="--color: rgb(68.51%, 36.01%, 68.29%)"></span> rgb(68.51% 36.01% 68.29%).
160+
161+ However, this form is <em> not</em> the same, as the alpha is less than one:
162+
163+ <pre class="lang-css">
164+ color-mix(in lch, purple 30%, plum 30%)
165+ </pre>
166+
167+ This produces <span class="swatch" style="--color: rgb(68.51%, 36.01%, 68.29%, 0.6)"></span> lch(51.51% 52.21 325.8 / 0.6) which is <span class="swatch" style="--color: rgb(68.51%, 36.01%, 68.29%, 0.6)"></span> rgb(68.51% 36.01% 68.29% / 0.6).
168+ </div>
169+
146170After normalizing both percentages, the result is produced via the following algorithm:
147171
1481721. Both colors are converted to the specified <<color-space>> .
0 commit comments