I'm trying to convert an input hex string to an into to set a color value. I've tried two different approaches, neither of which works. I get nothing but zero no matter what string I input. What am I doing wrong?
First approach:
String hexValue = "ff0000";
Integer intObject = new Integer(0);
intObject.parseInt(hexValue,16);
colorValue = intObject.intValue();
System.out.println("hexValue = "+hexValue+" Color value = "+colorValue);
Output: hexValue = ff0000 Color value = 0
Second approach:
String hexValue = "0xff0000);
Integer intObject = new Integer(0);
intObject.decode(hexValue);
colorValue = intObject.intValue();
System.out.println("hexValue = "+hexValue+" Color value = "+colorValue);
hexValue = 0xff3333 Color value = 0
thanks,
--gary