Re: Color Contrast and Transparency | WCAG 2.1

On 29/07/2016 09:39, Alastair Campbell wrote:
> I guess this is mostly a matter of how it is measured?
>
> So if designer/developer specifies a foreground and/or background
> colour with some transparency, you shouldn’t use the CSS defined
> colour to test contrast without accounting for the transparency. (I
> know transparency is generally defined with the colour, but that
> doesn’t mean a testing tool accounts for it.) If the transparent
> colour of a box (the background for text) is on top of a white
> background it will be lighter than on a black background, which needs
> to be accounted for.

Correct. Assuming it's all flat colors (not over a gradient, or 
background image, or positioned over an actual <img>, etc) I guess you 
calculate the *actual* colors as rendered by the browser. That does 
start to get very tricky for an automated tool to work out though, and 
is prone to false positives/negatives since the tools would generally 
not take into account images etc which might be present and skew the 
results.

> However, if you use a tool with an eye-dropper style mechanism on the
> resulting colours, that should be accurate. Unless I’m missing
> something?

Yes, using an eye-dropper to test the actual final render would work 
(though this can get complicated if the layout potentially changes 
depending on viewport/window size, and semi-transparent elements all of 
a sudden move over other elements...you end up with different 
backgrounds, resulting in different final rendered color).

> The contrast adjuster function in the CSS-color-4 spec looks cool (if
> it’s implemented?), it references WCAG2 1.4.3 so should line up.
>
> Perhaps we need to make G18 more specific about testing the result
> rather than the colour definition?
>
> And perhaps we could create a test page that would pass if
> transparency is not accounted for, but should fail, and check that
> each of the tools listed in G18 accounts for the transparency?
> (Perhaps the browser based ones don’t?)
>
> Cheers,
>
> -Alastair
>


-- 
Patrick H. Lauke

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

Received on Friday, 29 July 2016 08:54:50 UTC