jackpal.androidterm.emulatorview
Class ColorScheme

java.lang.Object
  extended by jackpal.androidterm.emulatorview.ColorScheme

public class ColorScheme
extends Object

A class describing a color scheme for a 16-color VT100 terminal.

A 16-color VT100 has two separate color maps, one for foreground colors and one for background colors. Each one contains eight colors, which are traditionally found in the following order:

{ black, red, green, yellow, blue, magenta, cyan, white }

In addition, each of the foreground colors has a corresponding "bright" version. Traditionally, the "dim" white is actually a light gray, while the "bright" black is a dark gray color.

EmulatorView supports limited changes to the default color maps via the color scheme mechanism. Passing a ColorScheme to setColorScheme will cause the foreground color with map index foreColorIndex to be replaced with the provided foreColor, and the background color with map index backColorIndex to be replaced with the provided backColor. The provided colors will then become the default foreground and background colors for the EmulatorView.

See Also:
EmulatorView.setColorScheme(jackpal.androidterm.emulatorview.ColorScheme)

Constructor Summary
ColorScheme(int[] scheme)
          Creates a ColorScheme object from an array.
ColorScheme(int foreColorIndex, int foreColor, int backColorIndex, int backColor)
          Creates a ColorScheme object.
 
Method Summary
 int getBackColor()
           
 int getBackColorIndex()
           
 int getForeColor()
           
 int getForeColorIndex()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorScheme

public ColorScheme(int foreColorIndex,
                   int foreColor,
                   int backColorIndex,
                   int backColor)
Creates a ColorScheme object.

Parameters:
foreColorIndex - The VT100 color map index the foreground color should map to.
foreColor - The foreground color as an ARGB hex value.
backColorIndex - The VT100 color map index the background color should map to.
backColor - The background color as an ARGB hex value.

ColorScheme

public ColorScheme(int[] scheme)
Creates a ColorScheme object from an array.

Parameters:
scheme - An integer array { foreColorIndex, foreColor, backColorIndex, backColor }.
Method Detail

getForeColor

public int getForeColor()
Returns:
This ColorScheme's foreground color as an ARGB hex value.

getBackColor

public int getBackColor()
Returns:
This ColorScheme's background color as an ARGB hex value.

getForeColorIndex

public int getForeColorIndex()
Returns:
This ColorScheme's foreground color's VT100 color map index.

getBackColorIndex

public int getBackColorIndex()
Returns:
This ColorScheme's background color's VT100 color map index.