android.graphics.Color

来源:互联网 发布:java jar 运行war包 编辑:程序博客网 时间:2024/05/18 22:55

                                           android.graphics.Color

Class Overview


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


Constants


public static final int BLACK   //黑色

Added in API level 1

Constant Value: -16777216 (0xff000000)

public static final int BLUE   //蓝色

Added in API level 1

Constant Value: -16776961 (0xff0000ff)

public static final int CYAN   //蓝绿色

Added in API level 1

Constant Value: -16711681 (0xff00ffff)

public static final int DKGRAY   //深灰色

Added in API level 1

Constant Value: -12303292 (0xff444444)

public static final int GRAY  //灰色

Added in API level 1

Constant Value: -7829368 (0xff888888)

public static final int GREEN  //绿色

Added in API level 1

Constant Value: -16711936 (0xff00ff00)

public static final int LTGRAY  //

Added in API level 1

Constant Value: -3355444 (0xffcccccc)

public static final int MAGENTA  //洋红色的,品红

Added in API level 1

Constant Value: -65281 (0xffff00ff)

public static final int RED  //红色

Added in API level 1

Constant Value: -65536 (0xffff0000)

public static final int TRANSPARENT  //透明

Added in API level 1

Constant Value: 0 (0x00000000)

public static final int WHITE  //白色

Added in API level 1

Constant Value: -1 (0xffffffff)

public static final int YELLOW  //黄色

Added in API level 1

Constant Value: -256 (0xffffff00)

原创粉丝点击