java - How to convert a color integer to a hex String in Android? -


i have integer generated android.graphics.color

the integer has value of -16776961

how convert value hex string format #rrggbb

simply put: output #0000ff -16776961

note: not want output contain alpha , have tried this example without success

the mask makes sure rrggbb, , %06x gives zero-padded hex (always 6 chars long):

string hexcolor = string.format("#%06x", (0xffffff & intcolor)); 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -