console-colors
is a reboot of the colorize
[1] package, a library for colors in your terminal.
DUB: https://code.dlang.org/packages/console-colors
GitHub: https://github.com/p0nce/console-colors
Features:
- in-band color information like
colorize
. - 16 colors, foreground and background. Caution not all colors are adequate on various terminals.
- HTML-like tags for colors instead of VT-100 escape codes. Some chars must be escaped with entities:
>
;<
and&
, this is what theescapeCCL(string s)
function does.
import consolecolors;
cwriteln("<lblue>this is light blue</lblue>");
- 32 UFCS short functions like
.red
and.on_white
. - Colors are stacked, when you exit a color if will restore the former.
- Separate exception type for exceptions with coloured messages:
CCLException
.
Handy for nice compiler messages. - like the "colorize" package, coloured string must print through cwrite[f][ln] function.
- globally disable console colors, with
disableConsoleColors()
.