TextColor
public static class TextColor.Indexed extends Object implements TextColor
Support for indexed colors is somewhat widely adopted, not as much as the ANSI colors (TextColor.ANSI) but more than the RGB (TextColor.RGB).
For more details on this, please see this commit message to Konsole.
TextColor.ANSI, TextColor.Factory, TextColor.Indexed, TextColor.RGB
Constructor | Description |
---|---|
Indexed(int colorIndex) |
Creates a new TextColor using the XTerm 256 color indexed mode, with the specified index value.
|
Modifier and Type | Method | Description |
---|---|---|
boolean |
equals(Object obj) |
|
static TextColor.Indexed |
fromRGB(int red,
int green,
int blue) |
Picks out a color approximated from the supplied RGB components
|
byte[] |
getBackgroundSGRSequence() |
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[] |
getForegroundSGRSequence() |
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() |
|
Color |
toColor() |
Converts this color to an AWT color object, assuming a standard VGA palette.
|
String |
toString() |
public Indexed(int colorIndex)
colorIndex
- Index value to use for this color.public byte[] getForegroundSGRSequence()
TextColor
getForegroundSGRSequence
in interface TextColor
public byte[] getBackgroundSGRSequence()
TextColor
getBackgroundSGRSequence
in interface TextColor
public int getRed()
public int getGreen()
public int getBlue()
public Color toColor()
TextColor
public static TextColor.Indexed fromRGB(int red, int green, int blue)
red
- Red intensity, from 0 to 255green
- Red intensity, from 0 to 255blue
- Red intensity, from 0 to 255Copyright © 2020. All rights reserved.