Class TextColor.RGB
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 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 TypeMethodDescriptionbooleanbyte[]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.intgetBlue()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.intgetGreen()intgetRed()inthashCode()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:TextColorReturns 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:
getForegroundSGRSequencein interfaceTextColor- Returns:
- Byte array out data to output in between of CSI and 'm'
-
getBackgroundSGRSequence
public byte[] getBackgroundSGRSequence()Description copied from interface:TextColorReturns 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:
getBackgroundSGRSequencein interfaceTextColor- Returns:
- Byte array out data to output in between of CSI and 'm'
-
getRed
-
getGreen
-
getBlue
-
toColor
-
toString
-
hashCode
-
equals
-