byline-0.4.0.0: Library for creating command-line interfaces (colors, menus, etc.)

Safe HaskellSafe
LanguageHaskell2010

System.Console.Byline.Color

Description

Color type and functions for specifying colors.

Synopsis

Documentation

data Color Source #

Opaque type for representing a color.

A color can be one of the eight standard terminal colors constructed with one of the named color functions (e.g., black, red, etc.) or using the rgb function.

black :: Color Source #

Standard ANSI color by name.

red :: Color Source #

Standard ANSI color by name.

green :: Color Source #

Standard ANSI color by name.

yellow :: Color Source #

Standard ANSI color by name.

blue :: Color Source #

Standard ANSI color by name.

magenta :: Color Source #

Standard ANSI color by name.

cyan :: Color Source #

Standard ANSI color by name.

white :: Color Source #

Standard ANSI color by name.

rgb :: Word8 -> Word8 -> Word8 -> Color Source #

Specify a color using a RGB triplet where each component is in the range [0 .. 255]. The actual rendered color will depend on the terminal.

If the terminal advertises that it supports 256 colors, the color given to this function will be converted to the nearest color in the 216-color pallet supported by the terminal. (216 colors because the first 16 are the standard colors and the last 24 are grayscale entries.)

However, if the terminal doesn't support extra colors, or doesn't have a TERMINFO entry (e.g., Windows) then the nearest standard color will be chosen.

Nearest colors are calculated using their CIE distance from one another.

See also: