涂料DOES设置了颜色功能。
/**
* Set the paint's color. Note that the color is an int containing alpha
* as well as r,g,b. This 32bit value is not premultiplied, meaning that
* its alpha can be any value, regardless of the values of r,g,b.
* See the Color class for more details.
*
* @param color The new color (including alpha) to set in the paint.
*/
public native void setColor(@ColorInt int color);
作为Android开发者,我定油漆颜色像这样...
paint.setColor(getResources().getColor(R.color.xxx));
我定义上color.xml类似的颜色值...
<color name="xxx">#008fd2</color>
通过,如果你想要的特定颜色值的十六进制RGB值的方式,那么你就可以查询网站是这样的:http://www.rapidtables.com/web/color/RGB_Color.htm
我希望这有助于!享受编码!
android.graphics.Color是静态方法的集合。它不应该被初始化。你是如何设法做到这一点的? –
你是对的,谢谢,请将其重新发布为答案:) – Caner