const classafTerminal::AnsiPalette

sys::Obj
  afTerminal::AnsiPalette

256 ANSI colour palette. Palettes are provided for:

  • VGA
  • Windows XP
  • Mac OS X
  • PuTTY
  • Xterm

All colours taken from Wikipedia.

get

Source

@Operator
Color get(Int index)

Gets the colour associated with the given index. index should be in the range of 0..255

index

Source

Int index(Color colour)

Returns the palette index of the given colour. Note the colour is first converted to a safe colour to ensure this method always returns a value.

mac

Source

const static AnsiPalette mac()

Creates a Mac Terminal palette.

make

Source

static new make()

Selects the palette according to your OS:

  • XP for Windows,
  • Mac for sad people,
  • XTerm for everyone else.
putty

Source

const static AnsiPalette putty()

Creates a Putty palette.

safe

Source

Color safe(Color col)

Converts the given colour to its nearest in the palette.

vga

Source

const static AnsiPalette vga()

Creates a standard VGA palette.

xp

Source

const static AnsiPalette xp()

Creates an XP CMD prompt palette.

xterm

Source

const static AnsiPalette xterm()

Creates an XTerm palette.