Lc Value vs Simple Ratio •• AND •• Bridge-PCA #42
Replies: 1 comment 3 replies
-
Thanks @Myndex , I will come back to this more, but four notes-to-self kinds of things. These are all just my personal opinions, and and I am not speaking for USAB or AG WG. (1) Keep in mind that a should/shall/may approach is actually counter-productive in the context of crafting 2.x SC phrasing. It is good for a11y guidance and for discussing things generally, and fits WCAG3. (2) That said, as a plug-and-play replacement for 1.4.3, this seems very promising to me:
(3) Does Lc 75 permits both white and black on a certain hues? (I think so.) Could you please write up something more about that? White and black on orange is a good example. Is there a blue? How about a green? From lack of experience, I don't have an intuitive feeling for the range of hues where Lc75 is possible for both white and black text. Your have provided many of these kinds of samples, but I would like to have a page or discussion thread just for this three-color challenge. My understanding is that Lc 75 white and black on any middle gray is not possible, so please clarify that. Not having a middle gray that supports Lc 75 (for both black and white text) is probably not a blocker to adoption. Historically, that 2.x 4.5:1 allowed for black (and white) on a middle gray was important to its early adoption and acceptance. But the contrast (for black on those middle grays) is quite apparently not great, so it is very good to have a better algorithm. WebAIM link example: white and black on gray 2.x 4.5:1 allows a very limited range where this works. Some hues are possible, but really they are fairly characterized as all being a middle gray. (4) I perceive a need to figure out how to get some real-world testing by end-users with Retinitis Pigmentosa and Lc75 reds and oranges. I have some ideas of where to start asking, and I plan to make an inquiries in 2022, but before that, I would like to have more confidence that Lc 75 is the value which should be subject to particular scrutiny. |
Beta Was this translation helpful? Give feedback.
-
Hi Bruce! @bruce-usab
Let me explain briefly (well as briefly as I... um... well... okay.... let me... explain)
Bridge-PCA
First, let me introduce you to Bridge-PCA — this is a 100% backwards compatible replacement of the WCAG_2 contrast math. By 100% I mean that if you pass Bridge-PCA you automagically pass WCAG_2 (using the same fonts as WCAG_2). To emphasize:
if you pass Bridge-PCA you automatically pass WCAG_2
Weeee! But there is no free lunch. To be backwards compatible, the contrasts have to be forced higher than technically needed when using the full APCA and font lookup table. The trade offs are "easy to use" vs "most flexible for design". I can make the conformance as easy to use as WCAG2, or more functionally flexible, as what I've shown for APCA.
I explain this more completely below, now to answer your main question:
The "exceeds" vs "sort of like" thing
Sooooo.... Trying to keep this brief. How does Lc 60 relate to 4.5:1 or 3:1...
The "perceptual middle" grey has traditionally been considered 18% (18% grey card), but like all of this, the reality is more complicated. In sRGB, 18% is about #777 ... and this is also what WCAG_2 math considers middle contrast.
And while it is easy to assume that "middle grey" would also be middle contrast, well....
...nope.
Middle contrast shifts around based on a pile of the usual psychophysical factors.
On a typical monitor, and depending on spatial frequency, the perceptual middle tends to be around
#999
to#AAA
, as dark as ~#888
and as light as ~#bbb
depending on stimulus size, ambient, etc.#a0a0a0
is a good "rule of thumb" middle between black and white text, if you want a place to flip from white text to black text based on the BG. For proof of this I made a CodePen:Fancy Font Flipping
Great, so what about APCA vs WCAG2?
As we know, WCAG_2 is centered on old technology and uses a simple linear ratio that does not follow human perception. For any given contrast value, for the highest actual perceived contrast, the lightest color must be white #fff. As the lightest color gets darker, the 1.4.3 contrast math is increasingly inaccurate relative to how we see.
APCA is perceptually uniform for a given contrast value across the available range, with a very slight boost in very dark colors, there to assist with misadjusted monitors, flare, and other issues.
There are two ways to compare WCAG_2 Ratio vs APCA Lc:
What Lc value meets or exceeds the max WCAG_2 contrast for a given ratio, OR
What Lc value is functionally equivalent to a useable WCAG_2 ratio.
"Exceeds WCAG_2" This is "Bridge-PCA"
"Functionally Equivalent" This is "APCA for W3"
Lc 60 Exceeds WCAG 3:1
Lc 75 Exceeds WCAG 4.5:1
Lc 90 Exceeds WCAG 7:1
The "exceeds" set exceeds WCAG_2 over the entire range. So much so the AA set is able to relax slightly for darker colors, but still superior to 1.4.3. The AAA set is superior to 1.4.6
The Functionally Equivalent values are based on a narrow range with a center color ~ #9e9e9e (per the G-4g scaling) or luminance ~34Y to ~42Y. Outside of this very narrow range only APCA remains perceptually accurate, the old method does not. The following table demonstrates the "Functionally Equivalent" relationships.
"Engineered on Purpose" 😁
The SAPC math was engineered to put the key values at the easy to remember levels of Lc 15 30 45 60 75 90 etc.
I specifically wanted Lc 45, Lc 60, Lc 75 to line up at some point with WCAG 2.x's 3:1, 4.5:1, and 7:1 to be able to say that "Lc 60 is about like the old 4.5:1" to help in moving toward this new guideline.
Because APCA is perceptually uniform within reasonable tolerances, a change by a certain Lc amount has a similar perceptual change regardless of the present value (except of course when one of the colors is clipped at #000 or #fff). In the current scaling, increasing contrast by adding Lc 15 is approximately equivalent to the contrast change of a 400 weight font to a 700 weight font, when the font is smaller than about 32px.
The G Series exponents demonstrate that the old WCAG2 spec is completely out-of-line with perception. Darker color pairs that WCAG2 incorrectly passes will fail under APCA, and light text on dark backgrounds that WCAG incorrectly fails will correctly pass under APCA. Ultimately, APCA will provide 50%+ more colors, and do so correctly per use cases and spatial frequency.
CONFORMANCE INFO ON THE BRIDGE-PCA VERSION
Bridge to the Advanced Perceptual Contrast Algorithm
Current Version: 0.1.0 4g (w3) betafish
Bridge PCA is a contrast assessment method based on APCA & SAPC technology for predicting the perceived contrast between sRGB colors on a computer monitor. It has been developed as an assessment method to facilitate better readability while maintaining backwards compatibility with WCAG_2 contrast (1.4.3) accessibility standards relating to content for computer displays and mobile devices. The intention is to improve readability and understandability of content.
WCAG_2 Bridge-PCA Font Use
Large Font: 24px normal weight or 18.7px bold, or larger.
Thin Font: 300 weight.
AA
SHOULD
SHALL
MAY
AAA
SHOULD
SHALL
MAY
Unlike the main APCA, BridgePCA is all about "emulating" WCAG_2 contrast. So, BridgePCA is a like-for-like replacement of the quirky WCAG_2 contrast math.
Like APCA, BridgePCA reports results as Lc (Lightness Contrast), and it's super easy to convert to WCAG_2 ratios:
DIFFERENCES: for best results, send the text color to the text input of the tool. Bridge PCA is "polarity sensitive," even though WCAG_2 is not. For light text on a dark background, the result will have an R for "reverse" after the LC value. N means "normal".
No Free Lunch: while BridgePCA corrects the many false passes and improves readability, the cost is that there is reduced design flexibility due to the fact that to maintain backwards compatibility, some contrasts are forced higher than they actually need be.
BridgePCA has some minor internal adjustments to align with some of the more incorrect aspects of WCAG_2 contrast math. In order to be backwards compatible, BridgePCA will not forgive the false-fails of WCAG_2, but BridgePCA will correct the many false passes which vastly improves readability.
But if you need a standards compliant method that also improves readability this is it. If on the other hand you do not need to abide by the letter of any particular standard, you may want to consider the more flexible full APCA solution.
Thankyou
Andy
Beta Was this translation helpful? Give feedback.
All reactions