Last active
December 7, 2015 03:47
-
-
Save subinkrishna/1a405ab8c707dbdccf1c 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
| /** | |
| * Returns new color with alpha applied. | |
| * | |
| * @param color | |
| * @param alpha | |
| * @return | |
| */ | |
| public static int getColorWithAlpha(@ColorInt int color, | |
| @FloatRange(from=0.0, to=1.0) float alpha) { | |
| return (int) (0xFF * alpha) << 24 | color & 0xFFFFFF; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment