Here’s my code that is supposed to take a color int, convert it to HSV, add 0.5 to hue and convert back to int. But in the output, instead of 0xFF00FFFF gives -64768 … any ideas what might be the problem?
int c = 0xFFFF0000; /// RED
float[] hsv = new float[3];
Color.colorToHSV( c, hsv ); /// splitting "c" into hsv
hsv[0] = hsv[0]+0.5f; /// adding 0.5 to Hue
int c1 = Color.HSVToColor( hsv ); /// converting hsv back to int
Log.e("color: ", String.valueOf(c1) ); /// outputting new color int
// should be "0xFF00FFFF" (light bule) , but is "-64768" hmm...
Thanks!
You are not printing the string in hex.
Instead the raw int value is printed.
That value in hex is FFFF0300, which makes sense.