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

Contrast ratio and rounding #30

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

Contrast ratio and rounding #30

patrickhlauke opened this issue Oct 21, 2016 · 15 comments

Comments

@patrickhlauke
Copy link
Contributor

patrickhlauke commented Oct 21, 2016

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-OSX#23

@DavidMacDonald
Copy link

Halloween bug
https://twitter.com/stevefaulkner/status/791944961952407552
Mwha ha ha ha

@patrickhlauke
Copy link
Contributor Author

👻 👻 👻

@ghost
Copy link

ghost commented Nov 6, 2016

updated b8445be

@patrickhlauke
Copy link
Contributor Author

@jun325 tested out the new 64 bit exe. the rounding seems to work perfectly (using #777777 / #FFFFFF as a test combination fails and shows "just below 4.5:1") (but see my comment about default.ini values having regressed?)

@ghost
Copy link

ghost commented Nov 21, 2016

Sorry. It's my fault. I have just uploaded correct ini.

@MakotoUeki
Copy link

MakotoUeki commented Feb 12, 2017

Have you fixed this issue with the latest version 2.4.0.10? It seems that it is still 4.5:1, not 4.48:1 when using #777777 / #FFFFFF with 2.4.0.10. I'm not sure if I uninstalled the previous version appropriately though.

One more thing. Please specify the version number (ex. "2.4.0.10", not "2.4") on the "About" panel (menu [Help] - [About ...]) so that users could confirm the version they are using and they could distinguish the bug-fixed version from the previous versions.

@patrickhlauke
Copy link
Contributor Author

@jun325 did this regress? confirming that in the latest version, #777777/#FFFFFF still returns a pass / 4.5:1, rather than a fail "just below 4.5:1"

@patrickhlauke
Copy link
Contributor Author

@jun325 ah, it actually seems you never pushed the fixed version to the stable branch here. are the changes to the rounding good to be added here? once this is done, i'll create a new release package

@patrickhlauke
Copy link
Contributor Author

The latest release https://github.com/ThePacielloGroup/CCA-Win/releases/tag/2.4.0.23 includes the correct rounding, as well as showing the full version number in the "About" dialog.

@patrickhlauke
Copy link
Contributor Author

cca2 4 0 23

@stevefaulkner
Copy link
Contributor

"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)"

although the reporting of the non rounded result 4.45 - 4.4999999 is shown as a fail, the displayed value is still rounded without indication "The contrast ratio is: 3.0:1" so needs to either report the actual result to 2 decimal places or add the clarification text "just below" /cc @jun325

@stevefaulkner stevefaulkner reopened this Sep 8, 2017
@jake-abma
Copy link

jake-abma commented Sep 8, 2017

Hi @patrickhlauke, any idea when a new Mac version will be launched? At the moment the two versions (Mac / Windows) have different results: https://developer.paciellogroup.com/resources/contrastanalyser/

Thx!

@patrickhlauke
Copy link
Contributor Author

@stevefaulkner you sure you're on the latest version? it IS showing the "just below" bit in the result for me.

@patrickhlauke
Copy link
Contributor Author

@jake-abma unfortunately no indication just yet when the Mac one will be updated, sorry. Will discuss with @stevefaulkner

@stevefaulkner
Copy link
Contributor

@stevefaulkner you sure you're on the latest version? it IS showing the "just below" bit in the result for me.

probably not then, will check and close bug if so.

@jake-abma unfortunately no indication just yet when the Mac one will be updated, sorry. Will discuss with @stevefaulkner

Am organising @ferllings to have time to work on it

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

5 participants