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 intBLACK

Since: API Level 1

Constant Value:-16777216 (0xff000000)

public static final intBLUE

Since: API Level 1

Constant Value:-16776961 (0xff0000ff)

public static final intCYAN

Since: API Level 1

Constant Value:-16711681 (0xff00ffff)

public static final intDKGRAY

Since: API Level 1

Constant Value:-12303292 (0xff444444)

public static final intGRAY

Since: API Level 1

Constant Value:-7829368 (0xff888888)

public static final intGREEN

Since: API Level 1

Constant Value:-16711936 (0xff00ff00)

public static final intLTGRAY

Since: API Level 1

Constant Value:-3355444 (0xffcccccc)

public static final intMAGENTA

Since: API Level 1

Constant Value:-65281 (0xffff00ff)

public static final intRED

Since: API Level 1

Constant Value:-65536 (0xffff0000)

public static final intTRANSPARENT

Since: API Level 1

Constant Value:0 (0x00000000)

public static final intWHITE

Since: API Level 1

Constant Value:-1 (0xffffffff)

public static final intYELLOW

Since: API Level 1

Constant Value:-256 (0xffffff00)

更多相关文章

  1. Windows下使用platform.pk8 和platform.x509.pem生成Android(安
  2. Android(安卓)Frame Animation
  3. Android(安卓)View之对现有控件进行拓展实例
  4. 反编译并且修改Android(安卓)APK包
  5. 反编译并且修改Android(安卓)APK包
  6. Android(安卓)上层应用读写底层设备节点(Android(安卓)M)
  7. android中动态和静态版本都有的库
  8. android 设置背景透明 半透明 透明
  9. android设置button透明度

随机推荐

  1. Android手势画圆
  2. Android中为Button注册监听器最常用的两
  3. android sqlite用法
  4. android图片缩放(指定大小) drawable获取图
  5. AndroidStudio如何配置NDK/JNI开发环境
  6. android KeyboardView使用
  7. android listView 自定义布局结合Checked
  8. Android MultiDex 解决 64K 限制,方法数超
  9. android里的继承浅析
  10. android中选择文件,部分手机找不到文件路