public class Color extends Object
Modifier and Type | Field and Description |
---|---|
static Color |
BLACK
Predefined Color : Black
|
static Color |
BLUE
Predefined Color : Blue
|
static Color |
CYAN
Predefined Color : Cyan
|
static Color |
GRAY
Predefined Color : Gray
|
static Color |
GREEN
Predefined Color : Green
|
static Color |
MAGENTA
Predefined Color : Magenta
|
static int |
OPAQUE
Alpha value: Opaque
|
static Color |
ORANGE
Predefined Color : Orange
|
static Color |
PURPLE
Predefined Color : Purple
|
static Color |
RED
Predefined Color : Red
|
static int |
TRANSPARENT
Alpha value: Transparent
|
static Color |
WHITE
Predefined Color : White
|
static Color |
YELLOW
Predefined Color : Yellow
|
Constructor and Description |
---|
Color() |
Color(int intValue)
Constructs an Color object
|
Color(int red,
int green,
int blue)
Constructs an Color object with the red, green, and blue values
|
Color(int alpha,
int red,
int green,
int blue)
Constructs an Color object with the alpha, red, green, and blue values
|
Modifier and Type | Method and Description |
---|---|
int |
getAlpha()
Returns alpha component value of the color
|
int |
getBlue()
Returns blue component value of the color
|
int |
getGreen()
Returns green component value of the color
|
int |
getRed()
Returns red component value of the color
|
int |
intValue()
Returns argb value of the color
|
void |
setAlpha(int alpha)
Changes alpha component value of the color
|
void |
setAlphaPercent(int percent)
Changes alpha component value of the color
|
void |
setBlue(int blue)
Changes blue component value of the color
|
void |
setBluePercent(int percent)
Changes blue component value of the color
|
void |
setGreen(int green)
Changes green component value of the color
|
void |
setGreenPercent(int percent)
Changes green component value of the color
|
void |
setRed(int red)
Changes red component value of the color
|
void |
setRedPercent(int percent)
Changes red component value of the color
|
public static final Color BLACK
public static final Color WHITE
public static final Color RED
public static final Color GREEN
public static final Color BLUE
public static final Color YELLOW
public static final Color MAGENTA
public static final Color CYAN
public static final Color PURPLE
public static final Color ORANGE
public static final Color GRAY
public static final int TRANSPARENT
public static final int OPAQUE
public Color()
public Color(int intValue)
intValue
- ARGB valuepublic Color(int red, int green, int blue)
red
- red component valuegreen
- green component valueblue
- blue component valuepublic Color(int alpha, int red, int green, int blue)
alpha
- alpha component valuered
- red component valuegreen
- green component valueblue
- blue component valuepublic int getAlpha()
public void setAlpha(int alpha)
alpha
- 0~255public void setAlphaPercent(int percent)
percent
- percentage of 255.public int getRed()
public void setRed(int red)
alpha
- 0~255public void setRedPercent(int percent)
percent
- percentage of 255.public int getGreen()
public void setGreen(int green)
alpha
- 0~255public void setGreenPercent(int percent)
percent
- percentage of 255.public int getBlue()
public void setBlue(int blue)
alpha
- 0~255public void setBluePercent(int percent)
percent
- percentage of 255.public int intValue()