Convert HEX color string to Color?

后端 未结 2 641
长发绾君心
长发绾君心 2021-01-17 18:32

I have a color into the follow format 0xAABBCC as String. I need to convert it into Color, but seems like there is not such method, an

相关标签:
2条回答
  • 2021-01-17 19:21

    use Color.parseColor("#AABBCC");

    0 讨论(0)
  • 2021-01-17 19:26

    new Color(Integer.parseInt("AABBCC", 16));

    0 讨论(0)
提交回复
热议问题