encode text color and style with a two ascii characters.
asciicolor is a protocol which encodes text color in terminals and (in future)
elsewhere using only a single ascii character: i.e.
b for black,
w for
white and
n for navy blue, etc. Capitalizing the character encodes a style
(bold for foreground, underlined for background).
See
#asciicolor.Color for all codes.
The color codes are used by
#asciicolor.style.Styler to style text
using an
AcWriter. See
#vt100.AcWriter for the reference spec.
Types: Ascii Styler
Functions
typosafe mapping of fullname -> asciichar
Create a styler
Note: pass f (file) to create the default AcWriter with the file.
Note: pass mode, stylepath to control loadStyle
Fields:
Methods
- fn level(st, add) -> st.acwriter.f:level(add)
- fn flush(st) -> st.acwriter:flush()
- fn getFB(st, style) -> fb
Get the style's fb (foreground + background asciicolor bytes)
- fn styled(st, style, str, ...)
Example: st:styled('path', 'path/to/foo.txt', '\n')
- fn write(st, ...)
write as plain