charva.awt

Class Color


public class Color
extends java.lang.Object

A class used to represent the color values available on a text terminal.

Field Summary

static Color
black
static Color
blue
static Color
cyan
static Color
green
static Color
magenta
static Color
red
static Color
white
static Color
yellow

Constructor Summary

Color(int red_, int green_, int blue_)
Construct a Color from the specified RGB values.

Method Summary

boolean
equals(Object obj_)
static Color
fromCursesColor(int colorval_)
Convert from an integer (ncurses-compatible) value to a Color object.
static String
getColorName(int colorval_)
Convert an ncurses color value to a color name.
int
getCursesColor()
Convert the Color object to an integer value compatible with the ncurses library.
static int
getCursesColor(Color foreground_, Color background_)
Compute the ncurses color-pair number corresponding to the specified foreground and background color.
String
toString()

Field Details

black

public static final Color black

blue

public static final Color blue

cyan

public static final Color cyan

green

public static final Color green

magenta

public static final Color magenta

red

public static final Color red

white

public static final Color white

yellow

public static final Color yellow

Constructor Details

Color

public Color(int red_,
             int green_,
             int blue_)
Construct a Color from the specified RGB values. Each value must be in the range 0-255.

Method Details

equals

public boolean equals(Object obj_)

fromCursesColor

public static Color fromCursesColor(int colorval_)
Convert from an integer (ncurses-compatible) value to a Color object.

getColorName

public static String getColorName(int colorval_)
Convert an ncurses color value to a color name.

getCursesColor

public int getCursesColor()
Convert the Color object to an integer value compatible with the ncurses library.

getCursesColor

public static int getCursesColor(Color foreground_,
                                 Color background_)
Compute the ncurses color-pair number corresponding to the specified foreground and background color.

toString

public String toString()