Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Escaped
- data Color
- black :: Escaped -> Escaped
- blue :: Escaped -> Escaped
- cyan :: Escaped -> Escaped
- darkGray :: Escaped -> Escaped
- green :: Escaped -> Escaped
- lightBlue :: Escaped -> Escaped
- lightCyan :: Escaped -> Escaped
- lightGray :: Escaped -> Escaped
- lightGreen :: Escaped -> Escaped
- lightMagenta :: Escaped -> Escaped
- lightRed :: Escaped -> Escaped
- lightYellow :: Escaped -> Escaped
- magenta :: Escaped -> Escaped
- red :: Escaped -> Escaped
- white :: Escaped -> Escaped
- yellow :: Escaped -> Escaped
- fg :: Color -> Escaped -> Escaped
- bg :: Color -> Escaped -> Escaped
- esc :: Escaped -> Escaped -> Escaped
- render :: Escaped -> Text
- plain :: Escaped -> Text
- visibleLength :: Escaped -> Int
- terminalRenderer :: IO (Escaped -> Text)
Documentation
Bits of escaped text
Supported colors
Default | |
Custom Int | |
Black | |
Blue | |
Cyan | |
DarkGray | |
Green | |
LightBlue | |
LightCyan | |
LightGray | |
LightGreen | |
LightMagenta | |
LightRed | |
LightYellow | |
Magenta | |
Red | |
White | |
Yellow |
lightGreen :: Escaped -> Escaped Source #
lightMagenta :: Escaped -> Escaped Source #
lightYellow :: Escaped -> Escaped Source #
esc :: Escaped -> Escaped -> Escaped Source #
Apply the given escape, then Reset
>>>
esc (FG Red) "red"
Many [FG Red,Plain "red",Reset]
render :: Escaped -> Text Source #
Render an
to actually-escaped Escaped
Text
Examples:
>>>
render "Some text via OverloadedStrings."
"Some text via OverloadedStrings."
>>>
render $ Plain "Some text."
"Some text."
>>>
render $ "Some " <> FG Red <> "red" <> Reset <> " text."
"Some \ESC[31mred\ESC[0m text."
>>>
render $ "Some " <> blue "blue" <> " text."
"Some \ESC[34mblue\ESC[0m text."
>>>
render $ "Some " <> fg (Custom 212) "color 212" <> " text."
"Some \ESC[38;5;212mcolor 212\ESC[0m text."