Closed mcstone closed 1 month ago
Glitch: Colors used need to have sufficient contrast with the background to make them legible, as defined by WCAG21 contrast ratios. For this check (for graphical objects) there should be at least a 3:1 contrast ratio. If this lint is not failing and you believe it should be, ensure that a color has been selected as having the "text" tag.
"All colors in a palette should have a sufficient contrast ratio with the background color. This is because if they are not, then they will not be differentiable from each other in some contexts. Valid algorithms are "APCA", "WCAG21", "Michelson", "Weber", "Lstar", "DeltaPhi".
First, these are about contrast with the background to make text readable, not to make the colors distinct from one another. Second, Since we call it WCAG, we need to use their algorithm, WCAG21, which is (L1 + 0.05) / (L2 + 0.05), with luminance defined by sRGB. Bringing in all those other metrics is pretty much irrelevant (though a geek could create equivalences for the threshold ratios, the curves are different for each method).
Proposal: Colors used need to have sufficient contrast with the background to make them legible, as defined by WCAG21 contrast ratios. These are 7:1 (AAA text), 4.5:1 (AA text) and 3:1 (Graphical objects).
We could add the additional information that "Luminance is calculated using the formula (L1 + 0.05) / (L2 + 0.05), with luminance for a an RGB display color assumed to be defined by sRGB." Or, leave it to the docs.