public final static Color white = new Color(255, 255, 255);
public final static Color lightGray = new Color(192, 192, 192);
public final static Color gray = new Color(128, 128, 128);
public final static Color darkGray = new Color(64, 64, 64);
public final static Color black = new Color(0, 0, 0);
public final static Color red = new Color(255, 0, 0);
public final static Color pink = new Color(255, 175, 175);
public final static Color orange = new Color(255, 200, 0);
public final static Color yellow = new Color(255, 255, 0);
public final static Color green = new Color(0, 255, 0);
public final static Color magenta = new Color(255, 0, 255);
public final static Color cyan = new Color(0, 255, 255);
public final static Color blue = new Color(0, 0, 255);
其值在Color類內部以int的形式存著,24-32位為alpha值,16-23為red,8-15為green,0-7則是blue。預設的alpha值為全1,也就是255,完全不透明。
比如說
表示在其內部顏色的值為255*2^24+255*2^16+175*2^8+175=4294946735
public final static Color white = new Color(255, 255, 255);
public final static Color lightGray = new Color(192, 192, 192);
public final static Color gray = new Color(128, 128, 128);
public final static Color darkGray = new Color(64, 64, 64);
public final static Color black = new Color(0, 0, 0);
public final static Color red = new Color(255, 0, 0);
public final static Color pink = new Color(255, 175, 175);
public final static Color orange = new Color(255, 200, 0);
public final static Color yellow = new Color(255, 255, 0);
public final static Color green = new Color(0, 255, 0);
public final static Color magenta = new Color(255, 0, 255);
public final static Color cyan = new Color(0, 255, 255);
public final static Color blue = new Color(0, 0, 255);
其值在Color類內部以int的形式存著,24-32位為alpha值,16-23為red,8-15為green,0-7則是blue。預設的alpha值為全1,也就是255,完全不透明。
比如說
public final static Color pink = new Color(255, 175, 175);
表示在其內部顏色的值為255*2^24+255*2^16+175*2^8+175=4294946735