public class RGB implements ConvertibleColor
| Modifier and Type | Class and Description |
|---|---|
static class |
RGB.Companion |
ConvertibleColor.DefaultImpls| Modifier and Type | Field and Description |
|---|---|
static RGB.Companion |
Companion |
| Constructor and Description |
|---|
RGB(int r,
int g,
int b) |
RGB(java.lang.String hex)
Construct an RGB instance from a hex string.
|
RGB(byte r,
byte g,
byte b)
Construct an RGB instance from Byte values.
|
| Modifier and Type | Method and Description |
|---|---|
int |
component1() |
int |
component2() |
int |
component3() |
RGB |
copy(int r,
int g,
int b) |
boolean |
equals(java.lang.Object p) |
int |
getB() |
int |
getG() |
int |
getR() |
int |
hashCode() |
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)
Return this value as a hex string
|
LAB |
toLAB()
Convert this color to CIE LAB
|
RGB |
toRGB()
Convert this color to Red-Green-Blue (using sRGB color space)
|
java.lang.String |
toString() |
XYZ |
toXYZ()
Convert this color to CIE XYZ
|
public static RGB.Companion Companion
public RGB(int r,
int g,
int b)
public RGB(java.lang.String hex)
Construct an RGB instance from a hex string.
hex - An rgb hex string in the form "#ffffff" or "ffffff"public java.lang.String toHex(boolean withNumberSign)
Return this value as a hex string
"#ffffff" if withNumberSign is true,
or in the form "ffffff" otherwise.public HSL toHSL()
Convert this color to Hue-Saturation-Luminosity
public HSV toHSV()
Convert this color to Hue-Saturation-Value
public XYZ toXYZ()
Convert this color to CIE XYZ
public LAB toLAB()
Convert this color to CIE LAB
public CMYK toCMYK()
Convert this color to Cyan-Magenta-Yellow-Key
public Ansi16 toAnsi16()
Convert this color to a 16-color ANSI code
public Ansi256 toAnsi256()
Convert this color to a 256-color ANSI code
public RGB toRGB()
Convert this color to Red-Green-Blue (using sRGB color space)
public int getR()
public int getG()
public int getB()
public int component1()
public int component2()
public int component3()
public RGB copy(int r, int g, int b)
public java.lang.String toString()
public int hashCode()
public boolean equals(java.lang.Object p)