Created
July 26, 2017 19:51
-
-
Save igalata/22916f68888dc2e2c7f37f7141d1fb31 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
fun Int.rgba(context: Context) = ContextCompat.getColor(context, this).rgba() | |
fun Int.rgba(): Vec4 = Vec4( | |
Color.red(this).toFloat() / 256f, | |
Color.green(this).toFloat() / 256f, | |
Color.blue(this).toFloat() / 256f, | |
Color.alpha(this).toFloat() / 256f) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment