w3c / silver

Accessibility Guidelines "Silver"
https://w3c.github.io/silver/
Other
199 stars 44 forks source link

How does the guideline ensure text is sufficiently readable for people with CVD (colourblindness) #333

Open sdw32 opened 3 years ago

sdw32 commented 3 years ago

In the current draft guideline, passing the 'visual contrast of text' guideline appears to be based solely on the score from the APCA tool. However, a quick investigation suggested it was possible to pass the APCA tool for text that became almost invisible with CVD

For example, if I enter #f00 foreground and #000 background for red text on a black background, APCA says I can pass at score 4 with 400-weight text at size 48px. Yet if I screenshot this colour combination and feed it into the myndex CVD simulator, it is clear the red text becomes almost invisible, as per the screenshot below. Untitled-2

I wondered if it would be possible to combine these 2 tools, so that the APCA tool runs the foreground and background colour combination through the CVD simulator, and reports the minimum of the Luminance contrasts from all the different types of colourblindness?

Myndex commented 3 years ago

@sdw32 Thank you for commenting

IN GENERAL: deriving contrast from the luminance stimulus is what is needed for readability. Chroma/hue are not useful (and can interfere).

Red at Night....

Pure red #f00 is one of several known edge cases. It affects protans (~1% of population). In the guidelines it is discussed SEPARATELY from the APCA tool.

Nevertheless, It is NOT considered a "pass" in the APCA tool. With the G series constants, it is Lc -37, below the Lc45 cutoff for CONTENT (fluent readability) text. Not all of this information has migrated into the FPWD, and some aspects are still in progress.

The public CVD tool does not show at full resolution, so the perception is slightly skewed, as the version you are showing is at 1/3rd the actual resolution so the sample fonts are also 1/3rd the size they need to be. Nevertheless, yes, pure red is difficult to read for a protan, even in the full res version:

sRGBredProtan

Fixing Red for Protan: APCA Extension

There is already a color extension invented and tested to handle things like this, and the APCA algorithm is designed specifically to be extensible, so that features like this can be added. It is NOT added yet, due to IP reasons, and I can not discuss it any further publicly at this time.

In the interim

The Visual Contrast GUIDELINE discusses how pure red is prohibited as the brightest of two colors. The APCA tool reports it at under the cutoff of 45 (G series constants) intended for content text. And to note, this is an extreme edge case, applying only to protanopia.

WCAG 2.x vs APCA

And even without the color module, the APCA is a massive improvement here from WCAG 2.x. Take a look at how WCAG 2.x rates that same pure red:

WCAG 2 x red on black

WCAG 2.x gives this a 5.25:1, which passes ANY size text at the AA level. As a side note, the WCAG 2.x was intended to "help" protans, though it actually makes some color combinations worse for them.

This and other WCAG 2.x comparisons are discussed in these two brief articles:

Orange you Wondering About Contrast?

The Lighter Side of Dark Backgrounds

Thank you,

Andy

Andrew Somers W3 AGWG Invited Expert Myndex Color Science Researcher https://www.myndex.com/APCA/simple

Addendum: This is that same pure red slide, normal vision:

Screen Shot 2021-02-27 at 2 32 26 AM
ChrisLoiselle commented 3 years ago

@jspellman this is ready for survey.

ChrisLoiselle commented 3 years ago

DRAFT RESPONSE: We believe the questions were answered per https://github.com/w3c/silver/issues/333#issuecomment-787063163.

I hope this answers your question, if it does not, please feel free to follow-up.

Thank you, Chris

sdw32 commented 3 years ago

Yes the latest algorithms handle red on black better than WCAG 2.X, but yet there are still 'edge' cases for colour combinations that the current APCA algorithm will pass for certain use cases, yet become problematic with Protanopia.

@Myndex thanks for your comments. I had a look at some colours with a heavy red component that pass a score of 60, and yes in this case the effect of the protanopia is not as severe.

However, the problem can still occur for other use cases that can pass with a lower score. So, even in the latest tool that I tried today, RGB(255, 0, 0) gives a score of 38, and this would pass for text for spot reading (like a label in a diagram)

Running this colour through your simulator gives an equivalent of RGB (96, 96, 15) with simulated protanopia, and running this colour through the APCA tool gives a score of 19, which would not be suitable for this use case.

So, the issue can still occur where certain combinations pass the current APCA tool yet are considerably inappropriate with protanopia.

From conversations with my current clients, they are looking for a single catch all test that covers both CVD and contrast, rather than 2 separate tests. For a particular colour combination, I believe this could be achieved by: running the RGB set 'as is' through the APCA algorithm modifying the RGB set to simulate protanopia, and then run it through the APCA algorithm again *report the worst score that comes out of this this approach would be readily extensible to simulate other kinds of CVD as well. Achieving this would require a public domain RGB protanopia transformation algorithm. I don't know if such a thing exists, but it would be ideal if it did!