Module com.googlecode.lanterna
Class TerminalEmulatorPalette
java.lang.Object
com.googlecode.lanterna.terminal.swing.TerminalEmulatorPalette
This class specifies the palette of colors the terminal will use for the normally available 8 + 1 ANSI colors but
also their 'bright' versions with are normally enabled through bold mode. There are several palettes available, all
based on popular terminal emulators. All colors are defined in the AWT format.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Color
private final Color
private final Color
private final Color
private final Color
private final Color
private final Color
private final Color
static final TerminalEmulatorPalette
Default colors the SwingTerminal is using if you don't specify anythingprivate final Color
private final Color
private final Color
static final TerminalEmulatorPalette
Values taken from gnome-terminal on Ubuntustatic final TerminalEmulatorPalette
Values taken from wikipedia, these are supposed to be what terminal.app on MacOSX is using.private final Color
private final Color
private final Color
private final Color
private final Color
private final Color
private final Color
private final Color
static final TerminalEmulatorPalette
Values taken from wikipedia, these are supposed to be what putty is using.static final TerminalEmulatorPalette
Values taken from wikipedia, these are supposed to be the standard VGA palette.static final TerminalEmulatorPalette
Values taken from wikipedia, these are supposed to be what Windows XP cmd is using.static final TerminalEmulatorPalette
Values taken from wikipedia, these are supposed to be what xterm is using. -
Constructor Summary
ConstructorsConstructorDescriptionTerminalEmulatorPalette
(Color defaultColor, Color defaultBrightColor, Color defaultBackgroundColor, Color normalBlack, Color brightBlack, Color normalRed, Color brightRed, Color normalGreen, Color brightGreen, Color normalYellow, Color brightYellow, Color normalBlue, Color brightBlue, Color normalMagenta, Color brightMagenta, Color normalCyan, Color brightCyan, Color normalWhite, Color brightWhite) Creates a new palette with all colors specified up-front -
Method Summary
Modifier and TypeMethodDescriptionboolean
get
(TextColor.ANSI color, boolean isForeground, boolean useBrightTones) Returns the AWT color from this palette given an ANSI color and two hints for if we are looking for a background color and if we want to use the bright version.int
hashCode()
toString()
-
Field Details
-
GNOME_TERMINAL
Values taken from gnome-terminal on Ubuntu -
STANDARD_VGA
Values taken from wikipedia, these are supposed to be the standard VGA palette. -
WINDOWS_XP_COMMAND_PROMPT
Values taken from wikipedia, these are supposed to be what Windows XP cmd is using. -
MAC_OS_X_TERMINAL_APP
Values taken from wikipedia, these are supposed to be what terminal.app on MacOSX is using. -
PUTTY
Values taken from wikipedia, these are supposed to be what putty is using. -
XTERM
Values taken from wikipedia, these are supposed to be what xterm is using. -
DEFAULT
Default colors the SwingTerminal is using if you don't specify anything -
defaultColor
-
defaultBrightColor
-
defaultBackgroundColor
-
normalBlack
-
brightBlack
-
normalRed
-
brightRed
-
normalGreen
-
brightGreen
-
normalYellow
-
brightYellow
-
normalBlue
-
brightBlue
-
normalMagenta
-
brightMagenta
-
normalCyan
-
brightCyan
-
normalWhite
-
brightWhite
-
-
Constructor Details
-
TerminalEmulatorPalette
public TerminalEmulatorPalette(Color defaultColor, Color defaultBrightColor, Color defaultBackgroundColor, Color normalBlack, Color brightBlack, Color normalRed, Color brightRed, Color normalGreen, Color brightGreen, Color normalYellow, Color brightYellow, Color normalBlue, Color brightBlue, Color normalMagenta, Color brightMagenta, Color normalCyan, Color brightCyan, Color normalWhite, Color brightWhite) Creates a new palette with all colors specified up-front- Parameters:
defaultColor
- Default color which no specific color has been selecteddefaultBrightColor
- Default color which no specific color has been selected but bold is enableddefaultBackgroundColor
- Default color to use for the background when no specific color has been selectednormalBlack
- Color for normal blackbrightBlack
- Color for bright blacknormalRed
- Color for normal redbrightRed
- Color for bright rednormalGreen
- Color for normal greenbrightGreen
- Color for bright greennormalYellow
- Color for normal yellowbrightYellow
- Color for bright yellownormalBlue
- Color for normal bluebrightBlue
- Color for bright bluenormalMagenta
- Color for normal magentabrightMagenta
- Color for bright magentanormalCyan
- Color for normal cyanbrightCyan
- Color for bright cyannormalWhite
- Color for normal whitebrightWhite
- Color for bright white
-
-
Method Details
-
get
Returns the AWT color from this palette given an ANSI color and two hints for if we are looking for a background color and if we want to use the bright version.- Parameters:
color
- Which ANSI color we want to extractisForeground
- Is this color we extract going to be used as a background color?useBrightTones
- If true, we should return the bright version of the color- Returns:
- AWT color extracted from this palette for the input parameters
-
equals
-
hashCode
public int hashCode() -
toString
-