user1795294
user1795294

Reputation:

getCurrentTextColor returns int, I want hex color value

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

Answers (2)

CorayThan
CorayThan

Reputation: 17835

See this answer.

String hexColor = String.format("#%06X", (0xFFFFFF & intColor));

Upvotes: 2

Rod_Algonquin
Rod_Algonquin

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

Related Questions