termcolor-d 0.0.1
Colorize writeln(...) output
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
termcolor-d
Hackish library use colors with writeln(...);
on POSIX.
Examples
// all below retun ANSI color codes, which most terminals will interpret correctly
C.red.fg; // Color → Red → Foreground
C.blueDark.bg; // Color → Blue (Dark) → Background
C.reset.fg; // Color → Default Color → Foreground
C.reset.bg; // Color → Default Color → Background
resetColor; // Reset foreground and background colors to default
import std.stdio : writeln;
writeln(C.green.fg, "Green text", resetColor);
writeln(C.blue.bg, "Blue", C.blueDark.bg, "Dark", resetColor);
writeln("Written in ", C.yellow.fg, "yellow color and ", C.blackDark.bg, "dark background", resetColor, "!");
dub
/// dub.json
"dependencies": {
"termcolor-d": "~>0.0.1",
...
}
/// dub.sdl
dependency "termcolor-d" version="~>0.0.1"
Shameless plugs
scone 🍞
- If you need a more fleshed out library to handle text, colors, and keyboard input.
- Registered by vladdeSV
- 0.0.1 released 6 years ago
- vladdeSV/termcolor-d
- MIT
- Copyright © 2018, Vladimirs Nordholm
- Authors:
- Dependencies:
- none
- Versions:
-
0.0.1 2018-Nov-21 ~master 2018-Nov-23 - Download Stats:
-
-
2 downloads today
-
7 downloads this week
-
9 downloads this month
-
1057 downloads total
-
- Score:
- 1.1
- Short URL:
- termcolor-d.dub.pm