Skip to content

Instantly share code, notes, and snippets.

@rohanthewiz
Created February 15, 2016 20:41
Show Gist options
  • Save rohanthewiz/daafb522754398a6b728 to your computer and use it in GitHub Desktop.
Save rohanthewiz/daafb522754398a6b728 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$acolor: rgba(#040708, 0.76);
@function rgba_blend($fore, $back) {
$ored: ((1 - alpha($fore)) * red($back) ) + (alpha($fore) * red($fore));
$ogreen: ((1 - alpha($fore)) * green($back) ) + (alpha($fore) * green($fore));
$oblue: ((1 - alpha($fore)) * blue($back) ) + (alpha($fore) * blue($fore));
@return rgb($ored, $ogreen, $oblue);
}
$acolor: rgba(#040708, 0.76); // build a test color with alpha
#a_div {
background-color: rgba_blend($acolor, white);
}
#a_div {
background-color: #404343;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment