hledger-lib-1.3: Core data types, parsers and functionality for the hledger accounting tools

Safe Haskell | Safe
Language | Haskell2010

Hledger.Utils.Color

Description

Basic color helpers for prettifying console output.

Synopsis

- color :: ColorIntensity -> Color -> String -> String
- bgColor :: ColorIntensity -> Color -> String -> String
- data Color :: *
  - = Black
  - | Red
  - | Green
  - | Yellow
  - | Blue
  - | Magenta
  - | Cyan
  - | White
- data ColorIntensity :: *
  - = Dull
  - | Vivid

# Documentation

color :: ColorIntensity -> Color -> String -> String #

Wrap a string in ANSI codes to set and reset foreground colour.

bgColor :: ColorIntensity -> Color -> String -> String #

Wrap a string in ANSI codes to set and reset background colour.

data Color :: * #

ANSI colors: come in various intensities, which are controlled by `ColorIntensity`

Constructors

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

Instances

Bounded Color |
Methods minBound :: Color # maxBound :: Color #
Enum Color |
Methods succ :: Color -> Color # pred :: Color -> Color # toEnum :: Int -> Color # fromEnum :: Color -> Int # enumFrom :: Color -> [Color] # enumFromThen :: Color -> Color -> [Color] # enumFromTo :: Color -> Color -> [Color] # enumFromThenTo :: Color -> Color -> Color -> [Color] #
Eq Color |
Methods (==) :: Color -> Color -> Bool # (/=) :: Color -> Color -> Bool #
Ord 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 #
Read Color |
Methods readsPrec :: Int -> ReadS Color # readList :: ReadS [Color] # readPrec :: ReadPrec Color # readListPrec :: ReadPrec [Color] #
Show Color |
Methods showsPrec :: Int -> Color -> ShowS # show :: Color -> String # showList :: [Color] -> ShowS #
Ix Color |
Methods range :: (Color, Color) -> [Color] # index :: (Color, Color) -> Color -> Int # unsafeIndex :: (Color, Color) -> Color -> Int inRange :: (Color, Color) -> Color -> Bool # rangeSize :: (Color, Color) -> Int # unsafeRangeSize :: (Color, Color) -> Int

data ColorIntensity :: * #

ANSI colors come in two intensities

Constructors

Dull |
Vivid |

Instances

Bounded ColorIntensity |
Methods minBound :: ColorIntensity # maxBound :: ColorIntensity #
Enum ColorIntensity |
Methods succ :: ColorIntensity -> ColorIntensity # pred :: ColorIntensity -> ColorIntensity # toEnum :: Int -> ColorIntensity # fromEnum :: ColorIntensity -> Int # enumFrom :: ColorIntensity -> [ColorIntensity] # enumFromThen :: ColorIntensity -> ColorIntensity -> [ColorIntensity] # enumFromTo :: ColorIntensity -> ColorIntensity -> [ColorIntensity] # enumFromThenTo :: ColorIntensity -> ColorIntensity -> ColorIntensity -> [ColorIntensity] #
Eq ColorIntensity |
Methods (==) :: ColorIntensity -> ColorIntensity -> Bool # (/=) :: ColorIntensity -> ColorIntensity -> Bool #
Ord ColorIntensity |
Methods compare :: ColorIntensity -> ColorIntensity -> Ordering # (<) :: ColorIntensity -> ColorIntensity -> Bool # (<=) :: ColorIntensity -> ColorIntensity -> Bool # (>) :: ColorIntensity -> ColorIntensity -> Bool # (>=) :: ColorIntensity -> ColorIntensity -> Bool # max :: ColorIntensity -> ColorIntensity -> ColorIntensity # min :: ColorIntensity -> ColorIntensity -> ColorIntensity #
Read ColorIntensity |
Methods readsPrec :: Int -> ReadS ColorIntensity # readList :: ReadS [ColorIntensity] # readPrec :: ReadPrec ColorIntensity # readListPrec :: ReadPrec [ColorIntensity] #
Show ColorIntensity |
Methods showsPrec :: Int -> ColorIntensity -> ShowS # show :: ColorIntensity -> String # showList :: [ColorIntensity] -> ShowS #
Ix ColorIntensity |
Methods range :: (ColorIntensity, ColorIntensity) -> [ColorIntensity] # index :: (ColorIntensity, ColorIntensity) -> ColorIntensity -> Int # unsafeIndex :: (ColorIntensity, ColorIntensity) -> ColorIntensity -> Int inRange :: (ColorIntensity, ColorIntensity) -> ColorIntensity -> Bool # rangeSize :: (ColorIntensity, ColorIntensity) -> Int # unsafeRangeSize :: (ColorIntensity, ColorIntensity) -> Int