Module com.googlecode.lanterna
Class TerminalEmulatorColorConfiguration
java.lang.Object
com.googlecode.lanterna.terminal.swing.TerminalEmulatorColorConfiguration
Color configuration settings to be using with SwingTerminal. This class contains color-related settings that is used
by SwingTerminal when it renders the component.
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
TerminalEmulatorColorConfiguration
(TerminalEmulatorPalette colorPalette, boolean useBrightColorsOnBold) -
Method Summary
Modifier and TypeMethodDescriptionThis is the default settings that is used when you create a new SwingTerminal without specifying any color configuration.newInstance
(TerminalEmulatorPalette colorPalette) Creates a new color configuration based on a particular palette and with using brighter colors on bold text.toAWTColor
(TextColor color, boolean isForeground, boolean inBoldContext) Deprecated.This adds a runtime dependency to the java.desktop module which isn't declared in the module descriptor of lanterna.
-
Field Details
-
colorPalette
-
useBrightColorsOnBold
private final boolean useBrightColorsOnBold
-
-
Constructor Details
-
TerminalEmulatorColorConfiguration
private TerminalEmulatorColorConfiguration(TerminalEmulatorPalette colorPalette, boolean useBrightColorsOnBold)
-
-
Method Details
-
getDefault
This is the default settings that is used when you create a new SwingTerminal without specifying any color configuration. It will use classic VGA colors for the ANSI palette and bright colors on bold text.- Returns:
- A terminal emulator color configuration object with values set to classic VGA palette
-
newInstance
Creates a new color configuration based on a particular palette and with using brighter colors on bold text.- Parameters:
colorPalette
- Palette to use for this color configuration- Returns:
- The resulting color configuration
-
toAWTColor
Deprecated.This adds a runtime dependency to the java.desktop module which isn't declared in the module descriptor of lanterna. If you want to call this method, make sure to add it to your module.Given a TextColor and a hint as to if the color is to be used as foreground or not and if we currently have bold text enabled or not, it returns the closest AWT color that matches this.- Parameters:
color
- What text color to convertisForeground
- Is the color intended to be used as foreground colorinBoldContext
- Is the color intended to be used for on a character this is bold- Returns:
- The AWT color that represents this text color
-