| java.lang.Object | |
| ↳ | com.neomades.graphics.Color |
Color object is used to encapsulate RGB components and opacity.
Static methods are provided in order to facilitate writing color with integers (0xAARRGGBB or 0xRRGGBB).
| Fields | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| public static final Color | BLACK | Black. | |||||||||
| public static final Color | BLUE | Blue. | |||||||||
| public static final Color | CYAN | Cyan. | |||||||||
| public static final Color | DARK_BLUE | Dark Blue. | |||||||||
| public static final Color | DARK_GRAY | Dark Gray. | |||||||||
| public static final Color | GRAY | Gray. | |||||||||
| public static final Color | GREEN | Green. | |||||||||
| public static final Color | LIGHT_GRAY | Light Gray. | |||||||||
| public static final Color | MAGENTA | Magenta. | |||||||||
| public static final Color | ORANGE | Orange. | |||||||||
| public static final Color | PINK | Pink. | |||||||||
| public static final Color | RED | Red. | |||||||||
| public static final Color | TRANSPARENT | Transparent | |||||||||
| public static final Color | WHITE | White. | |||||||||
| public static final Color | YELLOW | Yellow. | |||||||||
| Public Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| static Color |
argb(int argb)
Create a sRGB color with integer argb code (eg.
| ||||||||||
| static Color |
argb(int alpha, int red, int green, int blue)
Creates an sRGB color with the specified red, green, blue, and alpha values
in the range (0 - 255).
| ||||||||||
| int |
getAlpha()
Return the alpha value (0 - 255).
| ||||||||||
| int |
getBlue()
Return the blue value (0 - 255).
| ||||||||||
| int |
getGreen()
Return the green value (0 - 255).
| ||||||||||
| abstract String | getName() | ||||||||||
| int |
getRed()
Return the red value (0 - 255).
| ||||||||||
| boolean |
isTransparent()
Return if this color is fully transparent (not visible).
| ||||||||||
| static Color |
rgb(int rgb)
Create an opaque sRGB color with integer rgb code (eg.
| ||||||||||
| static Color |
rgb(int red, int green, int blue)
Creates an opaque sRGB color with the specified red, green, and blue values
in the range (0 - 255).
| ||||||||||
| int |
toARGB()
Convert this color to integer color value (0xAARRGGBB) with alpha value.
| ||||||||||
| int |
toRGB()
Convert this color to integer color value (0xRRGGBB) without alpha value.
| ||||||||||
|
[Expand]
Inherited Methods | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
Create a sRGB color with integer argb code (eg. : 0xAARRGGBB).
| argb | integer ARGB code (0xAARRGGBB) |
|---|
Creates an sRGB color with the specified red, green, blue, and alpha values in the range (0 - 255).
| alpha | alpha/opacity component (0 : transparent, 255 : opaque) |
|---|---|
| red | red component (0 - 255) |
| green | green component (0 - 255) |
| blue | blue component (0 - 255) |
| IllegalArgumentException | if one of parameters is out bounds (<0 or >255) |
|---|
Return the alpha value (0 - 255).
Return the blue value (0 - 255).
Return the green value (0 - 255).
Return the red value (0 - 255).
Return if this color is fully transparent (not visible).
Create an opaque sRGB color with integer rgb code (eg. : 0xRRGGBB).
| rgb | integer RGB code (0xRRGGBB) |
|---|
Creates an opaque sRGB color with the specified red, green, and blue values in the range (0 - 255).
| red | red component (0 - 255) |
|---|---|
| green | green component (0 - 255) |
| blue | blue component (0 - 255) |
| IllegalArgumentException | if one of parameters is out bounds (<0 or >255) |
|---|
Convert this color to integer color value (0xAARRGGBB) with alpha value.
Convert this color to integer color value (0xRRGGBB) without alpha value.