Copyright | (c) Winterland 2017-2020 |
---|---|
License | BSD |
Maintainer | winterland1989@gmail.com |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Provides utilities to build code sequences https://en.wikipedia.org/wiki/ANSI_escape_code.
> putStd . bold . italicize . color Red $ "hello" hello -- bold, italicize and red
Synopsis
- bold :: Builder () -> Builder ()
- italicize :: Builder () -> Builder ()
- underline :: Builder () -> Builder ()
- color :: AnsiColor -> Builder () -> Builder ()
- color' :: AnsiColor -> AnsiColor -> Builder () -> Builder ()
- palette :: PaletteColor -> Builder () -> Builder ()
- palette' :: PaletteColor -> PaletteColor -> Builder () -> Builder ()
- rgb :: RGBColor -> Builder () -> Builder ()
- rgb' :: RGBColor -> RGBColor -> Builder () -> Builder ()
- cursorUp :: Int -> Builder ()
- cursorDown :: Int -> Builder ()
- cursorForward :: Int -> Builder ()
- cursorBackward :: Int -> Builder ()
- cursorDownLine :: Int -> Builder ()
- cursorUpLine :: Int -> Builder ()
- setCursorColumn :: Int -> Builder ()
- setCursorPosition :: Int -> Int -> Builder ()
- saveCursor :: Builder ()
- restoreCursor :: Builder ()
- clearFromCursorToScreenEnd :: Builder ()
- clearFromCursorToScreenBeginning :: Builder ()
- clearScreen :: Builder ()
- clearFromCursorToLineEnd :: Builder ()
- clearFromCursorToLineBeginning :: Builder ()
- clearLine :: Builder ()
- scrollPageUp :: Int -> Builder ()
- scrollPageDown :: Int -> Builder ()
- hideCursor :: Builder ()
- showCursor :: Builder ()
- setTitle :: Text -> Builder ()
- reset :: Builder ()
- boldIntensity :: Builder ()
- faintIntensity :: Builder ()
- resetIntensity :: Builder ()
- italicized :: Builder ()
- noItalicized :: Builder ()
- singleUnderline :: Builder ()
- doubleUnderline :: Builder ()
- noUnderline :: Builder ()
- slowBlink :: Builder ()
- rapidBlink :: Builder ()
- blinkOff :: Builder ()
- conceal :: Builder ()
- reveal :: Builder ()
- invert :: Builder ()
- invertOff :: Builder ()
- setForeground :: AnsiColor -> Builder ()
- setBrightForeground :: AnsiColor -> Builder ()
- setBackground :: AnsiColor -> Builder ()
- setBrightBackground :: AnsiColor -> Builder ()
- setPaletteForeground :: PaletteColor -> Builder ()
- setPaletteBackground :: PaletteColor -> Builder ()
- setRGBForeground :: RGBColor -> Builder ()
- setRGBBackground :: RGBColor -> Builder ()
- setDefaultForeground :: Builder ()
- setDefaultBackground :: Builder ()
- data AnsiColor
- type PaletteColor = Word8
- type RGBColor = (Word8, Word8, Word8)
- csi :: [Int] -> Builder () -> Builder ()
- sgr :: [Word8] -> Builder ()
- colorToCode :: AnsiColor -> Word8
Style modifier
color' :: AnsiColor -> AnsiColor -> Builder () -> Builder () Source #
Colorized some text with background color
palette' :: PaletteColor -> PaletteColor -> Builder () -> Builder () Source #
Colorized some text with background color
rgb' :: RGBColor -> RGBColor -> Builder () -> Builder () Source #
Colorized some text with background color
Control codes
Code to move the cursor to the specified column. The column numbering is 1-based (that is, the left-most column is numbered 1).
Code to move the cursor to the specified position (row and column). The position is 1-based (that is, the top-left corner is at row 1 column 1).
saveCursor :: Builder () Source #
restoreCursor :: Builder () Source #
clearScreen :: Builder () Source #
hideCursor :: Builder () Source #
showCursor :: Builder () Source #
XTerm control sequence to set the Icon Name and Window Title.
Style codes
boldIntensity :: Builder () Source #
faintIntensity :: Builder () Source #
resetIntensity :: Builder () Source #
italicized :: Builder () Source #
noItalicized :: Builder () Source #
singleUnderline :: Builder () Source #
doubleUnderline :: Builder () Source #
noUnderline :: Builder () Source #
rapidBlink :: Builder () Source #
MS-DOS ANSI.SYS, 150+ per minute; not widely supported
setForeground :: AnsiColor -> Builder () Source #
setBrightForeground :: AnsiColor -> Builder () Source #
setBackground :: AnsiColor -> Builder () Source #
setBrightBackground :: AnsiColor -> Builder () Source #
setPaletteForeground :: PaletteColor -> Builder () Source #
setPaletteBackground :: PaletteColor -> Builder () Source #
setRGBForeground :: RGBColor -> Builder () Source #
setRGBBackground :: RGBColor -> Builder () Source #
setDefaultForeground :: Builder () Source #
setDefaultBackground :: Builder () Source #
ANSI's eight standard colors
Instances
type PaletteColor = Word8 Source #
8-bit palette color, see https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit
Internal helper
colorToCode :: AnsiColor -> Word8 Source #