Google Chromeās Color Contrast Debugger
As a web developer and person working on accessibility tools full time, this win provides a lot of satisfaction: Chrome Canaryās developer tools have an experiment where you can debug color contrast right in the style inspector. For a given foreground color, clicking on it in the inspector now shows how it relates to WCAG AA contrast ratios. You can also expand it to show the AAA ratio from inside the color picker.
By meeting these ratios, users with low vision or difficulty seeing color will have a higher likelihood of being able to use your sites! Color contrast is also the #1 accessibility fail on the web. So this tool is very close to my heart!
I was a little thrown off by inherited background colors at first; especially for user-agent styles like the default link color, where no color style is shown (but I'm an edge case weirdoāmost people would provide a CSS color). The color picker shows a gradient of the two colors with the background indiciated as a circle icon; a visible hexadecimal or RGB value probably would have helped me understand it quicker. But there's also an interactive color picker you can change on the fly to adjust the ratio, which is a killer feature.
We do a lot of work to test color contrast in the axe-core library and browser extensions, and I know that it isnāt easy to deal with all the edge cases. But hopefully in a privileged browser context they can utilize processes for painting the screen according to CSS in a performant way. Chrome's contrast devtool will be a great complement to the aXe extensions, or aXe in Lighthouse.
To enable the experiment, download the Chrome Canary browser, a bleeding-edge version of Google Chrome. Open the developer tools, go to the Settings, and click on Experiments. If you donāt see an option for a color contrast ratio line, press shift six timesĀ and the option will appear. Enable the checkbox and close the settings. Now you know the secret devtools experiment handshake, congratulations!