Serializablepublic final class Color extends Object implements Serializable
| Modifier and Type | Field | Description |
|---|---|---|
int |
alpha |
Alpha value, must be between MIN_VALUE and MAX_VALUE.
|
static Color |
BLACK |
Black constant.
|
int |
blue |
Blue value, must be between MIN_VALUE and MAX_VALUE.
|
static Color |
BLUE |
Blue constant.
|
static Color |
GRAY |
Gray constant.
|
int |
green |
Green value, must be between MIN_VALUE and MAX_VALUE.
|
static Color |
GREEN |
Green constant.
|
float |
normalizedAlpha |
Alpha value, must be between 0 and 1.
|
float |
normalizedBlue |
Blue value, must be between 0 and 1.
|
float |
normalizedGreen |
Green value, must be between 0 and 1.
|
float |
normalizedRed |
Red value, must be between 0 and 1.
|
static Color |
ORANGE |
Orange constant.
|
int |
red |
Red value, must be between MIN_VALUE and MAX_VALUE.
|
static Color |
RED |
Red constant.
|
static Color |
WHITE |
White constant.
|
static Color |
YELLOW |
Yellow constant.
|
| Modifier and Type | Method | Description |
|---|---|---|
Color |
add(int value) |
Create a copy of this color with a value added to RGB values, alpha is
not updated.
|
Color |
add(int red,
int green,
int blue) |
|
boolean |
equals(Object obj) |
Test equality between the RGBA values.
|
int |
hashCode() |
|
static Color |
rgb(int rgb) |
Create a color instance for RGB values, alpha is set at 255.
|
static Color |
rgb(int red,
int green,
int blue) |
Create a color instance for RGB values, alpha is set at 255.
|
static Color |
rgba(int red,
int green,
int blue,
int alpha) |
Create a color instance for RGBA values.
|
String |
toString() |
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 ORANGE
public static final Color GRAY
public final int red
public final int green
public final int blue
public final int alpha
public final float normalizedRed
public final float normalizedGreen
public final float normalizedBlue
public final float normalizedAlpha
public static Color rgb(int red, int green, int blue)
red - Red value(must be between 0 and 255).green - Green value(must be between 0 and 255).blue - Blue value(must be between 0 and 255).public static Color rgb(int rgb)
rgb - RGB values(must be between 0 and 255).public static Color rgba(int red, int green, int blue, int alpha)
red - Red value(must be between 0 and 255).green - Green value(must be between 0 and 255).blue - Blue value(must be between 0 and 255).alpha - Alpha value (must be between 0 and 255).public Color add(int value)
value - Value to add.public Color add(int red, int green, int blue)
public boolean equals(Object obj)
Copyright © 2014–2018. All rights reserved.