Skip to content

Commit

Permalink
contast ratio level AAA is above 7:1
Browse files Browse the repository at this point in the history
  • Loading branch information
shfshanyue authored and Qix- committed Apr 5, 2022
1 parent 286fb71 commit 406d384
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,9 @@ Color.prototype = {
},

level(color2) {
// https://www.w3.org/TR/WCAG/#contrast-enhanced
const contrastRatio = this.contrast(color2);
if (contrastRatio >= 7.1) {
if (contrastRatio >= 7) {
return 'AAA';
}

Expand Down

0 comments on commit 406d384

Please sign in to comment.