android 颜色(color)

SDK文档定义如下:

The Color class defines methods for creating and converting color ints. Colors are represented as packed ints, made up of 4 bytes: alpha, red, green, blue. The values are unpremultiplied, meaning any transparency is stored solely in the alpha component, and not in the color components. The components are stored as follows (alpha << 24) | (red << 16) | (green << 8) | blue. Each component ranges between 0..255 with 0 meaning no contribution for that component, and 255 meaning 100% contribution. Thus opaque-black would be 0xFF000000 (100% opaque but no contributions from red, green, or blue), and opaque-white would be 0xFFFFFFFF

Alpha通道是一个8位的灰度通道,该通道用256级灰度来记录图像中的透明度信息,定义透明、不透明和半透明区域,其中黑表示全透明,白表示不透明,灰表示半透明。

public static final int BLACK
Since:  API Level 1

Constant Value: -16777216 (0xff000000)
public static final int BLUE
Since:  API Level 1

Constant Value: -16776961 (0xff0000ff)
public static final int CYAN
Since:  API Level 1

Constant Value: -16711681 (0xff00ffff)
public static final int DKGRAY
Since:  API Level 1

Constant Value: -12303292 (0xff444444)
public static final int GRAY
Since:  API Level 1

Constant Value: -7829368 (0xff888888)
public static final int GREEN
Since:  API Level 1

Constant Value: -16711936 (0xff00ff00)
public static final int LTGRAY
Since:  API Level 1

Constant Value: -3355444 (0xffcccccc)
public static final int MAGENTA
Since:  API Level 1

Constant Value: -65281 (0xffff00ff)
public static final int RED
Since:  API Level 1

Constant Value: -65536 (0xffff0000)
public static final int TRANSPARENT
Since:  API Level 1

Constant Value: 0 (0x00000000)
public static final int WHITE
Since:  API Level 1

Constant Value: -1 (0xffffffff)
public static final int YELLOW
Since:  API Level 1

Constant Value: -256 (0xffffff00)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值