Reputation: 25
I get pixel colour from image in android and I want to display the name of that colour to user. I'm getting hexa value from integer:
Palette p = Palette.from(bitmap).generate();
Integer color = p.getDominantColor(23);
String hex = Integer.toHexString(color);
infoTV.setTextColor(color+(-16777216));
Integer c = color+(-16777216);
Integer dfs = Color.parseColor(hex);
if I parse color I get "unknown color" error
Upvotes: 0
Views: 597
Reputation: 2835
Try Color class method:
public static int parseColor (String colorString)
Exmple :
textView.textColor = Color.parseColor("#FF0000");
Upvotes: 2