Skip to content
This repository has been archived by the owner on Oct 28, 2018. It is now read-only.

Contrast ratio and rounding #23

Closed
patrickhlauke opened this issue Oct 21, 2016 · 2 comments
Closed

Contrast ratio and rounding #23

patrickhlauke opened this issue Oct 21, 2016 · 2 comments
Assignees

Comments

@patrickhlauke
Copy link
Contributor

Following discussion here w3c/wcag#200 (comment) there is/will be an issue with the way in which CCA currently rounds results to single decimal point and then uses the rounded value for its pass/fail determination.

4.5:1 and 3:1 need to be treated as absolute thresholds, and the non-rounded result needs to be assessed against this contrast. so for instance 4.49124578:1 needs to fail as it is below 4.5:1 in absolute terms - it can't be rounded first to 4.5:1 and THEN compared to the threshold figure.

this may require some extra tweaking of the displayed text for these cases. Maybe for values that are between 4.45 - 4.4999999 (or whatever the precision internally is) the output should read "The contrast ratio is: just below 4.5:1" (and the same for 2.95 - 2.9999 for the 3:1 ratio)

xref ThePacielloGroup/CCA-Win#30

@caiters
Copy link

caiters commented Sep 15, 2017

This just bit us today :( I was able to download an updated windows version for myself, but our designer is on Mac and his is still rounding up.

@ferllings
Copy link
Member

Yes, sorry about that.
I'll try to find some time to update the rounding asp.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants