WebAIM - Web Accessibility In Mind

E-mail List Archives

Re: Colour contrast measurement techniques

for

From: Steve Green
Date: Feb 17, 2023 3:54PM


Thanks Patrick. I now use the same process as you. However, I suspect that a lot of people don't.

If the intention of the success criterion is that we are supposed to use the author specified colour, I would say that it totally fails to convey that. In fact, the normative text starts with "The visual presentation of text...", which could easily be interpreted as meaning the rendered appearance.

Steve


-----Original Message-----
From: WebAIM-Forum < <EMAIL REMOVED> > On Behalf Of Patrick H. Lauke
Sent: 17 February 2023 22:37
To: <EMAIL REMOVED>
Subject: Re: [WebAIM] Colour contrast measurement techniques

On 17/02/2023 22:23, Steve Green wrote:
> The Understanding page for WCAG SC 1.4.3 contains a note that says "Because authors do not have control over user settings as to how text is rendered (for example font smoothing or anti-aliasing), the contrast ratio for text CAN be evaluated with anti-aliasing turned off."
>
> It says CAN rather than MUST, so there is no "right" way to make the measurement.

I believe that what that sentence is getting as is that this is a possible way that can help an auditor test this SC...specifically to make it easier to use something like a color picker to see the unadulterated, not-anti-aliased color (instead of diving into the CSS to see what the color is). A long-winded way to say that antialiasing is not taken into account for the normative requirement (because it varies by user agent, platform, user settings).

> For many years I used to measure the rendered colour, but I now record the author specified colour. To a large extent that is because anti-aliasing varies across browsers and operating systems and also because the colour you pick is highly arbitrary. If you pick one colour and someone else (usually the developer) picks another colour that gives a different pass/fail result, who is right?

You go by what's defined in the CSS.

> I would be interested to hear how everyone makes the measurement to see if there is any sort of consensus. Do you use the author specified colour? Or pick a colour that approximates to how you perceive the overall colour to be? Or zoom the text so it is no longer anti-aliased? Or something else? What if none of the pixels approximate to how you perceive the overall colour to be?

I usually zoom up the page a bit then use a color picker, but often cross-check back in the CSS when I get results that are just on the cusp
(4.48:1 or something). And obviously I need to jump into devtools anyway in cases where the text *might* be classed as large text, to see what the exact computer font-weight and font-size are.

> There are some unusual cases where you probably have to measure the rendered colour, such as when text is viewed through a translucent layer, but I am mostly interested in the ordinary measurements we make every day.

The fact that what counts is the declared value in CSS is possibly not explicitly clear in the understanding. I might add something to this to that effect ... https://github.com/w3c/wcag/pull/3020

P
--
Patrick H. Lauke

https://www.splintered.co.uk/ | https://github.com/patrickhlauke
https://flickr.com/photos/redux/ | https://www.deviantart.com/redux
twitter: @patrick_h_lauke | skype: patrick_h_lauke