Add standard colors - magenta and cyan

This commit is contained in:
Oleksii Shevchuk 2017-03-16 14:03:29 +02:00
parent 025e2dba35
commit 82da382ff1
1 changed files with 11 additions and 5 deletions

View File

@ -76,18 +76,24 @@ def colorize(s, color):
COLOR_STOP="\033[0m" COLOR_STOP="\033[0m"
if color.lower()=="random": if color.lower()=="random":
color=random.choice(["blue","red","green","yellow"]) color=random.choice(["blue","red","green","yellow"])
if color.lower()=="blue": if color.lower()=="blue":
res="\033[34m"+s+COLOR_STOP res="\033[34m"+s+COLOR_STOP
if color.lower()=="red": elif color.lower()=="red":
res="\033[31m"+s+COLOR_STOP res="\033[31m"+s+COLOR_STOP
if color.lower()=="green": elif color.lower()=="green":
res="\033[32m"+s+COLOR_STOP res="\033[32m"+s+COLOR_STOP
if color.lower()=="yellow": elif color.lower()=="yellow":
res="\033[33m"+s+COLOR_STOP res="\033[33m"+s+COLOR_STOP
if color.lower()=="grey": elif color.lower()=="magenta":
res="\033[35m"+s+COLOR_STOP
elif color.lower()=="cyan":
res="\033[36m"+s+COLOR_STOP
elif color.lower()=="grey":
res="\033[37m"+s+COLOR_STOP res="\033[37m"+s+COLOR_STOP
if color.lower()=="darkgrey": elif color.lower()=="darkgrey":
res="\033[1;30m"+s+COLOR_STOP res="\033[1;30m"+s+COLOR_STOP
return res return res
def terminal_size(): def terminal_size():