androidcolorshexrbga

How to Convert #RGBto #RRGGBB


I have to convert a color string in the format #RGB to #RRGGBB like #0af To #RRGGBB now can any one help out here using android


Solution

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

    thats what i was searching. It will ensure that color string always will be #RRGGBB.