Skip to content

Instantly share code, notes, and snippets.

@LegitDongo
Created May 12, 2017 20:31
Show Gist options
  • Save LegitDongo/f3a24c1e8770eb497f2adc62278147ad to your computer and use it in GitHub Desktop.
Save LegitDongo/f3a24c1e8770eb497f2adc62278147ad to your computer and use it in GitHub Desktop.
Basic tint on RGB values in SASS using the power of math!
@function tint($r,$g,$b,$tint: .5) {
@return rgb(
$tint*$r + (1-$tint)*255,
$tint*$g + (1-$tint)*255,
$tint*$b + (1-$tint)*255
);
}
//using
a{
color: tint(0, 0, 255, 0.5);
}
//evaluates to
a{
color: #0808ff;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment