Reputation:
I'm trying to compare the hex color value string to the color of textview which changes color every few seconds.
At the moment getCurrentTextColor for the textview returns a large minus number, rather than the hex value of the color.
How would I turn this number into it's hex value? is this possible?
thanks
Upvotes: 0
Views: 1133
Reputation: 17835
See this answer.
String hexColor = String.format("#%06X", (0xFFFFFF & intColor));
Upvotes: 2
Reputation: 26198
You dont turn them to hex value. Just compare the getCurrentTextColor
with the curresponding hex value
sample:
if (textView.getCurrentTextColor() == 0xff4444)
Upvotes: 0