Safe Haskell | None |
---|---|
Language | Haskell2010 |
Utilities for styling text for terminal output
Synopsis
- data Style = Style {
- _intensity :: !(Maybe ConsoleIntensity)
- _italicize :: !(Maybe Bool)
- _underline :: !(Maybe Underlining)
- _negative :: !(Maybe Bool)
- _colorFG :: !(Maybe StyleColor)
- _colorBG :: !(Maybe StyleColor)
- styleIntensity :: ConsoleIntensity -> Style
- styleItalicized :: Bool -> Style
- styleUnderline :: Underlining -> Style
- styleNegative :: Bool -> Style
- styleFG :: StyleColor -> Style
- styleBG :: StyleColor -> Style
- data StyleColor
- = ColorDefault
- | Color16 !ColorIntensity !Color
- | Color256 !Word8
- | ColorRGB !(Colour Float)
- type DocText = Doc Style
- toSGR :: Style -> [SGR]
- setStyleCode :: Style -> String
- setStyle :: Style -> IO ()
- hSetStyle :: Handle -> Style -> IO ()
- renderDoc :: SimpleDocStream Style -> Text
- putDocText :: SimpleDocStream Style -> IO ()
Documentation
A collection of style information. Implements Monoid
Style | |
|
styleIntensity :: ConsoleIntensity -> Style Source #
Set the intensity of a style
styleItalicized :: Bool -> Style Source #
Set whether or not a style is italicized
styleUnderline :: Underlining -> Style Source #
Set the type of underling for a style
styleNegative :: Bool -> Style Source #
Sets negative mode for a style; this inverts the foreground and background colours
styleFG :: StyleColor -> Style Source #
Set the foreground color of a style
styleBG :: StyleColor -> Style Source #
Set the background color of a style
data StyleColor Source #
Various kinds of colors that can be used in a terminal
ColorDefault | |
Color16 !ColorIntensity !Color | A 16-colour palette: 8 hues and 2 intensities. The most commonly supported form of terminal colouring |
Color256 !Word8 | A fixed 256-color palette |
ColorRGB !(Colour Float) | Full 24-bit true colors |
Instances
Eq StyleColor Source # | |
Defined in Chapelure.Style (==) :: StyleColor -> StyleColor -> Bool # (/=) :: StyleColor -> StyleColor -> Bool # | |
Show StyleColor Source # | |
Defined in Chapelure.Style showsPrec :: Int -> StyleColor -> ShowS # show :: StyleColor -> String # showList :: [StyleColor] -> ShowS # |
setStyleCode :: Style -> String Source #
Converts a style to a string containing the escape codes to set that style
hSetStyle :: Handle -> Style -> IO () Source #
Sets the graphics rendition mode of a handle to a style
renderDoc :: SimpleDocStream Style -> Text Source #
Render a styled document stream to text, including ANSI escape codes to set the style
putDocText :: SimpleDocStream Style -> IO () Source #
Output a styled document stream to standard out