Created
February 20, 2015 03:23
-
-
Save JamesSkemp/4d36c0b37fe0a8b3fa0b to your computer and use it in GitHub Desktop.
Parse a standard or hex color in Java.
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
// Thanks to OpenGL ES 2 for Android by Kevin Brothaler | |
float red = Color.red(Color.GREEN) / 255f; | |
float green = Color.green(Color.GREEN) / 255f; | |
float blue = Color.blue(Color.GREEN) / 255f; | |
int parsedColor = Color.parseColor("#0099CC"); | |
float red = Color.red(parsedColor) / 255f; | |
float green = Color.green(parsedColor) / 255f; | |
float blue = Color.blue(parsedColor) / 255f; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment