Convert hex color value ( #ffffff ) to integer value

前端 未结 9 1045
孤城傲影
孤城傲影 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:53

    I have the same problem that I found some color in form of #AAAAAA and I want to conver that into a form that android could make use of. I found that you can just use 0xFFAAAAAA so that android could automatically tell the color. Notice the first FF is telling alpha value. Hope it helps

提交回复
热议问题