-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathcolorsprints.py
37 lines (33 loc) · 948 Bytes
/
colorsprints.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
# Some ANSI escape sequences for colours and effects
import colorama
BLACK = '\u001b[30m'
RED = '\u001b[31m'
GREEN = '\u001b[32m'
YELLOW = '\u001b[33m'
BLUE = '\u001b[34m'
MAGENTA = '\u001b[35m'
CYAN = '\u001b[36m'
WHITE = '\u001b[37m'
RESET = '\u001b[0m'
BOLD = '\u001b[1m'
UNDERLINE = '\u001b[4m'
REVERSE = '\u001b[7m'
def color(text :str,*color :str)-> None:
"""change colors of the texts
Args:
text (str): text to be colored
color (str): tells the color
"""
effects="".join(color)
print("{}{}{}".format(effects,text,RESET))
colorama.init()
color("VLALLVLMSOAUMC",BLUE, BOLD)
color("VLALLVLMSOAUMC",RED, UNDERLINE)
color("VLALLVLMSOAUMC",MAGENTA, BOLD)
color("VLALLVLMSOAUMC",GREEN, REVERSE)
#color(YELLOW,"VLALLVLMSOAUMC")
#color(CYAN,"VLALLVLMSOAUMC")
#color(BOLD,"VLALLVLMSOAUMC")
#color(UNDERLINE,"VLALLVLMSOAUMC")
#color(REVERSE,"VLALLVLMSOAUMC")
colorama.deinit()