text-ansi-0.2.1: Text styling for ANSI terminals.
Safe HaskellSafe-Inferred
LanguageHaskell2010

String.ANSI

Synopsis

Documentation

Text styling for ANSI terminals using SGR codes, as defined by the ECMA-48 standard.

Supports foreground/background color, bold/faint intensity, italic, single/double underline, strikethrough, frame, encircle, and overline escape sequences. Some styles may not work on your terminal.

Also features terminal detection, so redirecting styled output to a file will automatically strip the ANSI escape sequences.

Foreground color

black :: String -> String Source #

Black foreground.

red :: String -> String Source #

Red foreground.

green :: String -> String Source #

Green foreground.

yellow :: String -> String Source #

Yellow foreground.

blue :: String -> String Source #

Blue foreground.

magenta :: String -> String Source #

Magenta foreground.

cyan :: String -> String Source #

Cyan foreground.

white :: String -> String Source #

White foreground.

brightBlack :: String -> String Source #

Bright black foreground.

brightRed :: String -> String Source #

Bright red foreground.

brightGreen :: String -> String Source #

Bright green foreground.

brightYellow :: String -> String Source #

Bright yellow foreground.

brightBlue :: String -> String Source #

Bright blue foreground.

brightMagenta :: String -> String Source #

Bright magenta foreground.

brightCyan :: String -> String Source #

Bright cyan foreground.

brightWhite :: String -> String Source #

Bright white foreground.

rgb :: Word8 -> Word8 -> Word8 -> String -> String Source #

RGB foreground.

Background color

blackBg :: String -> String Source #

Black background.

redBg :: String -> String Source #

Red background.

greenBg :: String -> String Source #

Green background.

yellowBg :: String -> String Source #

Yellow background.

blueBg :: String -> String Source #

Blue background.

magentaBg :: String -> String Source #

Magenta background.

cyanBg :: String -> String Source #

Cyan background.

whiteBg :: String -> String Source #

White background.

brightBlackBg :: String -> String Source #

Bright black background.

brightRedBg :: String -> String Source #

Bright red background.

brightGreenBg :: String -> String Source #

Bright green background.

brightYellowBg :: String -> String Source #

Bright yellow background.

brightBlueBg :: String -> String Source #

Bright blue background.

brightMagentaBg :: String -> String Source #

Bright magenta background.

brightCyanBg :: String -> String Source #

Bright cyan background.

brightWhiteBg :: String -> String Source #

Bright white background.

rgbBg :: Word8 -> Word8 -> Word8 -> String -> String Source #

RGB background.

Style

bold :: String -> String Source #

Bold style (high intensity).

faint :: String -> String Source #

Faint style (low intensity).

italic :: String -> String Source #

Italic style.

underline :: String -> String Source #

U̲n̲d̲e̲r̲l̲i̲n̲e̲ style.

doubleUnderline :: String -> String Source #

D̳o̳u̳b̳l̳e̳ ̳u̳n̳d̳e̳r̳l̳i̳n̳e̳ style.

strikethrough :: String -> String Source #

S̶t̶r̶i̶k̶e̶t̶h̶r̶o̶u̶g̶h̶ style.

frame :: String -> String Source #

Frame style.

encircle :: String -> String Source #

Encircle style.

overline :: String -> String Source #

O̅v̅e̅r̅l̅i̅n̅e̅ style.