how to convert rgb color to int in java

后端 未结 8 1082
再見小時候
再見小時候 2020-11-28 13:11

Paint.setColor is expecting an integer. But what I have is a Color object. I don\'t see a color.getIntValue() in Java? So how do I do

8条回答
  •  囚心锁ツ
    2020-11-28 13:13

    You may declare a value in color.xml, and thus you can get integer value by calling the code below.

    context.getColor(int resId);
    

提交回复
热议问题