Text.Lazy.Builder.ANSI

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

Safe Haskell | None
Language | Haskell2010

Text.Lazy.Builder.ANSI

Contents

- Foreground color
- Background color
- Style

Synopsis

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

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

Black foreground.

red :: Builder -> Builder #

Red foreground.

green :: Builder -> Builder #

Green foreground.

yellow :: Builder -> Builder #

Yellow foreground.

blue :: Builder -> Builder #

Blue foreground.

magenta :: Builder -> Builder #

Magenta foreground.

cyan :: Builder -> Builder #

Cyan foreground.

white :: Builder -> Builder #

White foreground.

brightBlack :: Builder -> Builder #

Bright black foreground.

brightRed :: Builder -> Builder #

Bright red foreground.

brightGreen :: Builder -> Builder #

Bright green foreground.

brightYellow :: Builder -> Builder #

Bright yellow foreground.

brightBlue :: Builder -> Builder #

Bright blue foreground.

brightMagenta :: Builder -> Builder #

Bright magenta foreground.

brightCyan :: Builder -> Builder #

Bright cyan foreground.

brightWhite :: Builder -> Builder #

Bright white foreground.

rgb :: Word8 -> Word8 -> Word8 -> Builder -> Builder #

RGB foreground.

# Background color

blackBg :: Builder -> Builder #

Black background.

redBg :: Builder -> Builder #

Red background.

greenBg :: Builder -> Builder #

Green background.

yellowBg :: Builder -> Builder #

Yellow background.

blueBg :: Builder -> Builder #

Blue background.

magentaBg :: Builder -> Builder #

Magenta background.

cyanBg :: Builder -> Builder #

Cyan background.

whiteBg :: Builder -> Builder #

White background.

brightBlackBg :: Builder -> Builder #

Bright black background.

brightRedBg :: Builder -> Builder #

Bright red background.

brightGreenBg :: Builder -> Builder #

Bright green background.

brightYellowBg :: Builder -> Builder #

Bright yellow background.

brightBlueBg :: Builder -> Builder #

Bright blue background.

brightMagentaBg :: Builder -> Builder #

Bright magenta background.

brightCyanBg :: Builder -> Builder #

Bright cyan background.

brightWhiteBg :: Builder -> Builder #

Bright white background.

rgbBg :: Word8 -> Word8 -> Word8 -> Builder -> Builder #

RGB background.

# Style

bold :: Builder -> Builder #

Bold style (high intensity).

faint :: Builder -> Builder #

Faint style (low intensity).

italic :: Builder -> Builder #

Italic style.

underline :: Builder -> Builder #

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

doubleUnderline :: Builder -> Builder #

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

strikethrough :: Builder -> Builder #

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

frame :: Builder -> Builder #

Frame style.

encircle :: Builder -> Builder #

Encircle style.

overline :: Builder -> Builder #

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