I need to represent the hex color #F0FFF0 in an android application (stored as an integer). I am storing this as:
int color = 0xF0FFF0;
But the color seems way off when being rendered (in fact, it’s black). Am I storing the color incorrectly?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Perhaps you need to set the alpha too.
ie.
int color = 0xFFF0FFF0;where the first two FF represent the alpha as being completely opaque.
See:
http://developer.android.com/reference/android/graphics/Color.html