DevToys-app / DevToys

A Swiss Army knife for developers.
https://devtoys.app/
MIT License
26.94k stars 1.45k forks source link

Color picker: Contrast ratio not watching alpha channel #875

Open the-programmer opened 1 year ago

the-programmer commented 1 year ago

Current behavior

If you open the color picker and set #FF455A61 as background color and #00FFFFFF as foreground color, the sample text is unreadable.

However the all the WCAG tests show green. That is not expected.

How to reproduce it (as minimally and precisely as possible)

No response

Expected behavior

All the WCAG tests red, once the alpha channel of the foreground get's below ...%.

Note: this could also be a limitation of the WCAG test. In that case, add a note that notifies the user of this limitation. This note should show up once the alpha is anything else than 100% (foreground and background).

Screenshots

No response

Workaround

No response

Affected platforms

Windows

Affected DevToys kind

DevToys (app with GUI)

DevToys Version

Version 1.0.12.0 | X64 | RELEASE | 94bb8213 | 94bb8213

Relevant Assets/Logs

No response

veler commented 1 year ago

Hi, Thank you for this feedback. It's a very good point you're sharing here.

Indeed, the readability of the text depend on the dark/light theme in this case.

image

image

In that case, add a note that notifies the user of this limitation. This note should show up once the alpha is anything else than 100% (foreground and background).

I agree with this. This is a great suggestion. :)

Thank you again!

the-programmer commented 1 year ago

I just had an idea on how to implement this.

Once one of the colors gets an alpha value other than 0xFF, make all the boxes yellow and add the message that this is not supported by the test.