Re: [csswg-drafts] [css-color-5][css-images-4] Are these features ready to ship? (#7310)

Hi Chris and fantasai @svgeesus @fantasai 

@fantasai said:
> > _How unstable is that algorithm itself (as opposed to WCAG 3 in general), and would it make sense to use it anyway?_

APCA is a candidate for WCAG 3 with the ` npm i apca-w3 ` package, but due to concerns over how long WCAG 3 may be, and the pressing need and strong demand for a functional perceptually uniform contrast solution, the scope has expanded. One part of the expansion is the Bridge-PCA, which is fully backward compatible to WCAG 2 contrast, as a literal drop in replacement. 

@svgeesus said
> _That algorithm specifically is very contentious, is [still being frequently modified](https://github.com/Myndex/apca-w3#current-version-014-g-w3-beta), and does not seem to have consensus. People are deploying (various different revisions of) it in the wild._

I would like to address these statements, starting with the objective one, alleging frequent modification.

## Stability
The rumor or claim that the APCA algorithm is being "frequently modified" are false.

### *These demurrers claiming _frequent modification_ are not true.*
The math and the base algorithm that generates the L<sup>c</sup> contrast value _**HAS NOT CHANGED**_ in well over a year. 

### *The last change to the constants and exponents was February 15th 2021*
And it was a subtle change from the constants in use when the WCAG 3 FPWD was released in January 2021.

```javascript
                          // 0.98G-4g base version constants 02/15/2021:
    exponents =  { mainTRC: 2.4,    normBG: 0.56,       normTXT: 0.57,  revTXT: 0.62,  revBG: 0.65,};
    colorSpace = { sRco: 0.2126729, sGco: 0.7151522,    sBco: 0.0721750,};
    clamps =     { blkThrs: 0.022,  blkClmp: 1.414,     loClip: 0.1,    deltaYmin: 0.0005,};
    scalers =    { scaleBoW: 1.14,  loBoWoffset: 0.027, 
                   scaleWoB: 1.14,  loWoBoffset: 0.027, outFactor: 100.0,};
```

_Click to Enlarge_     
<img width="300" alt="the math for the basic APCA" src="https://raw.githubusercontent.com/Myndex/apca-w3/master/images/APCAcontrastPredictionEquation0.0.98G-4g-base.svg">

The "changes" in the link you posted to are **_NOT_** the algorithm, they related to separate UTILITIES such as for color string parsing or doing alpha blending. Those are supporting functions for developers to assist with integration into tools. 

That repo, the apca-w3, was setup when I published it as an npm package, again to make integration easier for developers. It is a library of tools, but the main, contrast math, never changed, and I don't know why you'd have that impression, other than the three internet trolls that have been harassing me. But please don't listen to rumors by uninformed trolls.

One of the "changes" at the request of some developers, was simply to take the string parsing and put it in its own package, such that the APCA package was only the specific items unique to APCA, that's now in a package called colorparsley. The extent of these changes was to take the stable algorithm and publish on npm.

```javascript
npm i apca-w3
npm i colorparsley
npm i bridge-pca
```

### _Font Lookup Tho_
The font lookup table(s) are separate, and part of Silver/Gold conformance guidelines, they are _not_ the APCAlgorithm. And regardless, last year we developed a simplified conformance model to make things work "more like" WCAG 2, and it does not involve a lookup table, just a few levels:

- <b>L<sup>c</sup>90</b> • Preferred level body text, similar to ISO 10:1
- <b>L<sup>c</sup>75</b> •  Minimum level for body text, "Sort of" like the old WCAG 7:1.
- <b>L<sup>c</sup>60</b> • Minimum level for readable _content_ text, "Sort of" like 4.5:1.
- <b>L<sup>c</sup>45</b> • Minimum level for large (36px+) such as headlines. "Sort of" like 3:1.
- <b>L<sup>c</sup>30</b> • The absolute minimum for non-content text (such as disabled). 

There is a lot of discussion regarding conformance for WCAG 3, but that is not related to the APCA _algorithm_, rather, it is to things like "levels," or minimum font size — but that does not impact the readability contrast model that is APCA. 


## Contentious Consensus
> _...That algorithm specifically is very contentious ....does not seem to have consensus..._

What makes you say this? The three trolls that have been harassing me personally have attempted to spread rumors, I'd hope that such unsupported derision would be ignored. I have never heard anything reported as an actionable or functional fault. I'm not going to get into the chain of drama, but do extend the offer of a zoom chat to answer any such questions.

I do search regularly to unearth issues or complaints—the GitHub repo has been open since Sept. 2019, and early concerns have been addressed or adjusted for. Today, there has been significant growth and interest, including active development and integration into tools (the downside of which I'll get to in a moment).

There have been several positive peer or third party review articles — I have yet to find a negative one, but please let me know if there is an actual reservation in terms of the functioning or use of the method.

As you know this started with "thread 695" over three years ago and we worked very hard for two years in the visual contrast subgroup to develop a robust solution based on solid vision and readability science, and I've been plainly open about this, with the white papers and other documentation. Because it's been over an extended period, I realize that the information was not as ideally organized, so recently I created a catalog page of resources, articles, and documentation:

### [_git.myndex.com_](https://git.myndex.com)

But to be very concise about it:

The algorithm evolved from established peer reviewed science: CIELAB, CIELUV, Fairchild's R-Lab, the Hunt model, CIECAM02, and the P.Barten contrast model, and also referencing Stevens, and plus the work of Maureen Stone (PARC, NIST), and Larry Ahrend (NASA).

The readability side of things (font lookup, levels, conformance guidelines) all come from Bailey/Lovie-Kitchin's readability research, and also G. Legge. I discuss this and the relationships to critical contrast and critical size in [this thread](https://github.com/Myndex/SAPC-APCA/discussions/39) on use cases and conformance models.


## Errant Versions
> _People are deploying (various different revisions of) it in the wild_

This is annoying, and partly the fault of some Silver draft links persisting without indication that they are deprecated—another part of what appears to be some level of intentional obstructionism. I've been proactive in chasing these down, and working with developers. But I would love to hear about any tools claiming to be APCA compliant and not implementing it correctly.

This is the reason I set the time limited license, as a temporary measure to reign this nonsense in—but that has consequences, as it raised (unwarranted) concerns about the openSource future of it all.

### _WHAT HAPPENED_
The thing is Chris, APCA exploded in popularity in a way that completely caught me off guard. And it was its growing popularity that give rise to the "contentiousness"... apparently one author reviewing it told people they should "use it now" and to be absolutely clear, I had nothing to with with that statement. Nevertheless, people are tired of using something that does not work. And it's worse today, with the increasing popularity of Dark Mode, as WCAG 2 contrast math can not calculate for dark mode.

The "contentiousness" you may be referring to is the concerns over early adopters and rapidly growing popularity, which might answer your comment regarding consensus.

And I do have actions being taken to alleviate any concerns—hopefully having the main paper I've been working on published in the fall (ish) will resolve some of these questions.

Thank you for reading

Andy



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


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

Received on Friday, 3 June 2022 09:25:41 UTC