public static class ConvertibleColor.DefaultImpls
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 | Method and Description |
|---|---|
static Ansi16 |
toAnsi16(ConvertibleColor $this)
Convert this color to a 16-color ANSI code
|
static Ansi256 |
toAnsi256(ConvertibleColor $this)
Convert this color to a 256-color ANSI code
|
static CMYK |
toCMYK(ConvertibleColor $this)
Convert this color to Cyan-Magenta-Yellow-Key
|
static HSL |
toHSL(ConvertibleColor $this)
Convert this color to Hue-Saturation-Luminosity
|
static HSV |
toHSV(ConvertibleColor $this)
Convert this color to Hue-Saturation-Value
|
static java.lang.String |
toHex(ConvertibleColor $this,
boolean withNumberSign)
Convert this color to an RGB hex string.
|
static LAB |
toLAB(ConvertibleColor $this)
Convert this color to CIE LAB
|
static XYZ |
toXYZ(ConvertibleColor $this)
Convert this color to CIE XYZ
|
public static java.lang.String toHex(ConvertibleColor $this, boolean withNumberSign)
Convert this color to an RGB hex string.
"#ffffff" if withNumberSign is true,
or in the form "ffffff" otherwise.public static HSL toHSL(ConvertibleColor $this)
Convert this color to Hue-Saturation-Luminosity
public static HSV toHSV(ConvertibleColor $this)
Convert this color to Hue-Saturation-Value
public static Ansi16 toAnsi16(ConvertibleColor $this)
Convert this color to a 16-color ANSI code
public static Ansi256 toAnsi256(ConvertibleColor $this)
Convert this color to a 256-color ANSI code
public static CMYK toCMYK(ConvertibleColor $this)
Convert this color to Cyan-Magenta-Yellow-Key
public static XYZ toXYZ(ConvertibleColor $this)
Convert this color to CIE XYZ
public static LAB toLAB(ConvertibleColor $this)
Convert this color to CIE LAB