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.
Author:
Martin
  • Field Details

  • 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