-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtext.py
More file actions
99 lines (88 loc) · 3.07 KB
/
Copy pathtext.py
File metadata and controls
99 lines (88 loc) · 3.07 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
from splitcli.ux.hex_color import match_256
import re
def set_theme(is_dark=True):
global is_dark_theme
is_dark_theme = is_dark
def get_theme():
return themes.get(is_dark_theme, None)
def colored(text, color_name):
color = get_color(color_name)
return color + text + get_color("foreground")
def get_color(color_name):
theme = get_theme()
if theme == None:
return ""
if color_name in theme:
return get_color(theme[color_name])
if color_name in split_colors:
return split_colors[color_name]
if color_name in standard_colors:
return standard_colors[color_name]
return theme["foreground"]
def inquirer_theme():
return inquirer_themes.get(is_dark_theme, None)
def split_logo():
logo = split_logo_plain
logo = logo.replace("/", colored("/", "split_blue_dark"))
logo = logo.replace(",", colored(",", "split_blue_light"))
logo = logo.replace("@", colored("@", "foreground"))
return logo
split_logo_plain = """
/////
///////// @@@ @@ @@@
/////////// @@@ @@ @@@
///////////,,,,, @@@@@@ @@ @@@@@@@ @@@ @@@@@@@
/////// ,,,,,,,,,,, @@ @@ @@@@ @@@ @@@ @@ @@@
///////// ,,,,,,,,,,, @@@@@ @@ @@ @@@ @@ @@@
/////////// ,,,,,,,, @@@@ @@ @@ @@@ @@ @@@
/////////// ,,,,,,, @@@ @@@ @@@@ @@@ @@@ @@ @@@
////////,,,,,,, @@@@@@ @@ @@@@@@@ @@@ @@ @@@
,,,,,///,,, @@
,,,,,,,,, @@
,,,,
"""
split_colors = {
"split_black": match_256("333333"),
"split_blue_dark": match_256("0470ca"),
"split_blue_light": match_256("00c5fd"),
"split_green": match_256("0be4b8"),
"split_yellow": match_256("ffc825")
}
standard_colors = {
"black": "\u001b[30m",
"red": "\u001b[31m",
"green": "\u001b[32m",
"yellow": "\u001b[33m",
"blue": "\u001b[34m",
"magenta": "\u001b[35m",
"cyan": "\u001b[36m",
"white": "\u001b[37m",
"grey": "\u001b[90m",
"bright_red": "\u001b[91m",
"bright_green": "\u001b[92m",
"bright_yellow": "\u001b[93m",
"bright_blue": "\u001b[94m",
"bright_magenta": "\u001b[95m",
"bright_cyan": "\u001b[96m",
"bright_white": "\u001b[97m",
"reset": "\u001b[0",
}
is_dark_theme = True
themes = {
True: {
"foreground": "bright_white",
},
False: {
"foreground": "split_black",
}
}
inquirer_themes = {
True: {
"Question": {"mark_color": get_color("split_yellow"), "brackets_color": get_color("split_green")},
"List": {"selection_color": get_color("split_blue_light"), "selection_cursor": ">"},
},
False: {
"Question": {"mark_color": get_color("split_yellow"), "brackets_color": get_color("split_green")},
"List": {"selection_color": get_color("split_blue_dark"), "selection_cursor": ">"},
}
}