Hish-0.1.2.3

Safe HaskellSafe
LanguageHaskell2010

Hish.ANSICode

Contents

Synopsis

The ANSICode

data ANSICode Source

Encoding ANSI-code

Constructors

ESC_Bold 
ESC_Underline 
ESC_Reverse 
ESC_Reset 
ESC_Fg 

Fields

fg :: Int

foreground color

ESC_Bg 

Fields

bg :: Int

background color

ESC_Setup 

Fields

body :: (Int, Int, Int)

(foreground, background, other)

Utilities

applyANSI Source

Arguments

:: String

input string

-> ANSICode

ANSI setting

-> String 

apply ANSI setting onto the given string. For example,

>>> applyANSI "haskell" (fgCyanL <> ESC_Bold <> mempty)
"\ESC[96;1m\STXhaskell\ESC[0m\STX"

Preset colors