forked from j-zunino/Wordle.py
-
Notifications
You must be signed in to change notification settings - Fork 0
/
themes.py
111 lines (86 loc) · 4.64 KB
/
themes.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
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
100
101
102
103
104
105
106
107
108
109
110
111
import dearpygui.dearpygui as dpg
BG_COLOR = 18, 18, 19
KB_COLOR = 129, 131, 132
KB_COLOR_HOVER = 141, 141, 142
KB_COLOR_ACTIVE = 148, 148, 148
CORRECT = 83, 141, 78
IN_WORD = 181, 159, 59
ABSENT = 58, 58, 60
def setup_themes():
# Main themes
with dpg.theme() as global_theme:
with dpg.theme_component(dpg.mvAll):
dpg.add_theme_style(dpg.mvStyleVar_WindowBorderSize, 0)
dpg.add_theme_style(dpg.mvStyleVar_ItemSpacing, 6, 6)
dpg.add_theme_style(dpg.mvStyleVar_WindowPadding, 20, 0)
dpg.add_theme_color(dpg.mvThemeCol_WindowBg, BG_COLOR)
dpg.add_theme_color(dpg.mvThemeCol_ChildBg, BG_COLOR)
dpg.bind_theme(global_theme)
with dpg.theme(tag="logo_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, BG_COLOR)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, BG_COLOR)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, BG_COLOR)
with dpg.theme(tag="tile_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, BG_COLOR)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, BG_COLOR)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, BG_COLOR)
dpg.add_theme_style(dpg.mvStyleVar_FrameBorderSize, 1)
with dpg.theme(tag="keyboard_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, KB_COLOR)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, KB_COLOR_HOVER)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, KB_COLOR_ACTIVE)
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 4)
# Game themes
with dpg.theme(tag="correct_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, CORRECT)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, CORRECT)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, CORRECT)
with dpg.theme(tag="in_word_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, IN_WORD)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, IN_WORD)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, IN_WORD)
with dpg.theme(tag="absent_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, ABSENT)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, ABSENT)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, ABSENT)
with dpg.theme(tag="key_correct_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, CORRECT)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, CORRECT)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, CORRECT)
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 4)
with dpg.theme(tag="key_in_word_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, IN_WORD)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, IN_WORD)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, IN_WORD)
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 4)
with dpg.theme(tag="key_absent_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, ABSENT)
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, ABSENT)
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, ABSENT)
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 4)
# Other stuff
with dpg.theme(tag="hyperlinkTheme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 4)
dpg.add_theme_color(dpg.mvThemeCol_Button, [0, 0, 0, 0])
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, [0, 0, 0, 0])
dpg.add_theme_color(
dpg.mvThemeCol_ButtonHovered, [29, 151, 236, 25])
dpg.add_theme_color(dpg.mvThemeCol_Text, (29, 151, 236))
with dpg.theme(tag="error_popup_theme"):
with dpg.theme_component(dpg.mvButton):
dpg.add_theme_color(dpg.mvThemeCol_Button, (248, 248, 248))
dpg.add_theme_color(dpg.mvThemeCol_ButtonHovered, (248, 248, 248))
dpg.add_theme_color(dpg.mvThemeCol_ButtonActive, (248, 248, 248))
dpg.add_theme_color(dpg.mvThemeCol_Text, (18, 18, 19))
dpg.add_theme_style(dpg.mvStyleVar_FrameRounding, 4)
dpg.add_theme_style(dpg.mvStyleVar_WindowPadding, 10, 10)