Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Color type and functions for specifying colors.
Documentation
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: