From 82da382ff116aa4c4b999f072a81ffceea701c5d Mon Sep 17 00:00:00 2001 From: Oleksii Shevchuk Date: Thu, 16 Mar 2017 14:03:29 +0200 Subject: [PATCH] Add standard colors - magenta and cyan --- pupy/pupylib/utils/term.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pupy/pupylib/utils/term.py b/pupy/pupylib/utils/term.py index caa04ae9..21c47908 100644 --- a/pupy/pupylib/utils/term.py +++ b/pupy/pupylib/utils/term.py @@ -76,18 +76,24 @@ def colorize(s, color): COLOR_STOP="\033[0m" if color.lower()=="random": color=random.choice(["blue","red","green","yellow"]) + if color.lower()=="blue": res="\033[34m"+s+COLOR_STOP - if color.lower()=="red": + elif color.lower()=="red": res="\033[31m"+s+COLOR_STOP - if color.lower()=="green": + elif color.lower()=="green": res="\033[32m"+s+COLOR_STOP - if color.lower()=="yellow": + elif color.lower()=="yellow": 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 - if color.lower()=="darkgrey": + elif color.lower()=="darkgrey": res="\033[1;30m"+s+COLOR_STOP + return res def terminal_size():