Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Hledger.Utils.Color
Description
Basic color helpers for prettifying console output.
Documentation
color :: ColorIntensity -> Color -> String -> String Source #
Wrap a string in ANSI codes to set and reset foreground colour.
bgColor :: ColorIntensity -> Color -> String -> String Source #
Wrap a string in ANSI codes to set and reset background colour.
ANSI's eight standard colors. They come in two intensities, which are
controlled by ColorIntensity
. Many terminals allow the colors of the
standard palette to be customised, so that, for example,
setSGR [ SetColor Foreground Vivid Green ]
may not result in bright green
characters.
Instances
Bounded Color | |
Enum Color | |
Defined in System.Console.ANSI.Types Methods succ :: Color -> Color Source # pred :: Color -> Color Source # toEnum :: Int -> Color Source # fromEnum :: Color -> Int Source # enumFrom :: Color -> [Color] Source # enumFromThen :: Color -> Color -> [Color] Source # enumFromTo :: Color -> Color -> [Color] Source # enumFromThenTo :: Color -> Color -> Color -> [Color] Source # | |
Eq Color | |
Ord Color | |
Defined in System.Console.ANSI.Types | |
Read Color | |
Show Color | |
Ix Color | |
Defined in System.Console.ANSI.Types |
data ColorIntensity Source #
ANSI's standard colors come in two intensities