w3c / silver

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

Visual contrast for non-sRGB color #230

Open stof opened 3 years ago

stof commented 3 years ago

The computation of APCA for the visual contrast states on https://w3c.github.io/silver/guidelines/methods/Method-font-characteristic-contrast.html that it requires sRGB colors. Given that CSS Color Level 4 is introducing support for other color spaces (through lab()), I think it would make sense to design WCAG 3 to support such colors. Otherwise, the method risks being obsolete soon after the release of WCAG 3.0 (or even before that if CSS Color 4 moves forward before WCAG 3.0).

Myndex commented 3 years ago

Hi @stof Christoph, thank you for commenting.

sRGB is specified because sRGB is the current standard, and will continue to be the default standard for CSS level 4, and will continue to be the designated accessible colorspace indefinitely. There are a number of reasons that sRGB is ideal for accessibility purposes, while some of the newer spaces, especially Rec2020 and Rec2100, have features that make them a problem for some impairment types. Failing to have an sRGB fallback will be an accessibility failure, at least until certain other adaptive technologies are available.

Nevertheless, SAPC and the subset APCA algorithm are highly extensible and adjustable to allow for different colorspaces, as it only requires a change to the input module's exponent and matrix constants to linearize to the weighted/clamped luminance. For the purposes of the APCA tool, the important thing is mathematically modeling the perception of the physical monitor.

As WCAG 3 is still in the first public draft stage, much of this is up in the air as it were, but rest assured this is already a consideration and extensibility and adjustability were one of the key goals when I invented SAPC and the APCA algorithm. If you're interested, my background is in the Hollywood film and television industry, and I am intimately familiar with the differences of other colorspaces. I hope this answers your questions.

Thank you,

Andy

Andrew Somers W3 WAI Invited Expert Myndex Color Science Researcher Inventor of APCA & SAPC Technologies

Myndex commented 3 years ago

Hi @stof Christoph, just to add: the draft you are looking at is obsolete. For more regarding APCA see:

And the actual working draft for WCAG 3: https://w3c.github.io/silver/guidelines/

stof commented 3 years ago

the draft you are looking at is obsolete

if you talk about the link I shared, I suggest updating the page to mention it is obsolete then. This link was used by the Chrome DevTools team in the blog post they shared today (which is how I re-discovered that link today): https://developers.google.com/web/updates/2021/01/devtools#apca

stof commented 3 years ago

Failing to have an sRGB fallback will be an accessibility failure, at least until certain other adaptive technologies are available.

AFAICT, an sRGB fallback would be used only for browsers not supporting the lab() notation in CSS (unless you talk about a different kind of fallback, which then needs to be explained to me). So the relevant value for users of a (future) modern browser might still be out of the sRGB colorspace.

Note I'm not an expert at all in colors. I'm mostly looking at this from the perspective of a developers interested into improving accessibility of websites I build (and trying to see how this field evolves, by curiosity)

Myndex commented 3 years ago

Hi @stof

if you talk about the link I shared, I suggest updating the page to mention it is obsolete then. This link was used by the Chrome DevTools team in the blog post they shared today...

Yes, I submitted a pull request for that a long time ago, the way drafts are handled it is out of my hands, but should be part of this issue for fixing.

And that reminds me of some related things I was supposed to discuss with the Chrome team...

AFAICT, an sRGB fallback would be used only for browsers not supporting the lab() notation in CSS

Ah I see what you are meaning. I do need to be more involved with the CSS Color module in part for this reason, but the CSS color (it may be level 5 tho) has converters for lab and other spaces.

AND: in the APCA code I have already built a complete suite of CIE colorspace functions which can use LAB, LUV, xyY, XYZ etc. Adding other spaces is just a matter of adding in the appropriate matrixes. The code is already there as it is being used in research and in the beta versions. Right NOW the APCA tool takes any currently valid color string in cluding the 140 or so html names, and when that actually changes so will the tool.

As I said, this is all already anticipated, and thank you for mentioning.

Andy

stof commented 3 years ago

OK, then it is probably only an issue related to the fact that https://w3c.github.io/silver/guidelines/methods/Method-font-characteristic-contrast.html is an outdated draft but does not tell it. That's the place limiting to sRGB while newer resources indeed don't have it.

I suggest updating this W3C Silver website to make it clear that this resource is outdated (and link to newer ones).

jspellman commented 3 years ago

I am suggesting this go directly to the editors to update the link to the latest resources.

ChrisLoiselle commented 3 years ago

@jspellman Yes, this should be updated by the editors to reflect the correct links. This pertains to the previously mentioned https://github.com/w3c/silver/issues/443 which is ready for survey. Please also review https://github.com/w3c/silver/pull/213 , which relates to https://github.com/w3c/silver/issues/443 .

ChrisLoiselle commented 3 years ago

DRAFT RESPONSE: We believe the questions have been answered per Andy's response.

The links should be updated by the editors to reflect the correct links.

This issue pertains to the previously mentioned #443 . Please also review #213 , which relates to #443 .

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

Thank you, Chris

Myndex commented 2 years ago

Well, I had made pull request #213 a YEAR ago and still no action on it.

SO, I just made a SEPARATE fresh pull request #568 to deal with this. In this new pull request I left the code which Jeanne seemed to feel was important.

I placed a DEPRECATED banner with a LINK to the current WCAG3 draft.

PLEASE expedite this. The code in this OBSOLETE document was NEVER intended for public consumption.

Thank you

Andy

Myndex commented 1 year ago

Update regarding color spaces

APCA-W3 has several modules to calculate estimated screen luminance and subsequent Lc (lightness contrast) for sRGB, Display P3, and Adobe98. Adding additional spaces is simply a matter of adding a module with the appropriate coefficients.

The repo is: github.com/Myndex/apca-w3

And it is published via npm: npm i apca-w3

The APCA discussion forum is: github.com/Myndex/SAPC-APCA/discussions

Display vs Imaginary Color Spaces

Under CSS 4/5, sRGB will remain the default color space for the web, and For sometime to come. This Is important for accessibility purposes, as characteristics of sRGB Make it "best suited" for accessibility.

Adobe98 color space is also similar to sRGB in accessiblity, as it has the same red primary as sRGB, which protanopia sees as ~50% darker. As for other physical display color spaces, the Display P3 space is a little less accessible (protans see that red primary even darker), and with the UHD Rec 2020/2100 space, protans may not see the red primary at all.

The protan compensator extension will be added to the public beta APCA by end of 2023, this will improve accessibility for all physical display spaces.

For guideline purposes, it is most important to meet the guidelines relative to an sRGB display, as that is the standard default. These guidelines are not yet set in stone, But in my personal opinion it is best to anchor visual contrast to physical display color spaces.

Imaginary color spaces like ProPhoto, ACES, etc, have to go through gamut mapping to a physical display color space before they can be displayed. Contrast calculation should be done after gamut mapping to a physical display color space.