Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Defines the data-type which represents the physical (rather than logical) colour of the board & of pieces.
- The number of physical colours used to represent the board & pieces can be greater than the two logical colours required, but is limited in practice, since the terminal (optionally) used to render the image, typically can't cope with with a large number.
Synopsis
- data PhysicalColour
- black :: PhysicalColour
- red :: PhysicalColour
- green :: PhysicalColour
- yellow :: PhysicalColour
- blue :: PhysicalColour
- magenta :: PhysicalColour
- cyan :: PhysicalColour
- white :: PhysicalColour
- range :: [PhysicalColour]
- mkFgColourCode :: PhysicalColour -> ANSIColourCode
- mkBgColourCode :: PhysicalColour -> ANSIColourCode
- selectGraphicsRendition :: Bool -> ANSIColourCode -> String
- bracket :: String -> String -> ShowS
Types
Type-synonyms
Data-types
data PhysicalColour Source #
Defines the physical colours which can typically be rendered by a terminal.
Instances
Constants
black :: PhysicalColour Source #
Constant.
red :: PhysicalColour Source #
Constant.
green :: PhysicalColour Source #
Constant.
yellow :: PhysicalColour Source #
Constant.
blue :: PhysicalColour Source #
Constant.
magenta :: PhysicalColour Source #
Constant.
cyan :: PhysicalColour Source #
Constant.
white :: PhysicalColour Source #
Constant.
range :: [PhysicalColour] Source #
The constant complete range of values.
Functions
mkFgColourCode :: PhysicalColour -> ANSIColourCode Source #
Offset the specified colour-code, so that it applies to the foreground.
mkBgColourCode :: PhysicalColour -> ANSIColourCode Source #
Offset the specified colour-code, so that it applies to the background.
selectGraphicsRendition :: Bool -> ANSIColourCode -> String Source #
Generate the escape-sequence required to change a terminal to the specified physical colour.