Last active
December 15, 2015 22:19
-
-
Save RyanRoberts/5332692 to your computer and use it in GitHub Desktop.
Colour Palette Function based on Stuart Robson's Mixin http://alwaystwisted.com/post.php?s=2013-04-07-sassifaction-in-colour-palette-mixins
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 colorize($color, $change: n) { | |
@if $change == l1 { | |
@return tint($color, 10%); | |
} | |
@else if $change == l2 { | |
@return tint($color, 25%); | |
} | |
@else if $change == l3 { | |
@return tint($color, 50%); | |
} | |
@else if $change == l4 { | |
@return tint($color, 75%); | |
} | |
@else if $change == d1 { | |
@return shade($color, 10%); | |
} | |
@else if $change == d2 { | |
@return shade($color, 25%); | |
} | |
@else if $change == d3 { | |
@return shade($color, 50%); | |
} | |
@else if $change == d4 { | |
@return shade($color, 75%); | |
} | |
@else { | |
@return ($color) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
SCSS usage:
body {
color: colorize($baseColor,l4);
background: colorize(#fff,d2);
border: 1px solid colorize($borderColor,d3);
}