RE: Use of colour

You are misunderstanding what the page is saying. It’s saying that the change of background colour from mid blue to light blue alone would not be conformant. However, that change is redundant because the change of text colour has sufficient contrast.

Focus indicator contrast measurements can be difficult to understand because several success criteria are involved, but one or more may not be relevant depending on the design.

If the focus indication relies on a change of colour of the text and/or background, SC 1.4.1 applies and the change of colour must have a contrast ratio of at least 3:1. SC 1.4.3 (Colour Contrast) applies to the text, but SC 1.4.11 (Non-text Contrast) does not apply.

If the focus indicator is an outline, SC 1.4.1 does not apply, and SC 1.4.11 applies to the adjacent colours. No comparison is made with the original colours. SC 1.4.3 also applies.

Steve Green
Managing Director
Test Partners Ltd


From: Ms J <ms.jflz.woop@gmail.com>
Sent: Thursday, July 13, 2023 1:46 PM
To: bryan rasmussen <rasmussen.bryan@gmail.com>
Cc: w3c-wai-ig@w3.org
Subject: Re: Use of colour

Hi Patrick

Yes, agreed, that is what we tend to do, but the example in the guidelines does say it fails even though the text changes from white to black.


I was wondering if perhaps we would need to do something else like calculate the colour contrast of the text against the background when unfocused and then the text against the background when focused and then somehow compare these two ratios, but I don't think it works like that does it? Because contrast ratios are relative to the colours being used so you can't somehow work out the ratio between two ratios...


But anyway, as long as I have clarified that it's ok to compare the text in isolation for use of colour, and not somehow factor in the background colour change, I am satisfied I'm approaching it right. Thank you!


Sarah

Sent from Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: bryan rasmussen <rasmussen.bryan@gmail.com<mailto:rasmussen.bryan@gmail.com>>
Sent: Thursday, July 13, 2023 1:10:35 PM
To: Ms J <ms.jflz.woop@gmail.com<mailto:ms.jflz.woop@gmail.com>>
Cc: w3c-wai-ig@w3.org<mailto:w3c-wai-ig@w3.org> <w3c-wai-ig@w3.org<mailto:w3c-wai-ig@w3.org>>
Subject: Re: Use of colour

you can find code that will help to automatically set the color of your background or your text colors based on a desired contrast and what your wished for colors are, hard to say specifically as not sure what you are using - I wrote something to do it in 2013 for Sass, but don't have it anymore but it looks like this does the same https://jonnykates.medium.com/automating-colour-contrast-ratios-with-sass-e201f3b52797


there is also a color-contrast function in css, but not really available in anything by developer branches yet.

Hopefully you can just adjust your colors by hand to make the text either 1. slightly bigger 2. darker 3. the background lighter.


On Thu, Jul 13, 2023 at 1:45 PM Ms J <ms.jflz.woop@gmail.com<mailto:ms.jflz.woop@gmail.com>> wrote:
Hi Brian

Just to clarify, I'm looking at the contrast between the black text and the white text to ensure that the difference in hue is sufficient to act as a change in lightness for the use of colour sc.

Please can you advise on how to calculate the difference in contrast between the white text and black text taking the background colour into account. I don't think there's guidance re calculating lightness directly?

Thanks

Sarah

Sent from Outlook for iOS<https://aka.ms/o0ukef>
________________________________
From: bryan rasmussen <rasmussen.bryan@gmail.com<mailto:rasmussen.bryan@gmail.com>>
Sent: Thursday, July 13, 2023 12:40:50 PM
To: Ms J <ms.jflz.woop@gmail.com<mailto:ms.jflz.woop@gmail.com>>
Cc: w3c-wai-ig@w3.org<mailto:w3c-wai-ig@w3.org> <w3c-wai-ig@w3.org<mailto:w3c-wai-ig@w3.org>>
Subject: Re: Use of colour

Yes, the background is important as to whether or not the color has enough contrast, contrast is related to both the color and background it is on.

On Thu, Jul 13, 2023 at 1:29 PM Ms J <ms.jflz.woop@gmail.com<mailto:ms.jflz.woop@gmail.com>> wrote:
Hello

Please can someone advise on use of colour.

I understand a change in hue of at least 3:1 contrast should indicate a sufficient change in lightness.

However, is this dependent on the background colour staying constant? For example, if a focus indicator is a change in text colour from black to white, does that pass use of colour? The example in the screenshot I have attached says it does not pass (from the non-text contrast guideline). The change in text colour if you measure directly, white to black, does exceed 3:1. I would have thought this passed?

Does it matter that the buttons background colour also changes? Does this break the ability to compare the lightness by just comparing the colour contrast ratio and checking it exceeds 3:1?

Thanks

Sarah

Sent from Outlook for iOS<https://aka.ms/o0ukef>

Received on Thursday, 13 July 2023 13:58:43 UTC