public class ColorPalette extends Object
| Modifier and Type | Field and Description |
|---|---|
static ColorPalette |
DEFAULT |
static String |
XTERM_INITC |
| Constructor and Description |
|---|
ColorPalette() |
ColorPalette(org.graalvm.shadowed.org.jline.terminal.Terminal terminal) |
ColorPalette(org.graalvm.shadowed.org.jline.terminal.Terminal terminal,
String distance) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canChange()
Check if the terminal has the capability to change colors.
|
int |
getColor(int index)
Get a specific color in the palette
|
protected org.graalvm.shadowed.org.jline.utils.Colors.Distance |
getDist() |
String |
getDistanceName()
Get the name of the distance to use for rounding colors.
|
int |
getLength()
Get the palette length
|
boolean |
isReal() |
boolean |
loadPalette()
Load the palette from the terminal.
|
protected void |
loadPalette(boolean doLoad) |
int |
round(int col) |
int |
round(int r,
int g,
int b) |
void |
setColor(int index,
int color)
Change the color of the palette
|
void |
setDistance(String name)
Set the name of the color distance to use when rounding RGB colors to the palette.
|
String |
toString() |
public static final String XTERM_INITC
public static final ColorPalette DEFAULT
public ColorPalette()
public ColorPalette(org.graalvm.shadowed.org.jline.terminal.Terminal terminal)
throws IOException
IOExceptionpublic ColorPalette(org.graalvm.shadowed.org.jline.terminal.Terminal terminal,
String distance)
throws IOException
IOExceptionpublic String getDistanceName()
public void setDistance(String name)
name - the name of the color distancepublic boolean canChange()
true if the terminal can change colorspublic boolean loadPalette()
throws IOException
true.true if the palette has been successfully loaded.IOExceptionprotected void loadPalette(boolean doLoad)
throws IOException
IOExceptionpublic int getLength()
public int getColor(int index)
index - the index of the colorpublic void setColor(int index,
int color)
index - the index of the colorcolor - the new color valuepublic boolean isReal()
public int round(int r,
int g,
int b)
public int round(int col)
protected org.graalvm.shadowed.org.jline.utils.Colors.Distance getDist()