Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_ALPHA
Default transparency is 1.0, (no transparency).
|
Constructor and Description |
---|
Color(int r,
int g,
int b)
Creates the color with RGB values.
|
Modifier and Type | Method and Description |
---|---|
IsColor |
alpha(double alpha)
Clones the color applying the alpha value.
|
IsColor |
brighter()
Creates a new color that is a brighter version of this color.
|
IsColor |
brighter(double alpha)
Creates a new color that is a brighter version of this color.
|
static void |
checkAlphaWithinBounds(double alpha)
Any double between 0.0d and 1.0d (inclusive) is valid.
|
IsColor |
darker()
Creates a new
Color that is a darker version of this Color .This method applies an arbitrary scale factor to each of the three RGB components of this Color to create a
darker version of this Color .Although brighter and darker are inverse operations, the results of a series of invocations of
these two methods might be inconsistent because of rounding errors. |
IsColor |
darker(double alpha)
Creates a new
Color that is a darker version of this Color .This method applies an arbitrary scale factor to each of the three RGB components of this Color to create a
darker version of this Color .Although brighter and darker are inverse operations, the results of a series of invocations of
these two methods might be inconsistent because of rounding errors. |
double |
getAlpha()
Returns the alpha rate.
|
int |
getBlue()
Returns the blue value.
|
int |
getGreen()
Returns the green value.
|
int |
getRed()
Returns the red value.
|
String |
toHex()
Returns HEX string value which represents the color.
|
String |
toHSL()
Returns HSL string value which represents the color.
|
String |
toHSLA()
Returns HSLA string value which represents the color.
|
String |
toRGB()
Returns RGB string value which represents the color.
|
String |
toRGBA()
Returns RGBA string value which represents the color.
|
int |
toRGBs()
As IEC 61966-2-1:1999, applies to the encoding and communication
of RGB colors used in computer systems and similar applications, by defining encoding transformations for use in defined
reference conditions.
|
String |
toString() |
public static final double DEFAULT_ALPHA
public Color(int r, int g, int b)
r
- red valueg
- green valueb
- blue valuepublic int getRed()
IsColor
public int getGreen()
IsColor
public int getBlue()
IsColor
public double getAlpha()
IsColor
public IsColor alpha(double alpha)
IsColor
public String toRGBA()
IsColor
public String toRGB()
IsColor
public String toHex()
IsColor
public String toHSLA()
IsColor
public String toHSL()
IsColor
public int toRGBs()
IsColor
byte byte byte byte | | | | | +--------+--------+--------+--------+ alpha red green blue
public IsColor brighter()
IsColor
brighter
and darker
are inverse operations, the results of a series of invocations of
these two methods might be inconsistent because of rounding errors.public IsColor brighter(double alpha)
IsColor
brighter
and darker
are inverse operations, the results of a series of invocations of
these two methods might be inconsistent because of rounding errors.public IsColor darker()
IsColor
Color
that is a darker version of this Color
.Color
to create a
darker version of this Color
.brighter
and darker
are inverse operations, the results of a series of invocations of
these two methods might be inconsistent because of rounding errors.public IsColor darker(double alpha)
IsColor
Color
that is a darker version of this Color
.Color
to create a
darker version of this Color
.brighter
and darker
are inverse operations, the results of a series of invocations of
these two methods might be inconsistent because of rounding errors.public static void checkAlphaWithinBounds(double alpha)
alpha
- alpha value, exception if the channel is nor within bounds