Re: [csswg-drafts] [css-color-6] color-contrast() should take transparency into account (#7358)

> _not sure what you are proposing._

Hi Lea @LeaVerou

Yes, it's been brought to my attention that I'm not generally well understood here. My prolixity has the better of me, I suppose I should attend law school....


I was not proposing anything _specific_ per se, just opening the conversation into something important, at least in terms of accessibility.


## _Undefined color is a fail in WCAG 2_
It also fails APCA-RG¹ and I should expect that it will fail the future WCAG_3.

>  ..._it needs to do something reasonable with transparency_...

I agree, and that was **the point of my post**. It needs to do something _reasonable_. To me, reasonable means that a there are constraints that prevent certain edge cases, and also prevent common cases that result in ambiguous or undefined colors.

So this means error handling.

To me, an error should default in the direction of accessibility, itch probably means that in the case of an error, that it spits out a solid, opaque color as the fallback for the given text. Nevertheless we have to recognize that this could create its own separate accessibility issue if it covers an element that is needed for interaction for instance.


### _shhh... a tangent approaches_
The remainder of this post maybe tangential to this _specific thread_ but generally does relate to an issue I've seen in several threads for the `color-contrast()` function.


> _...Feel free to do all the advocacy you want..._

OK, I that case....  I was going to put this in a different thread, but as I'm not sure which thread would be most appropriate, I'll just make it this one. Here we go:


## _Legally_, Eagles see very well

And people don't. Median vision internationally is 20/40. 

Part of the genesis of my post above **is the legal issue**, because I'm seeing in some of the IRC logs, a general sentiment of _"you need WCAG2 because it's 'legal' and APCA is 'not'"_, which echos rumblings of that rumor-campaign asserted by a small-cult-of-trolls which I try to ignore as much as possible. 

So I'll just briefly mention that **APCA is stricter than WCAG 2 in terms of "actual accessibility"**, and as far as the very few colors that are not backwards compatible because APCA passes a few that WCAG2 fails, WCAG2's false fails are **harmful to accessibility** for people with color vision deficiency<sup>3,8</sup>. 

Also, here's the TL;DR: if people are worried about which algorithm is in there for "legal reasons", then they ought to be worried about how an ambiguous color due to a transparent background is going to affect the legality of their site as well. Because in this later case, it could actually make a site _**functionally inaccessible**_, and functional inaccessibility is the bright-line that lawsuits are based on.


### _Actual_ accessibility is what is legal
In almost² all contexts and almost² all jurisdictions, _actual_ accessibility is the stated goal more-so than arbitrary values. And this is definitely true in the United States where the **majority of rules/regs relate to ADA** compliance, _not WCAG2_ (except in some narrow areas).

I'm not even going to get into the fact that _WCAG&nbsp;2 **contrast**_ is **_not_** empirically tested, was **_objected to_** by stakeholders back in 2007 including IBM, and also was never subject to any formal **_peer-review_**. WCAG&nbsp;2 cites cherry-picked [obsolete³](https://gist.github.com/Myndex/1dadb6dcac596f1cd7a5686a076f697f) standards that referred to obsolete [technology⁴](https://tangledweb.xyz/a-contrast-of-errors-373c2665d42a), and further [review⁵](https://gist.github.com/Myndex/069a4079b0de2930e72d5401bde9af98#wcag-2-vs-apca-contrast-shootout) of the [documents ⁶](https://github.com/w3c/wcag/issues/1705#issuecomment-1027058976) and [underlying⁷](https://tangledweb.xyz/hi-roger-f51bde490a56) basis for [justifications⁸](https://tangledweb.xyz/whats-red-black-also-not-read-573b9c0a97ed) leading to unintended [consequences⁹](https://tangledweb.xyz/please-stop-using-grey-text-3d3e71acfca8), are less than one would hope for a "standard" shoved into "law"... Nevertheless the few narrow regulatory areas it _is_ in typically have exceptions.

As an example, the US Access Board 508 regulation defines the use of WCAG 2.0 (not 2.1) A and AA, but 508 just applies to US _government_ related agencies, and also has two additional, substantial exceptions:

**1)** Does not have to conform if there is no commercially viable alternative that does conform.

**2)** WCAG_2 methods do not have to be used if _alternate methods_ are used that meet or improve the goals of accessibility.

