Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GENERATE SAFE TEXT COLORS WITH SASS
$lightness-bound : 70 !global;
$hue-bound-bottom : 40 !global;
$hue-bound-top : 200 !global;
@function checkDangerZone($color) {
@if ( (lightness($color) > $lightness-bound) or (hue($color) > $hue-bound-bottom and hue($color) < $hue-bound-top )) {
@return darken(desaturate($color, 70), 60);
}
@else {
@return lighten(desaturate($color, 50), 60);
}
}
@joshmedeski

This comment has been minimized.

Copy link
Owner Author

@joshmedeski joshmedeski commented Feb 19, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment