Module com.googlecode.lanterna
Class TerminalEmulatorColorConfiguration
- java.lang.Object
-
- com.googlecode.lanterna.terminal.swing.TerminalEmulatorColorConfiguration
-
public class TerminalEmulatorColorConfiguration extends java.lang.Object
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 Modifier and Type Field Description private TerminalEmulatorPalette
colorPalette
private boolean
useBrightColorsOnBold
-
Constructor Summary
Constructors Modifier Constructor Description private
TerminalEmulatorColorConfiguration(TerminalEmulatorPalette colorPalette, boolean useBrightColorsOnBold)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static TerminalEmulatorColorConfiguration
getDefault()
This is the default settings that is used when you create a new SwingTerminal without specifying any color configuration.static TerminalEmulatorColorConfiguration
newInstance(TerminalEmulatorPalette colorPalette)
Creates a new color configuration based on a particular palette and with using brighter colors on bold text.java.awt.Color
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 Detail
-
colorPalette
private final TerminalEmulatorPalette colorPalette
-
useBrightColorsOnBold
private final boolean useBrightColorsOnBold
-
-
Constructor Detail
-
TerminalEmulatorColorConfiguration
private TerminalEmulatorColorConfiguration(TerminalEmulatorPalette colorPalette, boolean useBrightColorsOnBold)
-
-
Method Detail
-
getDefault
public static TerminalEmulatorColorConfiguration 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
public static TerminalEmulatorColorConfiguration newInstance(TerminalEmulatorPalette colorPalette)
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 public java.awt.Color 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. 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
-
-