blarney-0.1.0.0
Copyright(c) Alexandre Joannou 2021
LicenseMIT
Stabilityexperimental
Safe HaskellSafe-Inferred
LanguageGHC2021

Blarney.Misc.ANSIEscapeSequences

Description

This module implements a few helpers to assist with rich text output in blarney. In no way is it aiming to be a complete set of commands. In fact, only some of the Control Sequence Introducer subset of commands are provided, and the limited information used was entirely leveraged from https:/en.wikipedia.orgwiki/ANSI_escape_code.

Synopsis

Control Sequence Introducer

csi_pfx :: String Source #

CSI command prefix

ANSI control sequences

cuu :: Show a => a -> [Char] Source #

cursor up by n

cud :: Show a => a -> [Char] Source #

cursor down by n

cuf :: Show a => a -> [Char] Source #

cursor forward by n

cub :: Show a => a -> [Char] Source #

cursor back by n

cnl :: Show a => a -> [Char] Source #

cursor to start of n-th next line

cpl :: Show a => a -> [Char] Source #

cursor to start of n-th previous line

cha :: Show a => a -> [Char] Source #

cursor to column n

cup :: (Show a, Show a) => a -> a -> [Char] Source #

cursor to row i column j

ed :: Show a => a -> [Char] Source #

erase in display

el :: Show a => a -> [Char] Source #

erase in line

su :: Show a => a -> [Char] Source #

scroll up

sd :: Show a => a -> [Char] Source #

scroll down

hvp :: (Show a, Show a) => a -> a -> [Char] Source #

horizontal vertical pos

sgr :: [[Char]] -> [Char] Source #

select graphic rendition

Select Graphic Rendition options

sgr_rst :: String Source #

reset graphic rendition

sgr_bold :: String Source #

set graphic rendition to bold

sgr_faint :: String Source #

set graphic rendition to faint

sgr_italic :: String Source #

set graphic rendition to italics

sgr_underline :: String Source #

set graphic rendition to underlined

sgr_slow_blink :: String Source #

set graphic rendition to slowly blinking

sgr_rapid_blink :: String Source #

set graphic rendition to rapidly blinking

sgr_reverse :: String Source #

set graphic rendition to swapped foreground and background colors

sgr_conceal :: String Source #

set graphic rendition to hidden

sgr_crossed_out :: String Source #

set graphic rendition to crossed out

sgr_fg_color :: (Ord a, Num a, Show a) => a -> String Source #

set the foreground color

sgr_bg_color :: (Ord a, Num a, Show a) => a -> String Source #

set the background color

sgr_fg_color_8 :: Show a => a -> [Char] Source #

set the 8-bit foreground color, argument value: 0- 7: standard colors (as in ESC [ 30–37 m) 8- 15: high intensity colors (as in ESC [ 90–97 m) 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) 232-255: grayscale from black to white in 24 steps

sgr_bg_color_8 :: Show a => a -> [Char] Source #

same as fg_color_8 for background color

sgr_fg_color_24 :: Show a => a -> a -> a -> [Char] Source #

set the 24-bit foreground color, with 8-bit red + green + blue component

sgr_bg_color_24 :: Show a => a -> a -> a -> [Char] Source #

set the 24-bit background color, with 8-bit red + green + blue component

String wrapper

bold :: [Char] -> [Char] Source #

faint :: [Char] -> [Char] Source #

italic :: [Char] -> [Char] Source #

red :: [Char] -> [Char] Source #

green :: [Char] -> [Char] Source #

yellow :: [Char] -> [Char] Source #

blue :: [Char] -> [Char] Source #

cyan :: [Char] -> [Char] Source #

white :: [Char] -> [Char] Source #