Copyright | (c) Alexandre Joannou 2021 |
---|---|
License | MIT |
Stability | experimental |
Safe Haskell | Safe-Inferred |
Language | GHC2021 |
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
- csi_pfx :: String
- cuu :: Show a => a -> [Char]
- cud :: Show a => a -> [Char]
- cuf :: Show a => a -> [Char]
- cub :: Show a => a -> [Char]
- cnl :: Show a => a -> [Char]
- cpl :: Show a => a -> [Char]
- cha :: Show a => a -> [Char]
- cup :: (Show a, Show a) => a -> a -> [Char]
- ed :: Show a => a -> [Char]
- el :: Show a => a -> [Char]
- su :: Show a => a -> [Char]
- sd :: Show a => a -> [Char]
- hvp :: (Show a, Show a) => a -> a -> [Char]
- sgr :: [[Char]] -> [Char]
- sgr_rst :: String
- sgr_bold :: String
- sgr_faint :: String
- sgr_italic :: String
- sgr_underline :: String
- sgr_slow_blink :: String
- sgr_rapid_blink :: String
- sgr_reverse :: String
- sgr_conceal :: String
- sgr_crossed_out :: String
- sgr_fg_color :: (Ord a, Num a, Show a) => a -> String
- sgr_bg_color :: (Ord a, Num a, Show a) => a -> String
- sgr_fg_color_8 :: Show a => a -> [Char]
- sgr_bg_color_8 :: Show a => a -> [Char]
- sgr_fg_color_24 :: Show a => a -> a -> a -> [Char]
- sgr_bg_color_24 :: Show a => a -> a -> a -> [Char]
- bold :: [Char] -> [Char]
- faint :: [Char] -> [Char]
- italic :: [Char] -> [Char]
- underline :: [Char] -> [Char]
- slow_blink :: [Char] -> [Char]
- rapid_blink :: [Char] -> [Char]
- crossed_out :: [Char] -> [Char]
- red :: [Char] -> [Char]
- green :: [Char] -> [Char]
- yellow :: [Char] -> [Char]
- blue :: [Char] -> [Char]
- magenta :: [Char] -> [Char]
- cyan :: [Char] -> [Char]
- white :: [Char] -> [Char]
Control Sequence Introducer
ANSI control sequences
Select Graphic Rendition options
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_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
slow_blink :: [Char] -> [Char] Source #
rapid_blink :: [Char] -> [Char] Source #
crossed_out :: [Char] -> [Char] Source #