public ConvertibleColor
A color that can be converted to other representations.
The conversion functions can return the object they're called on if it is already in the correct format.
Note that there is not a direct conversion between every pair of representations. In those cases, the values may be converted through one or more intermediate representations. This may cause a loss of precision.
| Modifier and Type | Interface and Description |
|---|---|
static class |
ConvertibleColor.DefaultImpls
A color that can be converted to other representations.
|
| Modifier and Type | Method and Description |
|---|---|
Ansi16 |
toAnsi16()
Convert this color to a 16-color ANSI code
|
Ansi256 |
toAnsi256()
Convert this color to a 256-color ANSI code
|
CMYK |
toCMYK()
Convert this color to Cyan-Magenta-Yellow-Key
|
HSL |
toHSL()
Convert this color to Hue-Saturation-Luminosity
|
HSV |
toHSV()
Convert this color to Hue-Saturation-Value
|
java.lang.String |
toHex(boolean withNumberSign)
Convert this color to an RGB hex string.
|
LAB |
toLAB()
Convert this color to CIE LAB
|
RGB |
toRGB()
Convert this color to Red-Green-Blue (using sRGB color space)
|
XYZ |
toXYZ()
Convert this color to CIE XYZ
|
RGB toRGB()
Convert this color to Red-Green-Blue (using sRGB color space)
java.lang.String toHex(boolean withNumberSign)
Convert this color to an RGB hex string.
"#ffffff" if withNumberSign is true,
or in the form "ffffff" otherwise.HSL toHSL()
Convert this color to Hue-Saturation-Luminosity
HSV toHSV()
Convert this color to Hue-Saturation-Value
Ansi16 toAnsi16()
Convert this color to a 16-color ANSI code
Ansi256 toAnsi256()
Convert this color to a 256-color ANSI code
CMYK toCMYK()
Convert this color to Cyan-Magenta-Yellow-Key
XYZ toXYZ()
Convert this color to CIE XYZ
LAB toLAB()
Convert this color to CIE LAB