rainbow-0.18.0.0: Print text to terminal with colors and effects

Safe HaskellSafe-Inferred

Rainbow.Colors

Contents

Description

Ordinarily you should not need this module; typically you will just import Rainbow, which re-exports the most useful things from this module. This module also contains data constructors that Rainbow does not re-export.

Synopsis

8 color

noColor8 :: Color8Source

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

noColor256 :: Color256Source

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

data Both Source

Things of type Both affect both 8- and 256-color terminals. (They do not affect both the foreground and background.)

Constructors

Both 

Fields

both8 :: Color8
 
both256 :: Maybe Color256

If Nothing, use the both8 color on 256-color terminals.

Instances

Eq Both 
Ord Both 
Show Both 
Color Both

Affects the foreground and background of both 8- and 256-color terminals.

class Color a whereSource

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 back red; for the foreground, use fore red. Whether 8-color or 256-color terminals (or both) are affected depends on the particular instance.

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.

Methods

back :: a -> ChunkSource

Create a Chunk that affects the background color only.

fore :: a -> ChunkSource

Create a Chunk that affects the foreground color only.

Instances

Color Word8

Affects the foreground and background of 256-color terminals.

Color Color256 
Color Color8 
Color Enum8

Affects the foreground and background of 8-color terminals.

Color Both

Affects the foreground and background of both 8- and 256-color terminals.