-----
Again I'm going to make the following statement: **APCA is stricter than WCAG&nbsp;2** [3](https://gist.github.com/Myndex/1dadb6dcac596f1cd7a5686a076f697f) in the ways and use cases that are important for readability. Quite literally, the places where APCA might pass a color pair where WCAG&nbsp;2 would incorrectly reject (which is the _only reason_ it's not backwards compatible) happen to be in those areas where **WCAG&nbsp;2 creates conditions that are _harmful_ to readability**, _especially_ for people with color vision deficiency (primarily protanopia, WCAG&nbsp;2 create a condition where it rejects colors that would be good for protanopia and passes related colors that are very bad for protanopia).[8](https://tangledweb.xyz/whats-red-black-also-not-read-573b9c0a97ed) 

And if somebody is really concerned about also "hitting the arbitrary numbers", but they want **_actual accessibility_** they can use BridgePCA which artificially rejects colors (that are potentially usable) to maintain backward compatibility.

-----

## WCAG the Dog
Most nations with a regulation where WCAG2 is mentioned/defined, apply mainly or solely to that government's own sites. In Australia they extended it to more, but only for 2.0 level **A**, and level A doesn't even cover contrast. 

Federally in the United States, the ADA not specify WCAG_2. It only specifies ["must be accessible"¹⁰](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5433805/#!po=12.8571). But that linked article points out the absurd weakness of the ADA's regulations for visual contrast. This recent 2017 article was written, by the way, by Dr. Arditi, who did some work on WCAG_2 though was [taken out of context⁶](https://github.com/w3c/wcag/issues/1705#issuecomment-1027058976) back in 2004/7 and mangled a bit into what became WCAG2 1.4.3. 

_Click to enlarge this (pathetic) sample of an ADA _compliant_ sign (from Dr. Arditi's article⁶)_
<img width="200" alt="an example of a sign that passes ADA yet is pretty much unreadable for many people because it lacks contrast" src="https://user-images.githubusercontent.com/42009457/219830042-75961376-6383-41a5-92c2-8ba3b284ef84.png">

As I think you can recognize in this image, even ADA compliance is an incredibly low bar. APCA stomps all over that.

There was once a Federal lawsuit _(Wynn-Dixie)_ that mentioned WCAG2, however it was **_vacated_** by the 11th Circuit Court of Appeals, and is moot. Nevertheless there _**is**_ a more public regulation in the US, the FAA requires at least 25% of airport kiosks to comply with WCAG_2. _(US airports and airspace is federally regulated.)_

### Automated failures
The recent automated testing by WebAim showed that of a million websites, **86% fail WCAG 2 contrast** in automated testing. But there are not 860,000 lawsuits about it. I discussed some of the [pitfalls of automated testing<sup>11</sup>](https://uxdesign.cc/better-reading-on-the-web-c943c4cfc91a), and the importance of actual accessibility.

Sure, there have been lawsuits regarding accessibility, most in California and New York, as those states have strong laws (i.e. profitable for attorneys) relating to accessibility, but as far as California, they rest on ADA (not WCAG 2). California AB434 _does_ mandate WCAG 2, but only for state government agencies/entities. 

The lawsuits that I have reviewed that have been brought (like Dominoes) have been about functionally inaccessible junk, and cite the ADA. Nevertheless this is certainly a changing environment, and one to be aware of. 

## TL;DR
### If I was a site owner, I would be concerned about being **_actually accessible_** as the proactive way to prevent a lawsuit.

-----
### _Disclaimer and notes_
Despite writing a column on constitutional law some decades ago, **I am not an attorney and nothing listed in this post should be construed as legal advice. Your mileage may vary, void where prohibited, caveat emptor, opinions are stated as persona pro se.**
#### As a sidenote, _I love the law_
And had I not lost my eyesight when I did, I might be an attorney now, as circa 2012 I was planning (or at least considering) law school<sup>12</sup>, reading LSAT practice tests, and about to take the **LSAT** to see how much of a scholarship I would qualify for, when I found that I couldn't read the small legal-print in page-footnotes—my journey into low vision started at that point with the rapid-onset cataracts taking hold. 

### _So there's that._

Since that brings up the subject, if I don't repeat this advice often enough, to anyone reading, **always wear UV protective eyewear, take frequent breaks from the computer, and use natural tears eyedrops**, I happen to like Systane myself.

And **_never_** use steroidal nasal inhalers, no matter how bad your allergies might be. Tell your doctor no. I could make that into a slogan: _"Carry Kleenex instead or go blind"_... 😳



Thank you for reading.

_Footnotes_
- Note¹ _APCA-RG is APCA Readability Guidelines, which are developing independently, with a different scope, and **separate** from WCAG&nbsp;3_.
- Note² _And I say "almost" because it's impossible for me to know the minutia of the laws in all the countries of the world, though I have spent time looking. It is up to everyone to know the laws of their land as they apply to them._
- Notes &nbsp;&nbsp; _[3](https://gist.github.com/Myndex/1dadb6dcac596f1cd7a5686a076f697f) &nbsp;&nbsp;[4](https://tangledweb.xyz/a-contrast-of-errors-373c2665d42a) &nbsp;&nbsp;[5](https://gist.github.com/Myndex/069a4079b0de2930e72d5401bde9af98#wcag-2-vs-apca-contrast-shootout) &nbsp;&nbsp;[6](https://github.com/w3c/wcag/issues/1705#issuecomment-1027058976) &nbsp;&nbsp;[7](https://tangledweb.xyz/hi-roger-f51bde490a56) &nbsp;&nbsp;[8](https://tangledweb.xyz/whats-red-black-also-not-read-573b9c0a97ed) &nbsp;&nbsp;[9](https://tangledweb.xyz/please-stop-using-grey-text-3d3e71acfca8) &nbsp;&nbsp;[11](https://uxdesign.cc/better-reading-on-the-web-c943c4cfc91a)  are self-referential links to gists, articles, or posts written by the author of this post, which nevertheless may have additional references or links to other sources_.
- Note _[10](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC5433805/#!po=12.8571) is Dr. Arditi's article_.
- Note<sup>12</sup> _With my health improving so far this year I'm once again considering a law degree... if I start in the fall, I could pass the bar at age 62... Then I can spend the rest of my life suing the crap out of the pharmaceutical companies that made the steroidal nasal inhalers that I was once prescribed that are almost certainly the reason I developed early-onset cataracts._  ... _**Never give up!**_
- _Bonus note: and yes, the oblique, self-deprecating comment regarding prolixity and law school at the beginning of this post was specifically to provide the foundation for these little Easter eggs at the very end. Congrats on making it all the way through today's post._

-- 
GitHub Notification of comment by Myndex
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7358#issuecomment-1435509538 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Saturday, 18 February 2023 07:13:15 UTC