java.lang.Object
com.googlecode.lanterna.TextColor.RGB
- All Implemented Interfaces:
TextColor
,Serializable
- Enclosing interface:
TextColor
This class can be used to specify a color in 24-bit color space (RGB with 8-bit resolution per color). Please be
aware that only a few terminal support 24-bit color control codes, please avoid using this class unless you know
all users will have compatible terminals. For details, please see
this commit log. Behavior on terminals that don't support these codes is undefined.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.googlecode.lanterna.TextColor
TextColor.ANSI, TextColor.Factory, TextColor.Indexed, TextColor.RGB
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionRGB
(int r, int g, int b) This class can be used to specify a color in 24-bit color space (RGB with 8-bit resolution per color). -
Method Summary
Modifier and TypeMethodDescriptionboolean
byte[]
Returns the byte sequence in between CSI and character 'm' that is used to enable this color as the background color on an ANSI-compatible terminal.int
getBlue()
byte[]
Returns the byte sequence in between CSI and character 'm' that is used to enable this color as the foreground color on an ANSI-compatible terminal.int
getGreen()
int
getRed()
int
hashCode()
toColor()
Converts this color to an AWT color object, assuming a standard VGA palette.toString()
-
Field Details
-
red
private final int red -
green
private final int green -
blue
private final int blue
-
-
Constructor Details
-
RGB
public RGB(int r, int g, int b) This class can be used to specify a color in 24-bit color space (RGB with 8-bit resolution per color). Please be aware that only a few terminal support 24-bit color control codes, please avoid using this class unless you know all users will have compatible terminals. For details, please see this commit log. Behavior on terminals that don't support these codes is undefined.- Parameters:
r
- Red intensity, from 0 to 255g
- Green intensity, from 0 to 255b
- Blue intensity, from 0 to 255
-
-
Method Details
-
getForegroundSGRSequence
public byte[] getForegroundSGRSequence()Description copied from interface:TextColor
Returns the byte sequence in between CSI and character 'm' that is used to enable this color as the foreground color on an ANSI-compatible terminal.- Specified by:
getForegroundSGRSequence
in interfaceTextColor
- Returns:
- Byte array out data to output in between of CSI and 'm'
-
getBackgroundSGRSequence
public byte[] getBackgroundSGRSequence()Description copied from interface:TextColor
Returns the byte sequence in between CSI and character 'm' that is used to enable this color as the background color on an ANSI-compatible terminal.- Specified by:
getBackgroundSGRSequence
in interfaceTextColor
- Returns:
- Byte array out data to output in between of CSI and 'm'
-
getRed
public int getRed() -
getGreen
public int getGreen() -
getBlue
public int getBlue() -
toColor
Description copied from interface:TextColor
Converts this color to an AWT color object, assuming a standard VGA palette. -
toString
-
hashCode
public int hashCode() -
equals
-