diff options
Diffstat (limited to 'colors.py')
-rw-r--r-- | colors.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/colors.py b/colors.py new file mode 100644 index 0000000..792d86f --- /dev/null +++ b/colors.py | |||
@@ -0,0 +1,16 @@ | |||
1 | def _wrap_with(code): | ||
2 | |||
3 | def inner(text, bold=False): | ||
4 | c = code | ||
5 | if bold: | ||
6 | c = "1;%s" % c | ||
7 | return "\033[%sm%s\033[0m" % (c, text) | ||
8 | return inner | ||
9 | |||
10 | red = _wrap_with('31') | ||
11 | green = _wrap_with('32') | ||
12 | yellow = _wrap_with('33') | ||
13 | blue = _wrap_with('34') | ||
14 | magenta = _wrap_with('35') | ||
15 | cyan = _wrap_with('36') | ||
16 | white = _wrap_with('37') | ||