Hi Tom,
I just happened upon your site, and read this on the readme:
I (personally, speaking as Tom) have doubts about the universality, accuracy, and application of this particular standard. High contrast is a good value, but I argue that the standard is over-strict and doesn't precisely match human perception.
Regarding WCAG 2.x contrast, you are correct: it is not perceptually uniform nor accurate. And you're not the first to notice. Circa April 2019 I started a thread on W3 WCAG GitHub pointing out that "um... this is the wrong math..." and that any standard dependent on that math is therefore somewhat meaningless.
As a result, this led me to the multi-year research project that created ACPA, the Advanced Perceptual Contrast Algorithm.
APCA is the method we are using for the emerging WCAG 3.0
APCA is perceptually uniform and accurate, processes reverse polarity differently than for normal (dark text on light), and takes into account other psychophysical attributes like spatial frequency (i.e. small thin fonts).
You might be interested in clicking "research mode" at the SAPC live demonstrator site, it has some interactive experiments that demonstrate some of the concepts.
I also saw on your blog post:
Compliance with A should be the first step
Here's a funny thing, there is literally no contrast requirement for A. None whatsoever. And like I said, the issues with WCAG 2 contrast are well known, hence my involvement in creating the fix.
One other thing (the actual issue)
The actual reason I stumbled by was I saw this code listed as a dependency listed as "wcag-contrast 3.0.0" and then saw that it was released about the time we created a first editor's draft of WCAG 3.0, so for a moment I thought you were using the new APCA, but in fact your code is still using the WCAG 2 math.
So.... I am concerned about confusion as WCAG 3 does not use the WCAG 2 method at all. My concern is if someone wants the WCAG contrast and they see yours at version 3.0.0 they might wrongly think that it is the new APCA method, which is incompatible as it is a new science based paradigm.
Here are links to brief comparisons of WCAG 2 and APCA.
Part I:Orange You Wondering About Contrast? Answering some contrast questions, and demonstrating a real solution to the infamous orange conundrum.
Part II:The Lighter Side of Dark Backgrounds An article comparing some parts of APCA with the old WCAG 2 contrast methods.
Part III: WCAG 2 vs APCA Contrast Shootout
Answering some recent questions regarding APCA, and comparisons and examples of the old (WCAG 2 1.4.3) and the new WCAG 3 with APCA.
Thank you!
Andy
Andrew Somers
W3 AGWG Invited Expert
Senior Color Science Researcher
Myndex Perception Research
Inventor of APCA
THE REVOLUTION WILL BE READABLE™