Last active
June 7, 2019 17:38
-
-
Save nhall/7e2979d04ad20238b493852a4b8d7c9c to your computer and use it in GitHub Desktop.
Automating contrast accessibility
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin accessible-color($color: #000) { | |
$red: red($color); | |
$green: green($color); | |
$blue: blue($color); | |
color: rgb( | |
(((($red * 299) + ($blue * 114) + ($green * 587)) - 128000) * -1000), | |
(((($red * 299) + ($blue * 114) + ($green * 587)) - 128000) * -1000), | |
(((($red * 299) + ($blue * 114) + ($green * 587)) - 128000) * -1000) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment