String.ANSI

text-ansi-0.3.0.1: Text styling for ANSI terminals.

Safe Haskell | None
Language | Haskell2010

String.ANSI

Contents

- Foreground color
- Background color
- Style

Synopsis

- black :: String -> String
- red :: String -> String
- green :: String -> String
- yellow :: String -> String
- blue :: String -> String
- magenta :: String -> String
- cyan :: String -> String
- white :: String -> String
- brightBlack :: String -> String
- brightRed :: String -> String
- brightGreen :: String -> String
- brightYellow :: String -> String
- brightBlue :: String -> String
- brightMagenta :: String -> String
- brightCyan :: String -> String
- brightWhite :: String -> String
- rgb :: Word8 -> Word8 -> Word8 -> String -> String
- blackBg :: String -> String
- redBg :: String -> String
- greenBg :: String -> String
- yellowBg :: String -> String
- blueBg :: String -> String
- magentaBg :: String -> String
- cyanBg :: String -> String
- whiteBg :: String -> String
- brightBlackBg :: String -> String
- brightRedBg :: String -> String
- brightGreenBg :: String -> String
- brightYellowBg :: String -> String
- brightBlueBg :: String -> String
- brightMagentaBg :: String -> String
- brightCyanBg :: String -> String
- brightWhiteBg :: String -> String
- rgbBg :: Word8 -> Word8 -> Word8 -> String -> String
- bold :: String -> String
- faint :: String -> String
- italic :: String -> String
- underline :: String -> String
- doubleUnderline :: String -> String
- strikethrough :: String -> String
- frame :: String -> String
- encircle :: String -> String
- overline :: String -> String

# 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 #

Black foreground.

red :: String -> String #

Red foreground.

green :: String -> String #

Green foreground.

yellow :: String -> String #

Yellow foreground.

blue :: String -> String #

Blue foreground.

magenta :: String -> String #

Magenta foreground.

cyan :: String -> String #

Cyan foreground.

white :: String -> String #

White foreground.

brightBlack :: String -> String #

Bright black foreground.

brightRed :: String -> String #

Bright red foreground.

brightGreen :: String -> String #

Bright green foreground.

brightYellow :: String -> String #

Bright yellow foreground.

brightBlue :: String -> String #

Bright blue foreground.

brightMagenta :: String -> String #

Bright magenta foreground.

brightCyan :: String -> String #

Bright cyan foreground.

brightWhite :: String -> String #

Bright white foreground.

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

RGB foreground.

# Background color

blackBg :: String -> String #

Black background.

redBg :: String -> String #

Red background.

greenBg :: String -> String #

Green background.

yellowBg :: String -> String #

Yellow background.

blueBg :: String -> String #

Blue background.

magentaBg :: String -> String #

Magenta background.

cyanBg :: String -> String #

Cyan background.

whiteBg :: String -> String #

White background.

brightBlackBg :: String -> String #

Bright black background.

brightRedBg :: String -> String #

Bright red background.

brightGreenBg :: String -> String #

Bright green background.

brightYellowBg :: String -> String #

Bright yellow background.

brightBlueBg :: String -> String #

Bright blue background.

brightMagentaBg :: String -> String #

Bright magenta background.

brightCyanBg :: String -> String #

Bright cyan background.

brightWhiteBg :: String -> String #

Bright white background.

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

RGB background.

# Style

bold :: String -> String #

Bold style (high intensity).

faint :: String -> String #

Faint style (low intensity).

italic :: String -> String #

Italic style.

underline :: String -> String #

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

doubleUnderline :: String -> String #

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

strikethrough :: String -> String #

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

frame :: String -> String #

Frame style.

encircle :: String -> String #

Encircle style.

overline :: String -> String #

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