Created
July 6, 2016 09:32
-
-
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
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
.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