Safe Haskell | None |
---|
- noColor8 :: Color8
- black8 :: Color8
- red8 :: Color8
- green8 :: Color8
- yellow8 :: Color8
- blue8 :: Color8
- magenta8 :: Color8
- cyan8 :: Color8
- white8 :: Color8
- noColor256 :: Color256
- grey :: Color256
- brightRed :: Color256
- brightGreen :: Color256
- brightYellow :: Color256
- brightBlue :: Color256
- brightMagenta :: Color256
- brightCyan :: Color256
- brightWhite :: Color256
- newtype Both = Both Color8
- both :: Color8 -> Both
- black :: Both
- red :: Both
- green :: Both
- yellow :: Both
- blue :: Both
- magenta :: Both
- cyan :: Both
- white :: Both
- class Color a where
8 color
Resets the color (foreground or background, as appropriate) to
the default for your terminal. Usually you will not need this, as
each Chunk
starts out with the terminal's default colors.
256 color
Resets the color (foreground or background, as appropriate) to
the default for your terminal. Usually you will not need this, as
each Chunk
starts out with the terminal's default colors.
Both 8- and 256-color terminals
Things of type Both
affect both 8- and 256-color terminals.
(They do not affect both the foreground and background.)
Changing colors. Instances of this class affect the background
or the foreground color. For example, to get a Chunk
that
changes the background to red, use
; for the
foreground, use back
red
. Whether 8-color or 256-color
terminals (or both) are affected depends on the particular
instance.
fore
red
Because Word8
is an instance of Color
, you can use literals to
affect the color of 256-color terminals. For example, if you have
a 256 color terminal:
putChunkLn $ "muddy yellow background" <> back (100 :: Word8)
This example would not affect an 8-color terminal, as the Word8
instance affects 256-color terminals only.