Package com.tom_roush.harmony.awt
Class AWTColor
- java.lang.Object
-
- com.tom_roush.harmony.awt.AWTColor
-
public class AWTColor extends Object
Allows for color manipulation similar to the default Java Color class
-
-
Field Summary
Fields Modifier and Type Field Description static AWTColorblackThe color black.static AWTColorBLACKThe color black.static AWTColorblueThe color blue.static AWTColorBLUEThe color blue.intcolorstatic AWTColorcyanThe color cyan.static AWTColorCYANThe color cyan.static AWTColorDARK_GRAYThe color dark gray.static AWTColordarkGrayThe color dark gray.static AWTColorgrayThe color gray.static AWTColorGRAYThe color gray.static AWTColorgreenThe color green.static AWTColorGREENThe color green.static AWTColorLIGHT_GRAYThe color light gray.static AWTColorlightGrayThe color light gray.static AWTColormagentaThe color magenta.static AWTColorMAGENTAThe color magenta.static AWTColororangeThe color orange.static AWTColorORANGEThe color orange.static AWTColorpinkThe color pink.static AWTColorPINKThe color pink.static AWTColorredThe color red.static AWTColorREDThe color red.static AWTColorwhiteThe color white.static AWTColorWHITEThe color white.static AWTColoryellowThe color yellow.static AWTColorYELLOWThe color yellow.
-
Constructor Summary
Constructors Constructor Description AWTColor(float r, float g, float b)Creates an AWTColor with the specified RGB valuesAWTColor(int c)Creates an AWTColor from a color intAWTColor(int r, int g, int b)Creates an AWTColor with the specified RGB values that is fully opaqueAWTColor(int r, int g, int b, int a)Creates an AWTColor with the specified RGBA values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetAlpha()Returns the alpha component of this colorintgetBlue()Returns the blue component of this colorintgetGreen()Returns the green component of this colorintgetRed()Returns the red component of this colorfloat[]getRGBColorComponents(float[] compArray)Returns the RGB values range (0.0 - 1.0) as a float array
-
-
-
Field Detail
-
white
public static final AWTColor white
The color white.
-
WHITE
public static final AWTColor WHITE
The color white.
-
lightGray
public static final AWTColor lightGray
The color light gray.
-
LIGHT_GRAY
public static final AWTColor LIGHT_GRAY
The color light gray.
-
gray
public static final AWTColor gray
The color gray.
-
GRAY
public static final AWTColor GRAY
The color gray.
-
darkGray
public static final AWTColor darkGray
The color dark gray.
-
DARK_GRAY
public static final AWTColor DARK_GRAY
The color dark gray.
-
black
public static final AWTColor black
The color black.
-
BLACK
public static final AWTColor BLACK
The color black.
-
red
public static final AWTColor red
The color red.
-
RED
public static final AWTColor RED
The color red.
-
pink
public static final AWTColor pink
The color pink.
-
PINK
public static final AWTColor PINK
The color pink.
-
orange
public static final AWTColor orange
The color orange.
-
ORANGE
public static final AWTColor ORANGE
The color orange.
-
yellow
public static final AWTColor yellow
The color yellow.
-
YELLOW
public static final AWTColor YELLOW
The color yellow.
-
green
public static final AWTColor green
The color green.
-
GREEN
public static final AWTColor GREEN
The color green.
-
magenta
public static final AWTColor magenta
The color magenta.
-
MAGENTA
public static final AWTColor MAGENTA
The color magenta.
-
cyan
public static final AWTColor cyan
The color cyan.
-
CYAN
public static final AWTColor CYAN
The color cyan.
-
blue
public static final AWTColor blue
The color blue.
-
BLUE
public static final AWTColor BLUE
The color blue.
-
color
public int color
-
-
Constructor Detail
-
AWTColor
public AWTColor(int c)
Creates an AWTColor from a color int- Parameters:
c- The color integer
-
AWTColor
public AWTColor(int r, int g, int b)Creates an AWTColor with the specified RGB values that is fully opaque- Parameters:
r- The red componentg- The green componentb- The blue component
-
AWTColor
public AWTColor(int r, int g, int b, int a)Creates an AWTColor with the specified RGBA values- Parameters:
r- The red componentg- The green componentb- The blue componenta- The alpha component
-
AWTColor
public AWTColor(float r, float g, float b)Creates an AWTColor with the specified RGB values- Parameters:
r- The red component as a float in the range (0.0f - 1.0f)g- The green component as a float in the range (0.0f - 1.0f)b- The blue component as a float in the range (0.0f - 1.0f)
-
-
Method Detail
-
getRed
public int getRed()
Returns the red component of this color- Returns:
- the value of the red component
-
getGreen
public int getGreen()
Returns the green component of this color- Returns:
- the value of the green component
-
getBlue
public int getBlue()
Returns the blue component of this color- Returns:
- the value of the blue component
-
getAlpha
public int getAlpha()
Returns the alpha component of this color- Returns:
- the value of the alpha component
-
getRGBColorComponents
public float[] getRGBColorComponents(float[] compArray)
Returns the RGB values range (0.0 - 1.0) as a float array- Parameters:
compArray- the array that will hold the values or null- Returns:
- the float array of the RGB values
-
-