Utilities » Accessibility Linear color channelLink
Since: 3.2.0 Private New IssueCalculates linear color channel values, for use in accessibility contrast calculations. See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests Based on Sérgio Gomes's accessibility work.
Algorithm, for c in 0 to 255:
f(c) {
c = c / 255;
return c < 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
}
More info: https://medium.com/dev-channel/using-sass-to-automatically-pick-text-colors-4ba7645d2796
_accessibility.scss, line 6
View Source