When I audited all 38 pages of our site for accessibility a few weeks ago, the contrast section counted elements: 546 links at 2.53:1, a focus ring at 1.82:1. That is how every tool I know of reports it, including the ones built into the browser. An element is a row, and a row is a row whether it holds one word or two hundred.
That bothered me, because a reader does not read elements. So I ran it again weighted by character.
Method
Playwright, the 38 URLs in our sitemap , and a walk over every text node in the body. For each node I took the computed color of its parent, then climbed the tree until I found an ancestor with a background whose alpha is over 0.5, which is the colour the text is actually drawn on rather than the one I assumed it was on.…