Created
March 10, 2017 20:00
-
-
Save morningtoast/b09346b98c5de905d5b4c01352672b31 to your computer and use it in GitHub Desktop.
Contrast color function for Foundation 6
This file contains 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
@function get-contrast-color($bgcolor) { | |
$darker-ratio: color-contrast($bgcolor, #000); | |
$lighter-ratio: color-contrast($bgcolor, #fff); | |
@if($darker-ratio > $lighter-ratio){ | |
@return #000; | |
} | |
@if($lighter-ratio > $darker-ratio){ | |
@return #fff; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment