Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
- 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
- data Radiant = Radiant {}
- both :: Color8 -> Radiant
- noColorRadiant :: Radiant
- black :: Radiant
- red :: Radiant
- green :: Radiant
- yellow :: Radiant
- blue :: Radiant
- magenta :: Radiant
- cyan :: Radiant
- white :: Radiant
- 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
A Radiant
affects both 8- and 256-color terminals. (It does
not necessarily affect both the foreground and background;
whether it affects the foreground, background, or both depends upon
the context in which it is used.)
noColorRadiant :: Radiant Source
A Radiant that uses the terminal's default colors for both 8- and 256-color terminals.
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.