You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* <span class="swatch" style="--color: rgb(41.482% 7.941% 1.375%)"></span> color(display-p3 0.38 0.11 0.05) is <span class="swatch" style="--color: rgb(41.482% 7.941% 1.375%)"></span> color(xyz 0.06191 0.03568 0.00463) so the relative luminance is <b>0.03568</b>
624
+
* <span class="swatch" style="--color: yellow"></span> yellow is <span class="swatch" style="--color: yellow"></span> rgb(100% 100% 0%) which is <span class="swatch" style="--color: yellow"></span> color(xyz 0.76998 0.92781 0.13853) so the relative luminance is <b>0.92781</b>
625
+
* the contrast is (0.92781 + 0.05) / (0.03568 + 0.05) = <b>11.4123</b>
626
+
</div>
611
627
612
628
613
629
It then selects from that list
@@ -1103,6 +1119,20 @@ However, unlike HSL, manipulations are not guaranteed to be in-gamut.
1103
1119
1104
1120
The closest color inside the sRGB gamut would be <span class="swatch" style="--color: rgb(0% 64.2% 66.3%)"></span> lch(60.71% 37.56 201.1)
1105
1121
which is <span class="swatch" style="--color: rgb(0% 64.2% 66.3%)"></span> rgb(0% 64.2% 66.3%). The difference in chroma (37.5, instead of 90) is huge.
1122
+
1123
+
<figure>
1124
+
<img src="images/LCH-rotation-oog.svg"
1125
+
alt="Diagram of CH plane showing relative color manipulation">
1126
+
<figcaption>
1127
+
This diagram shows the sRGB gamut, in the CIE ab plane.
1128
+
Small circles indicate the primary and secondary color.
1129
+
The <span class="swatch" style="--color: rgb(86.1% 33.4% 97.6%)"></span>
1130
+
origin color, shown as a large circle, is in gamut for sRGB;
1131
+
becomes <span class="swatch oog" style="--color: #AAA"></span> out of gamut (shown as a grey fill and red border)
1132
+
when the LCH hue is rotated -120°.
1133
+
The gamut-mapped <span class="swatch" style="--color: rgb(0% 64.2% 66.3%)"></span> result has much lower chroma.
0 commit comments