-
-
Save jakebresnehan/2425153 to your computer and use it in GitHub Desktop.
Function for alpha blending
This file contains hidden or 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
// Alpha blending | |
@function blend($bg, $fg) { | |
$r: red($fg) * alpha($fg) + red($bg) * (1 - alpha($fg)); | |
$g: green($fg) * alpha($fg) + green($bg) * (1 - alpha($fg)); | |
$b: blue($fg) * alpha($fg) + blue($bg) * (1 - alpha($fg)); | |
@return rgb($r, $g, $b); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment