public class GralColor
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
private static class |
GralColor.GralColorContainer |
Modifier and Type | Field and Description |
---|---|
int |
blue
Values 0..255 for the base colors.
|
java.lang.Object |
colorGuimpl
The color-instance for the implementation can be set from the implementation with the necessary type
to minimize the effort in dynamic instances.
|
private static GralColor.GralColorContainer |
container |
int |
green
Values 0..255 for the base colors.
|
java.lang.String |
name
The unique short name for this color.
|
int |
red
Values 0..255 for the base colors.
|
protected int |
rgb
The rgb value, same value as red, green, blue.
|
protected java.lang.String |
usualNames
String with one or more usual names for this color, especially HTML names, X11 names.
|
static java.lang.String |
version
Version, history and license.
|
Constructor and Description |
---|
GralColor(int color)
Deprecated.
only private using, because more as one instances for the same color is prevented then
and the color have a correct name if the value matches to a existent color.
|
GralColor(int red,
int green,
int blue)
Deprecated.
use
getColor(int, int, int) because more as one instances for the same color is prevented then
and the color have a correct name if the value matches to a existent color. |
GralColor(java.lang.String name,
int color)
Deprecated.
only private using, because more as one instances for the same color is prevented then
and the color have a correct name if the value matches to a existent color.
|
Modifier and Type | Method and Description |
---|---|
static GralColor |
getColor(int value) |
static GralColor |
getColor(int red,
int green,
int blue) |
static GralColor |
getColor(java.lang.String name)
Gets a color by its name.
|
java.lang.String |
getColorName() |
int |
getColorValue() |
static GralColor |
getStdColor(int color,
int brightness) |
boolean |
notUsed()
The color is not used till yet or it is changed.
|
int |
rgb() |
java.lang.String |
toString() |
java.lang.String |
usualNames() |
public static final java.lang.String version
getColor(String)
now accepts a "0xhexa-Value" for a color name.
If the color name does not match, a magenta color is returned. The method returns a color in any case.
getColor(String)
and getColor(int)
with the colorContainer
from gridPanel/PropertiesGUI to this.
colorGuimpl
to get the graphic base system color instance if need.
public int red
public int green
public int blue
protected int rgb
public final java.lang.String name
protected java.lang.String usualNames
public java.lang.Object colorGuimpl
private static GralColor.GralColorContainer container
public GralColor(int red, int green, int blue)
getColor(int, int, int)
because more as one instances for the same color is prevented then
and the color have a correct name if the value matches to a existent color.red
- green
- blue
- public GralColor(int color)
color
- public GralColor(java.lang.String name, int color)
color
- public int getColorValue()
public int rgb()
public java.lang.String usualNames()
public java.lang.String getColorName()
public boolean notUsed()
public static GralColor getColor(java.lang.String name)
name
- The name or 0xhexapublic static GralColor getStdColor(int color, int brightness)
public static GralColor getColor(int value)
public static GralColor getColor(int red, int green, int blue)
public java.lang.String toString()
toString
in class java.lang.Object