Convert hex color value ( #ffffff ) to integer value

前端 未结 9 1067
孤城傲影
孤城傲影 2020-12-13 01:26

I am receiving hex color values from a server (in this form, #xxxxxx , example #000000 for black)

How do I convert this to an integer value

9条回答
  •  情书的邮戳
    2020-12-13 01:54

    Answer is really simple guys, in android if you want to convert hex color in to int, just use android Color class, example shown as below

    this is for light gray color

    Color.parseColor("#a8a8a8");
    

    Thats it and you will get your result.

提交回复
热议问题