System.Console.Terminfo.Color

terminfo-0.4.1.2: Haskell bindings to the terminfo library.

Maintainer | judah.jacobson@gmail.com
Stability | experimental
Portability | portable (FFI)
Safe Haskell | Safe
Language | Haskell2010

System.Console.Terminfo.Color

Description

Synopsis

- termColors :: Capability Int
- data Color
  - = Black
  - | Red
  - | Green
  - | Yellow
  - | Blue
  - | Magenta
  - | Cyan
  - | White
  - | ColorNumber Int
- withForegroundColor :: TermStr s => Capability (Color -> s -> s)
- withBackgroundColor :: TermStr s => Capability (Color -> s -> s)
- setForegroundColor :: TermStr s => Capability (Color -> s)
- setBackgroundColor :: TermStr s => Capability (Color -> s)
- restoreDefaultColors :: TermStr s => Capability s

# Documentation

termColors :: Capability Int #

The maximum number of of colors on the screen.

data Color #

Constructors

Black |
Red |
Green |
Yellow |
Blue |
Magenta |
Cyan |
White |
ColorNumber Int |

Instances

Eq Color # |
Instance details Defined in System.Console.Terminfo.Color Methods (==) :: Color -> Color -> Bool # (/=) :: Color -> Color -> Bool #
Ord Color # |
Instance details Defined in System.Console.Terminfo.Color Methods compare :: Color -> Color -> Ordering # (<) :: Color -> Color -> Bool # (<=) :: Color -> Color -> Bool # (>) :: Color -> Color -> Bool # (>=) :: Color -> Color -> Bool # max :: Color -> Color -> Color # min :: Color -> Color -> Color #
Show Color # |
Instance details Defined in System.Console.Terminfo.Color Methods showsPrec :: Int -> Color -> ShowS Source # show :: Color -> String Source # showList :: [Color] -> ShowS Source #

withForegroundColor :: TermStr s => Capability (Color -> s -> s) #

This capability temporarily sets the terminal's foreground color while outputting the given text, and then restores the terminal to its default foreground and background colors.

withBackgroundColor :: TermStr s => Capability (Color -> s -> s) #

This capability temporarily sets the terminal's background color while outputting the given text, and then restores the terminal to its default foreground and background colors.

setForegroundColor :: TermStr s => Capability (Color -> s) #

Sets the foreground color of all further text output, using either the `setaf` or `setf` capability.

setBackgroundColor :: TermStr s => Capability (Color -> s) #

Sets the background color of all further text output, using either the `setab` or `setb` capability.

restoreDefaultColors :: TermStr s => Capability s #

Restores foreground/background colors to their original settings.