delete unused
[rainbowstream.git] / rainbowstream / colors.py
... / ...
CommitLineData
1def basic_color(code):
2 """
3 16 colors supported
4 """
5 def inner(text, bold=True):
6 c = code
7 if bold:
8 c = "1;%s" % c
9 return "\033[%sm%s\033[0m" % (c, text)
10 return inner
11
12
13def term_color(code):
14 """
15 256 colors supported
16 """
17 def inner(text):
18 c = code
19 return "\033[38;5;%sm%s\033[0m" % (c, text)
20 return inner
21
22
23"""
2416 basic colors
25"""
26default = basic_color('39')
27black = basic_color('30')
28red = basic_color('31')
29green = basic_color('32')
30yellow = basic_color('33')
31blue = basic_color('34')
32magenta = basic_color('35')
33cyan = basic_color('36')
34grey = basic_color('90')
35light_red = basic_color('91')
36light_green = basic_color('92')
37light_yellow = basic_color('93')
38light_blue = basic_color('94')
39light_magenta = basic_color('95')
40light_cyan = basic_color('96')
41white = basic_color('97')
42
43"""
4416 basic colors on background
45"""
46on_default = basic_color('49')
47on_black = basic_color('40')
48on_red = basic_color('41')
49on_green = basic_color('42')
50on_yellow = basic_color('43')
51on_blue = basic_color('44')
52on_magenta = basic_color('45')
53on_cyan = basic_color('46')
54on_grey = basic_color('100')
55on_light_red = basic_color('101')
56on_light_green = basic_color('102')
57on_light_yellow = basic_color('103')
58on_light_blue = basic_color('104')
59on_light_magenta = basic_color('105')
60on_light_cyan = basic_color('106')
61on_white = basic_color('107')