Skip to content

Commit 28cac68

Browse files
committed
[css-color-5] more diagrams
1 parent 72230e6 commit 28cac68

File tree

3 files changed

+88
-4
lines changed

3 files changed

+88
-4
lines changed

css-color-5/Overview.bs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,12 +126,24 @@ it applies to all color channels.
126126

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

129+
<figure>
130+
<img src="images/CH-mixing3.svg" style="width: 50vw">
131+
<figcaption>Mixtures of red and yellow.
132+
Red has a hue angle, measured from the positive a axis,
133+
of 40.8526 degrees
134+
while yellow has a hue angle of 99.5746 degrees.
135+
Red has a chroma, or distance from the central neutral axis, of 106.8390
136+
while yellow has a chroma of 94.7077.
137+
Mixtures lie along the dashed curve. A 65%/35% mixture is shown.
138+
</figcaption>
139+
</figure>
140+
129141
The calculation is as follows:
130142
* sRGB <span class="swatch" style="--color: red"></span> red (#F00) is lch(54.2917% 106.8390 40.8526)
131143
* sRGB <span class="swatch" style="--color: yellow"></span> yellow (#FF0) is lch(97.6071% 94.7077 99.5746)
132-
* mix lightness is 54.2917 * 0.65 + 97.6071 * 0.35 = 69.4521
133-
* mix chroma is 106.83 * 0.65 + 94.7077 * 0.35 = 102.5872
134-
* mix hue is 40.8526 * 0.65 + 99.5746 * 0.35 = 61.4053
144+
* mixed lightness is 54.2917 * 0.65 + 97.6071 * 0.35 = 69.4521
145+
* mixed chroma is 106.83 * 0.65 + 94.7077 * 0.35 = 102.5872
146+
* mixed hue is 40.8526 * 0.65 + 99.5746 * 0.35 = 61.4053
135147
* mixed result is lch(69.4521% 102.5872 61.4053)
136148
* which is a red-orange: <span class="swatch" style="--color: rgb(75.3600% 65.6304% 16.9796%)"></span> rgb(75.3600% 65.6304% 16.9796%)
137149
<!-- no it isn't!

css-color-5/images/CH-mixing.svg

Lines changed: 1 addition & 1 deletion
Loading

css-color-5/images/CH-mixing3.svg

Lines changed: 72 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)