public interface Color
If all the components except alpha
are at zero and the alpha
is at 1, the
result is black. If all are at 1, the result is the brightest representable white.
Important: the component values out of the 0..1
range are not allowed and
should not be used.
Modifier and Type | Interface and Description |
---|---|
static class |
Color.Builder
A builder of
Color . |
Modifier and Type | Method and Description |
---|---|
default float |
alpha()
Returns the opacity channel value in the
0..1 range. |
default float |
blue()
Returns the blue channel value in the
0..1 range. |
default float |
green()
Returns the green channel value in the
0..1 range. |
default boolean |
isValid()
Returns
true if this color is a valid color. |
static Color.Builder |
newBuilder()
Creates a new
Color builder with the given required parameters. |
default float |
red()
Returns the red channel value in the
0..1 range. |
default java.lang.String |
toHexRGB()
Returns a string representation for this color in the
#RGB hex format. |
default java.lang.String |
toHexRGBA()
Returns a string representation for this color in the
#RGBA hex format. |
static Color.Builder newBuilder()
Color
builder with the given required parameters.Color.Builder
instancedefault boolean isValid()
true
if this color is a valid color. The color is valid only if its channel
values are in the 0..1
range.default java.lang.String toHexRGBA()
#RGBA
hex format.java.lang.IllegalArgumentException
- when this color is invaliddefault java.lang.String toHexRGB()
#RGB
hex format.java.lang.IllegalArgumentException
- when this color is invaliddefault float alpha()
0..1
range. When the value is 1, the color
is 100% opaque. When 0, the color is 100% transparent.default float blue()
0..1
range.default float green()
0..1
range.default float red()
0..1
range.