SSAgov / ANDI

A tool to test web content for accessibility and 508 compliance.
https://www.ssa.gov/accessibility/andi/help/howtouse.html
Other
293 stars 75 forks source link

ANDI seems to be miscalculating contrast ratios #224

Closed jcorradino closed 3 months ago

jcorradino commented 5 months ago

image

In the above image, it is reporting that #4b92bc and #488ec1 are almost passing for large text at 2.96:1, when it in reality is closer to 1.04:1. It is possible to get a correct value by switching back and forth between different elements, but there seems to be no rhyme or reason as to why it is functioning in this way, and the only way to be sure it is accurate is to check another contrast checker.

Version Info: ANDI 29.0.1 / fANDI: 7.0.0

JohnCotterSSA commented 5 months ago

Looking at your screenshot, the hex values are cut off, so I can't completely verify what values you are using. However the two blue swatches do look identical and, I would guess, would give a value close to 1:1 .

If I try the values from your description above in the Contrast Playground, it does calculate the 1:04:1. (Screenshot below)

Screenshot 2024-01-22 101118

So that I can reproduce the issue, can you give me the exact steps that you use to arrive at this potential bug?