-
Notifications
You must be signed in to change notification settings - Fork 27
/
colour.py
51 lines (48 loc) · 1.45 KB
/
colour.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
51
# -*- coding: utf-8 -*-
from method.colorama import init
from method.colorama import Fore, Back, Style, Cursor
init(autoreset=True)
# 字符串上色
class Colored:
@staticmethod
def magenta(s):
# 紫色
return Style.BRIGHT+Fore.MAGENTA+s+Fore.RESET+Style.RESET_ALL
@staticmethod
def green(s):
# 绿色
return Style.BRIGHT+Fore.GREEN+s+Fore.RESET+Style.RESET_ALL
@staticmethod
def white(s):
# 白色
return Fore.WHITE+s+Fore.RESET+Style.RESET_ALL
@staticmethod
def cyan(s):
# 青色
return Style.BRIGHT+Fore.CYAN+s+Fore.RESET+Style.RESET_ALL
@staticmethod
def cyan_fine(s):
# 青色细
return Fore.CYAN+s+Fore.RESET+Style.RESET_ALL
@staticmethod
def yellow(s):
# 黄色
return Style.BRIGHT+Fore.YELLOW+s+Fore.RESET+Style.RESET_ALL
@staticmethod
def red(s):
# 红色
return Style.BRIGHT+Fore.RED+s+Fore.RESET+Style.RESET_ALL
@staticmethod
def yel_info():
# 黄色[INFO]
return Style.BRIGHT+Fore.YELLOW+"[*] "+Fore.RESET+Style.RESET_ALL
@staticmethod
def red_warn():
# 红色[WARN]
return Style.BRIGHT+Fore.RED+"[-] "+Fore.RESET+Style.RESET_ALL
@staticmethod
def gre_ok():
# 绿色[OK]
return Style.BRIGHT+Fore.GREEN+"[+] "+Fore.RESET+Style.RESET_ALL
def Get_colour():
return Colored()