Package org.eclipse.graphiti.util
Class ColorConstant
java.lang.Object
org.eclipse.graphiti.util.ColorConstant
- All Implemented Interfaces:
IColorConstant
The Class ColorConstant.
-
Field Summary
Fields inherited from interface org.eclipse.graphiti.util.IColorConstant
BLACK, BLUE, CONNECTION_SELECTION_FG, CYAN, DARK_BLUE, DARK_GRAY, DARK_GREEN, DARK_ORANGE, GRAY, GREEN, HANDLE_BG, HANDLE_FG, LIGHT_BLUE, LIGHT_GRAY, LIGHT_GREEN, LIGHT_LIGHT_GRAY, LIGHT_ORANGE, ORANGE, RED, SHAPE_SELECTION_FG, WHITE, YELLOW
-
Constructor Summary
ConstructorDescriptionColorConstant
(int red, int green, int blue) Creates a newColorConstant
given the desired red, green and blue values expressed as ints in the range 0 to 255 (where 0 is black and 255 is full brightness).ColorConstant
(String hexRGBString) Creates a newColorConstant
for for a given String, which defines the RGB values in hexadecimal format. -
Method Summary
-
Constructor Details
-
ColorConstant
public ColorConstant(int red, int green, int blue) Creates a newColorConstant
given the desired red, green and blue values expressed as ints in the range 0 to 255 (where 0 is black and 255 is full brightness).- Parameters:
red
- the amount of red in the colorgreen
- the amount of green in the colorblue
- the amount of blue in the color
-
ColorConstant
Creates a newColorConstant
for for a given String, which defines the RGB values in hexadecimal format. This means, that the String must have a length of 6 characters. Example:getColor("FF0000")
returns a red color.- Parameters:
hexRGBString
- The RGB values in hexadecimal format.- Since:
- 0.8
-
-
Method Details
-
getRed
public int getRed()Description copied from interface:IColorConstant
Returns the amount of red in the color, from 0 to 255.- Specified by:
getRed
in interfaceIColorConstant
- Returns:
- the red component of the color
-
getGreen
public int getGreen()Description copied from interface:IColorConstant
Returns the amount of green in the color, from 0 to 255.- Specified by:
getGreen
in interfaceIColorConstant
- Returns:
- the green component of the color
-
getBlue
public int getBlue()Description copied from interface:IColorConstant
Returns the amount of blue in the color, from 0 to 255.- Specified by:
getBlue
in interfaceIColorConstant
- Returns:
- the blue component of the color
-