Class TerminalEmulatorPalette

java.lang.Object
com.googlecode.lanterna.terminal.swing.TerminalEmulatorPalette

public class TerminalEmulatorPalette extends Object
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 Details

    • GNOME_TERMINAL

      public static final TerminalEmulatorPalette GNOME_TERMINAL
      Values taken from gnome-terminal on Ubuntu
    • STANDARD_VGA

      public static final TerminalEmulatorPalette STANDARD_VGA
      Values taken from wikipedia, these are supposed to be the standard VGA palette.
    • WINDOWS_XP_COMMAND_PROMPT

      public static final TerminalEmulatorPalette WINDOWS_XP_COMMAND_PROMPT
      Values taken from wikipedia, these are supposed to be what Windows XP cmd is using.
    • MAC_OS_X_TERMINAL_APP

      public static final TerminalEmulatorPalette MAC_OS_X_TERMINAL_APP
      Values taken from wikipedia, these are supposed to be what terminal.app on MacOSX is using.
    • PUTTY

      public static final TerminalEmulatorPalette PUTTY
      Values taken from wikipedia, these are supposed to be what putty is using.
    • XTERM

      public static final TerminalEmulatorPalette XTERM
      Values taken from wikipedia, these are supposed to be what xterm is using.
    • DEFAULT

      public static final TerminalEmulatorPalette DEFAULT
      Default colors the SwingTerminal is using if you don't specify anything
    • defaultColor

      private final Color defaultColor
    • defaultBrightColor

      private final Color defaultBrightColor
    • defaultBackgroundColor

      private final Color defaultBackgroundColor
    • normalBlack

      private final Color normalBlack
    • brightBlack

      private final Color brightBlack
    • normalRed

      private final Color normalRed
    • brightRed

      private final Color brightRed
    • normalGreen

      private final Color normalGreen
    • brightGreen

      private final Color brightGreen
    • normalYellow

      private final Color normalYellow
    • brightYellow

      private final Color brightYellow
    • normalBlue

      private final Color normalBlue
    • brightBlue

      private final Color brightBlue
    • normalMagenta

      private final Color normalMagenta
    • brightMagenta

      private final Color brightMagenta
    • normalCyan

      private final Color normalCyan
    • brightCyan

      private final Color brightCyan
    • normalWhite

      private final Color normalWhite
    • brightWhite

      private final Color 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 selected
      defaultBrightColor - Default color which no specific color has been selected but bold is enabled
      defaultBackgroundColor - Default color to use for the background when no specific color has been selected
      normalBlack - Color for normal black
      brightBlack - Color for bright black
      normalRed - Color for normal red
      brightRed - Color for bright red
      normalGreen - Color for normal green
      brightGreen - Color for bright green
      normalYellow - Color for normal yellow
      brightYellow - Color for bright yellow
      normalBlue - Color for normal blue
      brightBlue - Color for bright blue
      normalMagenta - Color for normal magenta
      brightMagenta - Color for bright magenta
      normalCyan - Color for normal cyan
      brightCyan - Color for bright cyan
      normalWhite - Color for normal white
      brightWhite - Color for bright white
  • Method Details

    • get

      public Color 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.
      Parameters:
      color - Which ANSI color we want to extract
      isForeground - 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

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object