Created
April 22, 2018 16:27
-
-
Save jonnykates/5e2212f066d6b3d04fa9006d808edc52 to your computer and use it in GitHub Desktop.
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 colour-difference($foreground, $background) { | |
$r: (max(red($foreground), red($background))) - (min(red($foreground), red($background))); | |
$g: (max(green($foreground), green($background))) - (min(green($foreground), green($background))); | |
$b: (max(blue($foreground), blue($background))) - (min(blue($foreground), blue($background))); | |
$sum-rgb: $r + $g + $b; | |
@if $sum-rgb < 500 { | |
@return "false"; | |
} @else { | |
@return "true"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment