I have a hexidecimal number (a color) stored in a String as followed: “ff62e6b8”.
I need to convert this back to an integer so I can use it as a color value again.
I have tried the following:
Int i = Integer.parseInt("ff62e6b8", 16);
Int i = Integer.valueOf("ff62e6b8", 16);
Int i = Integer.decode("ff62e6b8");
But all of these methods raise exceptions. Am I missing something here?
Try with this :
Example :
By this you will get
colorVal = -10295624.And if you want to generate hexColor code back from the colorVal then use this :
By this you will get
hexColor = #62E6B8.Thanks.