Skip to content

Instantly share code, notes, and snippets.

@ogbaoghene
Last active August 29, 2015 14:03
Show Gist options
  • Save ogbaoghene/80379d594d529c86a1e3 to your computer and use it in GitHub Desktop.
Save ogbaoghene/80379d594d529c86a1e3 to your computer and use it in GitHub Desktop.
Returns a tint or shade of a color in increments - 8%, 20%, 50%, or 75%.
@function shade($color, $percent) {
@return mix(black, $color, $percent);
}
@function tint($color, $percent) {
@return mix(white, $color, $percent);
}
@function mono-palette($color, $mix: null) {
@if $mix == tint1 {
@return tint($color, 8%);
} @else if $mix == tint2 {
@return tint($color, 20%);
} @else if $mix == tint3 {
@return tint($color, 50%);
} @else if $mix == tint4 {
@return tint($color, 75%);
} @else if $mix == shade1 {
@return shade($color, 8%);
} @else if $mix == shade2 {
@return shade($color, 20%);
} @else if $mix == shade3 {
@return shade($color, 50%);
} @else if $mix == shade4 {
@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