Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

For contrast just below the threshold, "Copy results" gives a contradictory number #300

Closed
mitchellevan opened this issue Jun 6, 2023 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@mitchellevan
Copy link

mitchellevan commented Jun 6, 2023

Describe the bug

When the CCA window says "Contrast ratio just below 4.5:1", copying the results to the clipboard says "Contrast ratio: 4.5:1".

The difference between "just below 4.5:1" and "4.5:1" is the difference between failing and passing, so this is a significant difference. Furthermore, the clipboard text contradicts itself by saying "Contrast ratio: 4.5:1" followed by "Fail for regular text".

Example of clipboard text:

Foreground: #777777
Background: #FFFFFF
Contrast ratio: 4.5:1
1.4.3 Contrast (Minimum) (AA)
    Pass for large text only. Fail for regular text
1.4.6 Contrast (Enhanced) (AAA)
    Fail for large and regular text
1.4.11 Non-text Contrast (AA)
    Pass for UI components and graphical objects

A similar problem occurs for a contrast ratio "just below 3:1 (2.995:1)". Example of clipboard text:

Foreground: #959595
Background: #FFFFFF
Contrast ratio: 3:1
1.4.3 Contrast (Minimum) (AA)
    Fail for large and regular text
1.4.6 Contrast (Enhanced) (AAA)
    Fail for large and regular text
1.4.11 Non-text Contrast (AA)
    Fail for UI components and graphical objects

Desktop (please complete the following information):

  • OS: Windows 10 64 bit
  • CCA Version: 3.3.0

To Reproduce

  1. Using the eyedropper or direct entry, enter a pair of colors which differ by just under 4.5:1. Example: #777777 and #FFFFFF
  2. In the CCA window, observe the contrast ratio reported. Example: "Contrast ratio just below 4.5:1 (4.478:1)"
  3. In the "Edit" menu, select "Copy results" (or press CTRL + SHIFT + C) to copy results to the clipboard.
  4. Paste the results outside of CCA.
  5. In the pasted results, observe the contrast ratio reported.

Expected behavior

The contrast ratio reported at step 2 should be the same as the contrast ratio reported at step 5.

How to format it in the clipboard:

  • "Contrast ratio: 4.478:1" is a good format for the clipboard. Use case: As a WCAG evaluator pasting this information manually into an audit report, I prefer to see just the number. Use case: As an engineer using a script to process the result, I can parse the single number easily.
  • "Contrast ratio: just below 4.5:1 (4.478:1)" would be an acceptable alternative for the clipboard.

Note: When the CCA window shows a result rounded to one decimal place (e.g., "Contrast ratio 4.4:1"), the same rounded result should continue to appear in the clipboard ("Contrast ratio: 4.4:1") as it does today.

Screenshots

Step 2 in steps to reproduce:

Colour Contrast Analyser window showing the contrast between #777777 and #FFFFFF

Additional context

Understanding SC 1.4.3 Contrast (Minimum):

When comparing the computed contrast ratio to the Success Criterion ratio, the computed values should not be rounded (e.g. 4.499:1 would not meet the 4.5:1 threshold).

@ferllings ferllings self-assigned this Jun 6, 2023
@ferllings ferllings added the bug Something isn't working label Jun 6, 2023
@mitchellevan mitchellevan changed the title For contrast just below 4.5:1, "Copy results" gives a contradictory number For contrast just below the threshold, "Copy results" gives a contradictory number Jun 6, 2023
@ferllings
Copy link
Member

Fixed on 37fc9a6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants