summaryrefslogtreecommitdiff
path: root/colors.py
diff options
context:
space:
mode:
Diffstat (limited to 'colors.py')
-rw-r--r--colors.py16
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 @@
1def _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
10red = _wrap_with('31')
11green = _wrap_with('32')
12yellow = _wrap_with('33')
13blue = _wrap_with('34')
14magenta = _wrap_with('35')
15cyan = _wrap_with('36')
16white = _wrap_with('37')