-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcolor.py
50 lines (41 loc) · 1.1 KB
/
color.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
class Colors:
"""
Represents a class that contains colors for the console
"""
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKCYAN = '\033[96m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def error(text: str):
"""
Returns the text in red color
:param text: The text to color
:type text: str
"""
return Colors.FAIL + text + Colors.ENDC
def warning(text: str):
"""
Returns the text in yellow color
:param text: The text to color
:type text: str
"""
return Colors.WARNING + text + Colors.ENDC
def ok(text: str):
"""
Returns the text in green color
:param text: The text to color
:type text: str
"""
return Colors.OKGREEN + text + Colors.ENDC
def info(text: str):
"""
Returns the text in blue color
:param text: The text to color
:type text: str
"""
return Colors.OKCYAN + text + Colors.ENDC