-
-
Save FranciscoG/debbe60102859e46be9e to your computer and use it in GitHub Desktop.
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
// source: https://gist.github.com/adunkman/2580972 | |
// background transparency | |
background-transparency(hexColor, alpha = 1) | |
ms-color = argb(hexColor, alpha) | |
background hexToRgb(hexColor) | |
background rgba(hexColor, alpha) | |
.mod-no-rgba & | |
*zoom 1 | |
background transparent | |
filter s('progid:DXImageTransform.Microsoft.gradient(startColorstr=%s,endColorstr=%s)', ms-color, ms-color) | |
&:nth-child(n) | |
filter none | |
// convert a decimal to hex | |
hex(decimal) | |
hex-value = ('0') ('1') ('2') ('3') ('4') ('5') ('6') ('7') ('8') ('9') ('A') ('B') ('C') ('D') ('E') ('F') | |
unquote(hex-value[floor(decimal / 16)] + hex-value[floor(decimal % 16)]) | |
// convert to old 8-digit MS hex value where first 2 digits are the Alpha hex value | |
argb(color, alpha = 1) | |
s('#%s%s', hex(alpha * 255), color) | |
// convert hex colors to RGB | |
hexToRgb(hexColor) | |
s('rgb(%s, %s, %s)', red(hexColor), green(hexColor), blue(hexColor)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment