Created
December 5, 2017 01:24
-
-
Save jordanbrauer/5dd8b7c97c41e210d3321575502ba03f to your computer and use it in GitHub Desktop.
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
// Hexadecimal Alpha Colour function | |
@function hda($hexdec: null, $alpha: 1) | |
{ | |
@if $hexdec == null { | |
// throw error if no value supplied for $hexdec | |
@error "$hexdex cannot be null: was, NULL"; | |
} @else { | |
// evaluate input | |
@if $alpha >= 1 { | |
// return plain hexadecimal value if $alpha is greater than or equal to 1. | |
@return $hexdec; | |
} @else { | |
// otherwise return an rgba value with an alpha value. | |
@return rgba($hexdec, $alpha); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment