Page 1 of 1

Enhancement suggestion: Color Calculator

Posted: Sat Nov 30, 2019 10:11 am
by BfzPL
Hello Albert and all Validator friends together!
Since many years the Validator checks the contrast as well as the color-distance
for the foreground-background color-combination having in back the accessibility-
rules for A, AA, and AAA as well as US-508.
Often I get warnings for this class. But to solve these occurrences
I've to go to a website like https://webaim.org/resources/contrastchecker/ or
https://contrastchecker.com/ and try step by step many times to find
the nearest color to fulfill the rule. I know, the searched color may be changed
darker/lighter or in hue - for background or foreground. But normally I've a fix
color (from general style) and want to change only the second component.
So I think, there could be an Validator-integrated Color Calculator (dialog),
where we can (pre-filled colors from error-/warning-message) tell, which part
(fore- or background) we want to fix to which accessibility level. All formulas
are already inside of the Validator.
What is Your opinion about this suggestion of an enhanced Validator?

Best greetings, Thomas

Re: Enhancement suggestion: Color Calculator

Posted: Sat Nov 30, 2019 2:50 pm
by Lou
I like the idea IF this addition doesn't make the validator too "heavy."

Re: Enhancement suggestion: Color Calculator

Posted: Mon Dec 02, 2019 9:45 am
by Albert Wiersch
Hello,

Thank you for the suggestion. The thought of adding something like this has occurred to me before.

I think it would be best if I could just "integrate" with one of the online contrast checkers that already exists.

Perhaps I could add a link to the validator contrast message to the online contrast checker with parameters so the colors are already filled in (assuming the contrast checker allows this)?

Does this sound good?

If so, then what is your preference for the online contrast checker that will be linked to?

Re: Enhancement suggestion: Color Calculator

Posted: Sun Dec 08, 2019 5:54 am
by BfzPL
Hello Albert,
sounds good! It is difficult to me which checker is best. This depends on the kind of accessibility fault: color distance or contrast.
Both named services from above check only the contrast and not for color distance.
As an additional starting point we could share https://github.com/leaverou/contrast-ratio
I for myself prefer WebAIM because it has an API You may integrate instead of calling the browser with a constructed link.
Maybe I'm able to extract all formulas and rules and provide such a service for all Validator friends via my homepage
(so it could be possible to get back the selected/clicked color directly in the document or copy cache to manually insert)...
Thanks a lot and have a good advent time.
Thomas