addyosmani / a11y

Accessibility audit tooling for the web (beta)
http://addyosmani.github.io/a11y/
Apache License 2.0
1.71k stars 76 forks source link

Contrast ratio test fails on background gradients #67

Open matteobelfiore opened 7 years ago

matteobelfiore commented 7 years ago

When the test runs on pages with a gradient as a background, the background is evaluated as #ffffff. If the text colour happens to be too light —or white as well— the test obviously fails with:

Text elements should have a reasonable contrast ratio

It would probably be a good idea to pick the lightest of the gradient colours and run the test on that one instead, or on each colour separately.