Skip to content

Instantly share code, notes, and snippets.

@jaxxreal
Created July 6, 2016 09:32
Show Gist options
  • Save jaxxreal/1e595b1cf761a8fd648722218337e0fd to your computer and use it in GitHub Desktop.
Save jaxxreal/1e595b1cf761a8fd648722218337e0fd to your computer and use it in GitHub Desktop.
Blending white with another color to get a new color as opacity color
.rgba(@attr, @color, @opacity) {
@c1: #fff;
@c2: @color;
@{attr}: rgb((1 - @opacity) * red(@c1) + @opacity * red(@c2), (1 - @opacity) * green(@c1) + @opacity * green(@c2), (1 - @opacity) * blue(@c1) + @opacity * blue(@c2));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment