Enhancement suggestion: Color Calculator

For general web development questions that are not specifically related to CSS HTML Validator. This includes (but is not limited to) general HTML, CSS, Accessibility, JavaScript, and SEO questions.
BfzPL
Rank 0 - Newcomer
Posts: 8
Joined: Sun Jul 22, 2018 8:44 am

Enhancement suggestion: Color Calculator

Post 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
User avatar
Lou
Rank V - Professional
Posts: 297
Joined: Fri Jul 29, 2005 5:55 pm
Location: CO

Re: Enhancement suggestion: Color Calculator

Post by Lou »

I like the idea IF this addition doesn't make the validator too "heavy."
Lou
Say what you will about Sisyphus. He always has work.
User avatar
Albert Wiersch
Site Admin
Posts: 3785
Joined: Sat Dec 11, 2004 9:23 am
Location: Near Dallas, TX

Re: Enhancement suggestion: Color Calculator

Post 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?
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
BfzPL
Rank 0 - Newcomer
Posts: 8
Joined: Sun Jul 22, 2018 8:44 am

Re: Enhancement suggestion: Color Calculator

Post 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