Equal Access: Automated accessibility checker for web projects
github.com
github.com
A pet peeve of mine is that "red on white" is considered bad while being, in fact, perfectly legible:
> Element has insufficient color contrast of 3.99 (foreground color: #ff0000, background color: #ffffff, font size: 9.4pt (12.6px), font weight: normal). Expected contrast ratio of 4.5:1
I think whatever algorithm is used to determine contrast is deeply flawed for some colour combinations.
I remember reading an article here on HN about how luminance (or luminosity?) varied in a way that wasn't easily discernible by inspecting the RGB components of a colour and how there was a different (much harder) algorithm which instead ensured luminosity could be taken into account when picking colours for a site.
I'd wish accessibility tests used _that_ instead of taking the easy way out and using known-flawed RGB checks.
Personally I don't find pure red on white very readable, but I have noticed some oddities such as pure black on orange (#ff6a00) passing the check while pure white on orange fails, despite being much more readable to my eye.
i.e. #ff0000 on #ffffff
There are different forms of colour blindness - I have the red-green type (though can't correctly identify many colours), but I don't think it should make any difference for this.
When I get my eyes tested at the opticians, one of the tests is usually looking at a red ring and a green ring against a white background and telling the optician which ring seems clearer. I think it's something to do with long/short sightedness? I'm shortsighted so the red ring is always clearer to me without glasses, and trying to read green writing on a whiteboard can be more difficult.
Also, a related HN discussion: https://news.ycombinator.com/item?id=21357638
As somebody has already pointed color contrast is defined by a relative luminosity calculation defined by W3C.
Ensuring that websites are accessible is important work. I used to work at a company where the CTO personally dedicated several sprints to refactoring the display layer code to better support screen readers. From what I remember, it was a bit of a tedious process, but nonetheless one appreciated by all of their customers who had disabled staff.
Tools like this could save a lot of time and make the web more accessible.
(IIRC, it's also integrated in Webhint and Google's Lighthouse.)
Obviously, it doesn't have to be live. You can deploy to test.example.com and try it out there, but I think that's too late.
Easily detectable poor accessibility should be as much of a closed gate as having the layout go all wonky and the words all in the wrong place.
Ideally, it should be runnable on your local copy as you are writing it, just the same as viewing the page in a browser.
This code from IBM uses their own accessibility checklist, I'll be interested to see how it compares to axe-core.
The tools provide checking for WCAG 2.0 AA, WCAG 2.1 AA and the IBM checklist. The IBM checklist is basically WCAG 2.1 AA, but has some more strict requirements for defining landmarks for screen reader navigation.