public interface IsColor
Modifier and Type | Method and Description |
---|---|
default IsColor |
alpha(double alpha)
Clones the color applying the alpha value.
|
default IsColor |
brighter()
Creates a new color that is a brighter version of this color.
|
default IsColor |
brighter(double alpha)
Creates a new color that is a brighter version of this color.
|
static String |
checkAndGetValue(IsColor value)
Checks a color value if consistent, returning the RGBA representation, otherwise
null . |
static void |
checkIfValid(IsColor color)
Checks if the passed color is consistent, that means with a right red, green, blue and alpha values.
If not consistent, an IllegalArgumentException will be thrown. |
default 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. |
default 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.
|
static boolean |
isConsistent(IsColor color)
Returns
true if the passed color instance is consistent, that means with a right red, green, blue and alpha values and if the RGBA string representation is
consistent as well. |
static boolean |
isValid(IsColor color)
Returns
true if the passed color instance is consistent, that means with a right red, green, blue and alpha values. |
default String |
toHex()
Returns HEX string value which represents the color.
|
default String |
toHSL()
Returns HSL string value which represents the color.
|
default String |
toHSLA()
Returns HSLA string value which represents the color.
|
default String |
toRGB()
Returns RGB string value which represents the color.
|
default String |
toRGBA()
Returns RGBA string value which represents the color.
|
default 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.
|
static boolean isConsistent(IsColor color)
true
if the passed color instance is consistent, that means with a right red, green, blue and alpha values and if the RGBA string representation is
consistent as well.color
- color instance to checktrue
if the passed color instance is consistentstatic boolean isValid(IsColor color)
true
if the passed color instance is consistent, that means with a right red, green, blue and alpha values.color
- color instance to checktrue
if the passed color instance is consistentstatic void checkIfValid(IsColor color)
IllegalArgumentException
will be thrown.color
- color instance to checkstatic String checkAndGetValue(IsColor value)
null
.value
- value to be setnull
if color is nullint getRed()
int getGreen()
int getBlue()
double getAlpha()
default IsColor alpha(double alpha)
alpha
- the alpha to setdefault String toRGBA()
default String toRGB()
default String toHex()
default String toHSLA()
default String toHSL()
default int toRGBs()
byte byte byte byte | | | | | +--------+--------+--------+--------+ alpha red green blue
default IsColor brighter()
brighter
and darker
are inverse operations, the results of a series of invocations of these two methods might be inconsistent because of
rounding errors.default IsColor brighter(double alpha)
brighter
and darker
are inverse operations, the results of a series of invocations of these two methods might be inconsistent because of
rounding errors.alpha
- the alpha to setdefault IsColor darker()
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.default IsColor darker(double alpha)
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.alpha
- the alpha to set