Skip to content

Instantly share code, notes, and snippets.

@nimbupani
Created February 18, 2012 16:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nimbupani/1860128 to your computer and use it in GitHub Desktop.
Save nimbupani/1860128 to your computer and use it in GitHub Desktop.
Fake color overlay on an image with gradients
// Use @include colorize('image.png', red, 0.5)
@mixin colorize($image, $color, $opacity) {
background: $color;
$color: transparentize($color, 1 - $opacity);
background: -webkit-linear-gradient(left, $color, $color), url($image);
background: -moz-linear-gradient(left, $color, $color), url($image);
background: -ms-linear-gradient(left, $color, $color), url($image);
background: -o-linear-gradient(left, $color, $color), url($image);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment