chapelure-0.0.1.0: A diagnostics library for Haskell
Safe HaskellNone
LanguageHaskell2010

Chapelure.Style

Description

Utilities for styling text for terminal output

Synopsis

Documentation

data Style Source #

A collection of style information. Implements Monoid

Instances

Instances details
Eq Style Source # 
Instance details

Defined in Chapelure.Style

Methods

(==) :: Style -> Style -> Bool #

(/=) :: Style -> Style -> Bool #

Show Style Source # 
Instance details

Defined in Chapelure.Style

Methods

showsPrec :: Int -> Style -> ShowS #

show :: Style -> String #

showList :: [Style] -> ShowS #

Semigroup Style Source # 
Instance details

Defined in Chapelure.Style

Methods

(<>) :: Style -> Style -> Style #

sconcat :: NonEmpty Style -> Style #

stimes :: Integral b => b -> Style -> Style #

Monoid Style Source # 
Instance details

Defined in Chapelure.Style

Methods

mempty :: Style #

mappend :: Style -> Style -> Style #

mconcat :: [Style] -> 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

Constructors

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

Instances details
Eq StyleColor Source # 
Instance details

Defined in Chapelure.Style

Show StyleColor Source # 
Instance details

Defined in Chapelure.Style

type DocText = Doc Style Source #

Styled, pretty-printed Documents

toSGR :: Style -> [SGR] Source #

Converts a Style to a list of Set Graphics Rendition SGR codes

setStyleCode :: Style -> String Source #

Converts a style to a string containing the escape codes to set that style

setStyle :: Style -> IO () Source #

Sets the graphics rendition mode of standard out to a 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