4#include "Misc/AppStyles.h"
16#define MAX(A, B) (((A) >= (B)) ? (A) : (B))
19static char themeName[256] =
"Custom Theme\0";
23 ImGuiStyle &style = ImGui::GetStyle();
25 style.GrabRounding = 0.f;
26 style.WindowRounding = 0.f;
27 style.ScrollbarRounding = 3.f;
28 style.FrameRounding = 3.f;
29 style.WindowTitleAlign = ImVec2(0.5f, 0.5f);
30 style.Colors[ImGuiCol_Text] = ImVec4(0.73f, 0.73f, 0.73f, 1.00f);
31 style.Colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
32 style.Colors[ImGuiCol_WindowBg] = ImVec4(0.26f, 0.26f, 0.26f, 0.95f);
34 style.Colors[ImGuiCol_PopupBg] = ImVec4(0.26f, 0.26f, 0.26f, 1.00f);
35 style.Colors[ImGuiCol_Border] = ImVec4(0.26f, 0.26f, 0.26f, 1.00f);
36 style.Colors[ImGuiCol_BorderShadow] = ImVec4(0.26f, 0.26f, 0.26f, 1.00f);
37 style.Colors[ImGuiCol_FrameBg] = ImVec4(0.16f, 0.16f, 0.16f, 1.00f);
38 style.Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.16f, 0.16f, 0.16f, 1.00f);
39 style.Colors[ImGuiCol_FrameBgActive] = ImVec4(0.16f, 0.16f, 0.16f, 1.00f);
40 style.Colors[ImGuiCol_TitleBg] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
41 style.Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
42 style.Colors[ImGuiCol_TitleBgActive] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
43 style.Colors[ImGuiCol_MenuBarBg] = ImVec4(0.26f, 0.26f, 0.26f, 1.00f);
44 style.Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.21f, 0.21f, 0.21f, 1.00f);
45 style.Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
46 style.Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
47 style.Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
49 style.Colors[ImGuiCol_CheckMark] = ImVec4(0.78f, 0.78f, 0.78f, 1.00f);
50 style.Colors[ImGuiCol_SliderGrab] = ImVec4(0.74f, 0.74f, 0.74f, 1.00f);
51 style.Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.74f, 0.74f, 0.74f, 1.00f);
52 style.Colors[ImGuiCol_Button] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
53 style.Colors[ImGuiCol_ButtonHovered] = ImVec4(0.43f, 0.43f, 0.43f, 1.00f);
54 style.Colors[ImGuiCol_ButtonActive] = ImVec4(0.11f, 0.11f, 0.11f, 1.00f);
55 style.Colors[ImGuiCol_Header] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
56 style.Colors[ImGuiCol_HeaderHovered] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
57 style.Colors[ImGuiCol_HeaderActive] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
61 style.Colors[ImGuiCol_ResizeGrip] = ImVec4(0.36f, 0.36f, 0.36f, 1.00f);
62 style.Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
63 style.Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.26f, 0.59f, 0.98f, 1.00f);
67 style.Colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
68 style.Colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
69 style.Colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
70 style.Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
71 style.Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.32f, 0.52f, 0.65f, 1.00f);
75void LoadLightOrngeStyle()
77 auto &style = ImGui::GetStyle();
78 style.WindowPadding = ImVec2(15, 15);
79 style.WindowRounding = 10.0f;
80 style.FramePadding = ImVec2(5, 5);
81 style.FrameRounding = 12.0f;
82 style.ItemSpacing = ImVec2(12, 8);
83 style.ItemInnerSpacing = ImVec2(8, 6);
84 style.IndentSpacing = 25.0f;
85 style.ScrollbarSize = 15.0f;
86 style.ScrollbarRounding = 9.0f;
87 style.GrabMinSize = 20.0f;
88 style.GrabRounding = 12.0f;
89 style.PopupRounding = 7.f;
91 ImVec4 *colors = style.Colors;
92 colors[ImGuiCol_Text] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
93 colors[ImGuiCol_TextDisabled] = ImVec4(0.32f, 0.32f, 0.32f, 1.00f);
94 colors[ImGuiCol_WindowBg] = ImVec4(0.85f, 0.85f, 0.85f, 1.00f);
95 colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
96 colors[ImGuiCol_PopupBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.98f);
97 colors[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.30f);
98 colors[ImGuiCol_BorderShadow] = ImVec4(1.00f, 1.00f, 1.00f, 0.00f);
99 colors[ImGuiCol_FrameBg] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
100 colors[ImGuiCol_FrameBgHovered] = ImVec4(0.95f, 0.95f, 0.95f, 0.30f);
101 colors[ImGuiCol_FrameBgActive] = ImVec4(0.66f, 0.66f, 0.66f, 0.67f);
102 colors[ImGuiCol_TitleBg] = ImVec4(0.96f, 0.96f, 0.96f, 1.00f);
103 colors[ImGuiCol_TitleBgActive] = ImVec4(0.82f, 0.82f, 0.82f, 1.00f);
104 colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 1.00f, 1.00f, 0.51f);
105 colors[ImGuiCol_MenuBarBg] = ImVec4(0.86f, 0.86f, 0.86f, 1.00f);
106 colors[ImGuiCol_ScrollbarBg] = ImVec4(0.98f, 0.98f, 0.98f, 0.53f);
107 colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.69f, 0.69f, 0.69f, 0.80f);
108 colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.49f, 0.49f, 0.49f, 0.80f);
109 colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.49f, 0.49f, 0.49f, 1.00f);
110 colors[ImGuiCol_CheckMark] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
111 colors[ImGuiCol_SliderGrab] = ImVec4(1.000f, 0.777f, 0.578f, 0.780f);
112 colors[ImGuiCol_SliderGrabActive] = ImVec4(1.000f, 0.987f, 0.611f, 0.600f);
113 colors[ImGuiCol_Button] = ImVec4(1.00f, 0.77f, 0.00f, 1.00f);
114 colors[ImGuiCol_ButtonHovered] = ImVec4(1.00f, 1.00f, 0.00f, 1.00f);
115 colors[ImGuiCol_ButtonActive] = ImVec4(0.84f, 0.97f, 0.01f, 1.00f);
116 colors[ImGuiCol_Header] = ImVec4(1.00f, 1.00f, 1.00f, 0.31f);
117 colors[ImGuiCol_HeaderHovered] = ImVec4(1.00f, 1.00f, 1.00f, 0.80f);
118 colors[ImGuiCol_HeaderActive] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
119 colors[ImGuiCol_Separator] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
120 colors[ImGuiCol_SeparatorHovered] = ImVec4(1.00f, 1.00f, 1.00f, 0.78f);
121 colors[ImGuiCol_SeparatorActive] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
122 colors[ImGuiCol_ResizeGrip] = ImVec4(0.80f, 0.80f, 0.80f, 0.56f);
123 colors[ImGuiCol_ResizeGripHovered] = ImVec4(1.00f, 1.00f, 1.00f, 0.67f);
124 colors[ImGuiCol_ResizeGripActive] = ImVec4(1.00f, 1.00f, 1.00f, 0.95f);
125 colors[ImGuiCol_Tab] = ImVec4(1.00f, 0.54f, 0.01f, 0.71f);
126 colors[ImGuiCol_TabHovered] = ImVec4(0.96f, 0.73f, 0.09f, 0.90f);
127 colors[ImGuiCol_TabActive] = ImVec4(1.00f, 0.97f, 0.00f, 1.00f);
128 colors[ImGuiCol_TabUnfocused] = ImVec4(0.92f, 0.93f, 0.94f, 0.99f);
129 colors[ImGuiCol_TabUnfocusedActive] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
130 colors[ImGuiCol_PlotLines] = ImVec4(0.39f, 0.39f, 0.39f, 1.00f);
131 colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
132 colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
133 colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.45f, 0.00f, 1.00f);
134 colors[ImGuiCol_TextSelectedBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.35f);
135 colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 1.00f, 0.95f);
136 colors[ImGuiCol_NavHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.80f);
137 colors[ImGuiCol_NavWindowingHighlight] = ImVec4(0.70f, 0.70f, 0.70f, 0.70f);
138 colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.20f);
139 colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.35f);
142void LoadDefaultStyle()
144 ImGuiStyle *style = &ImGui::GetStyle();
145 style->WindowPadding = ImVec2(15, 15);
146 style->WindowRounding = 5.0f;
147 style->FramePadding = ImVec2(5, 5);
148 style->FrameRounding = 4.0f;
149 style->ItemSpacing = ImVec2(12, 8);
150 style->ItemInnerSpacing = ImVec2(8, 6);
151 style->IndentSpacing = 25.0f;
152 style->ScrollbarSize = 15.0f;
153 style->ScrollbarRounding = 9.0f;
154 style->GrabMinSize = 5.0f;
155 style->GrabRounding = 3.0f;
156 style->WindowBorderSize = 0;
157 style->ChildBorderSize = 0;
158 style->PopupBorderSize = 0;
159 style->FrameBorderSize = 0;
160 style->TabBorderSize = 0;
161 style->Colors[ImGuiCol_Text] = ImVec4(0.80f, 0.80f, 0.83f, 1.00f);
162 style->Colors[ImGuiCol_TextDisabled] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
163 style->Colors[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
164 style->Colors[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
165 style->Colors[ImGuiCol_Border] = ImVec4(0.80f, 0.80f, 0.83f, 0.88f);
166 style->Colors[ImGuiCol_BorderShadow] = ImVec4(0.92f, 0.91f, 0.88f, 0.00f);
167 style->Colors[ImGuiCol_FrameBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
168 style->Colors[ImGuiCol_FrameBgHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
169 style->Colors[ImGuiCol_FrameBgActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
170 style->Colors[ImGuiCol_TitleBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
171 style->Colors[ImGuiCol_TitleBgCollapsed] = ImVec4(1.00f, 0.98f, 0.95f, 0.75f);
172 style->Colors[ImGuiCol_TitleBgActive] = ImVec4(0.07f, 0.07f, 0.09f, 1.00f);
173 style->Colors[ImGuiCol_MenuBarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
174 style->Colors[ImGuiCol_ScrollbarBg] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
175 style->Colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
176 style->Colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
177 style->Colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
178 style->Colors[ImGuiCol_CheckMark] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
179 style->Colors[ImGuiCol_SliderGrab] = ImVec4(0.80f, 0.80f, 0.83f, 0.31f);
180 style->Colors[ImGuiCol_SliderGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
181 style->Colors[ImGuiCol_Button] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
182 style->Colors[ImGuiCol_ButtonHovered] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f);
183 style->Colors[ImGuiCol_ButtonActive] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
184 style->Colors[ImGuiCol_Header] = ImVec4(0.10f, 0.09f, 0.12f, 1.00f);
185 style->Colors[ImGuiCol_HeaderHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
186 style->Colors[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
187 style->Colors[ImGuiCol_ResizeGrip] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
188 style->Colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.56f, 0.56f, 0.58f, 1.00f);
189 style->Colors[ImGuiCol_ResizeGripActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.00f);
190 style->Colors[ImGuiCol_PlotLines] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
191 style->Colors[ImGuiCol_PlotLinesHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
192 style->Colors[ImGuiCol_PlotHistogram] = ImVec4(0.40f, 0.39f, 0.38f, 0.63f);
193 style->Colors[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.00f, 0.00f, 1.00f);
194 style->Colors[ImGuiCol_TextSelectedBg] = ImVec4(0.25f, 1.00f, 0.00f, 0.43f);
195 ImVec4 *colors = ImGui::GetStyle().Colors;
196 colors[ImGuiCol_Tab] = ImVec4(0.146f, 0.113f, 0.146f, 0.86f);
197 colors[ImGuiCol_TabHovered] = ImVec4(0.364f, 0.205f, 0.366f, 0.80f);
198 colors[ImGuiCol_TabActive] = ImVec4(51.0f / 255, 31.0f / 255, 49.0f / 255, 0.97f);
199 colors[ImGuiCol_TabUnfocused] = ImVec4(51.0f / 255, 31.0f / 255, 49.0f / 255, 0.57f);
200 colors[ImGuiCol_Header] = ImVec4(0.61f, 0.61f, 0.62f, 0.22f);
201 colors[ImGuiCol_HeaderHovered] = ImVec4(0.61f, 0.62f, 0.62f, 0.51f);
202 colors[ImGuiCol_HeaderActive] = ImVec4(0.61f, 0.62f, 0.62f, 0.83f);
203 colors[ImGuiCol_TabUnfocused] = ImVec4(43.0f/255, 17.0f/255, 43.0f/255, 0.97f);
204 colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.202f, 0.116f, 0.196f, 0.57f);
207void LoadDarkCoolStyle()
209 ImVec4 *colors = ImGui::GetStyle().Colors;
210 colors[ImGuiCol_Text] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
211 colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
212 colors[ImGuiCol_WindowBg] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
213 colors[ImGuiCol_ChildBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.00f);
214 colors[ImGuiCol_PopupBg] = ImVec4(0.29f, 0.29f, 0.29f, 0.92f);
215 colors[ImGuiCol_Border] = ImVec4(0.19f, 0.19f, 0.19f, 0.29f);
216 colors[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.24f);
217 colors[ImGuiCol_FrameBg] = ImVec4(0.05f, 0.05f, 0.05f, 0.54f);
218 colors[ImGuiCol_FrameBgHovered] = ImVec4(0.59f, 0.59f, 0.59f, 0.54f);
219 colors[ImGuiCol_FrameBgActive] = ImVec4(0.20f, 0.22f, 0.23f, 1.00f);
220 colors[ImGuiCol_TitleBg] = ImVec4(0.08f, 0.08f, 0.08f, 1.00f);
221 colors[ImGuiCol_TitleBgActive] = ImVec4(0.06f, 0.06f, 0.06f, 1.00f);
222 colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
223 colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
224 colors[ImGuiCol_ScrollbarBg] = ImVec4(0.05f, 0.05f, 0.05f, 0.54f);
225 colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.34f, 0.34f, 0.34f, 0.54f);
226 colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.40f, 0.40f, 0.40f, 0.54f);
227 colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.56f, 0.56f, 0.56f, 0.54f);
228 colors[ImGuiCol_CheckMark] = ImVec4(0.33f, 0.67f, 0.86f, 1.00f);
229 colors[ImGuiCol_SliderGrab] = ImVec4(0.34f, 0.34f, 0.34f, 0.54f);
230 colors[ImGuiCol_SliderGrabActive] = ImVec4(0.56f, 0.56f, 0.56f, 0.54f);
231 colors[ImGuiCol_Button] = ImVec4(0.05f, 0.05f, 0.05f, 0.54f);
232 colors[ImGuiCol_ButtonHovered] = ImVec4(0.19f, 0.19f, 0.19f, 0.54f);
233 colors[ImGuiCol_ButtonActive] = ImVec4(0.20f, 0.22f, 0.23f, 1.00f);
234 colors[ImGuiCol_Header] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
235 colors[ImGuiCol_HeaderHovered] = ImVec4(0.00f, 0.00f, 0.00f, 0.36f);
236 colors[ImGuiCol_HeaderActive] = ImVec4(0.20f, 0.22f, 0.23f, 0.33f);
237 colors[ImGuiCol_Separator] = ImVec4(0.28f, 0.28f, 0.28f, 0.29f);
238 colors[ImGuiCol_SeparatorHovered] = ImVec4(0.44f, 0.44f, 0.44f, 0.29f);
239 colors[ImGuiCol_SeparatorActive] = ImVec4(0.40f, 0.44f, 0.47f, 1.00f);
240 colors[ImGuiCol_ResizeGrip] = ImVec4(0.28f, 0.28f, 0.28f, 0.29f);
241 colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.44f, 0.44f, 0.44f, 0.29f);
242 colors[ImGuiCol_ResizeGripActive] = ImVec4(0.40f, 0.44f, 0.47f, 1.00f);
243 colors[ImGuiCol_Tab] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
244 colors[ImGuiCol_TabHovered] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
245 colors[ImGuiCol_TabActive] = ImVec4(0.20f, 0.20f, 0.20f, 0.36f);
246 colors[ImGuiCol_TabUnfocused] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
247 colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
248 colors[ImGuiCol_DockingPreview] = ImVec4(0.33f, 0.67f, 0.86f, 1.00f);
249 colors[ImGuiCol_DockingEmptyBg] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
250 colors[ImGuiCol_PlotLines] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
251 colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
252 colors[ImGuiCol_PlotHistogram] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
253 colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
254 colors[ImGuiCol_TableHeaderBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
255 colors[ImGuiCol_TableBorderStrong] = ImVec4(0.00f, 0.00f, 0.00f, 0.52f);
256 colors[ImGuiCol_TableBorderLight] = ImVec4(0.28f, 0.28f, 0.28f, 0.29f);
257 colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
258 colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f);
259 colors[ImGuiCol_TextSelectedBg] = ImVec4(0.20f, 0.22f, 0.23f, 1.00f);
260 colors[ImGuiCol_DragDropTarget] = ImVec4(0.33f, 0.67f, 0.86f, 1.00f);
261 colors[ImGuiCol_NavHighlight] = ImVec4(1.00f, 0.00f, 0.00f, 1.00f);
262 colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 0.00f, 0.00f, 0.70f);
263 colors[ImGuiCol_NavWindowingDimBg] = ImVec4(1.00f, 0.00f, 0.00f, 0.20f);
264 colors[ImGuiCol_ModalWindowDimBg] = ImVec4(1.00f, 0.00f, 0.00f, 0.35f);
265 ImGuiStyle &style = ImGui::GetStyle();
266 style.WindowPadding = ImVec2(8.00f, 8.00f);
267 style.FramePadding = ImVec2(5.00f, 2.00f);
268 style.CellPadding = ImVec2(6.00f, 6.00f);
269 style.ItemSpacing = ImVec2(6.00f, 6.00f);
270 style.ItemInnerSpacing = ImVec2(6.00f, 6.00f);
271 style.TouchExtraPadding = ImVec2(0.00f, 0.00f);
272 style.IndentSpacing = 25;
273 style.ScrollbarSize = 15;
274 style.GrabMinSize = 10;
275 style.WindowBorderSize = 1;
276 style.ChildBorderSize = 1;
277 style.PopupBorderSize = 1;
278 style.FrameBorderSize = 1;
279 style.TabBorderSize = 1;
280 style.WindowRounding = 8;
281 style.ChildRounding = 6;
282 style.FrameRounding = 4;
283 style.PopupRounding = 7;
284 style.ScrollbarRounding = 9;
285 style.GrabRounding = 3;
286 style.LogSliderDeadzone = 4;
287 style.TabRounding = 6;
290void LoadBlackAndWhite()
292 ImVec4 *colors = ImGui::GetStyle().Colors;
293 colors[ImGuiCol_Text] = ImVec4(0.78f, 0.78f, 0.78f, 1.00f);
294 colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
295 colors[ImGuiCol_WindowBg] = ImVec4(0.10f, 0.10f, 0.10f, 1.00f);
296 colors[ImGuiCol_ChildBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.00f);
297 colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f);
298 colors[ImGuiCol_Border] = ImVec4(0.43f, 0.43f, 0.50f, 0.50f);
299 colors[ImGuiCol_BorderShadow] = ImVec4(0.04f, 0.04f, 0.04f, 1.00f);
300 colors[ImGuiCol_FrameBg] = ImVec4(0.20f, 0.20f, 0.20f, 0.88f);
301 colors[ImGuiCol_FrameBgHovered] = ImVec4(0.45f, 0.46f, 0.46f, 0.40f);
302 colors[ImGuiCol_FrameBgActive] = ImVec4(0.35f, 0.36f, 0.37f, 0.67f);
303 colors[ImGuiCol_TitleBg] = ImVec4(0.10f, 0.10f, 0.10f, 1.00f);
304 colors[ImGuiCol_TitleBgActive] = ImVec4(0.34f, 0.34f, 0.34f, 1.00f);
305 colors[ImGuiCol_TitleBgCollapsed] = ImVec4(0.00f, 0.00f, 0.00f, 0.51f);
306 colors[ImGuiCol_MenuBarBg] = ImVec4(0.14f, 0.14f, 0.14f, 1.00f);
307 colors[ImGuiCol_ScrollbarBg] = ImVec4(0.16f, 0.16f, 0.16f, 0.53f);
308 colors[ImGuiCol_ScrollbarGrab] = ImVec4(0.31f, 0.31f, 0.31f, 1.00f);
309 colors[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.41f, 0.41f, 0.41f, 1.00f);
310 colors[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f);
311 colors[ImGuiCol_CheckMark] = ImVec4(0.51f, 0.51f, 0.51f, 1.00f);
312 colors[ImGuiCol_SliderGrab] = ImVec4(0.60f, 0.61f, 0.62f, 1.00f);
313 colors[ImGuiCol_SliderGrabActive] = ImVec4(0.37f, 0.37f, 0.37f, 1.00f);
314 colors[ImGuiCol_Button] = ImVec4(0.49f, 0.51f, 0.52f, 0.40f);
315 colors[ImGuiCol_ButtonHovered] = ImVec4(0.53f, 0.53f, 0.54f, 0.84f);
316 colors[ImGuiCol_ButtonActive] = ImVec4(0.00f, 0.00f, 0.00f, 1.00f);
317 colors[ImGuiCol_Header] = ImVec4(0.61f, 0.61f, 0.62f, 0.22f);
318 colors[ImGuiCol_HeaderHovered] = ImVec4(0.61f, 0.62f, 0.62f, 0.51f);
319 colors[ImGuiCol_HeaderActive] = ImVec4(0.61f, 0.62f, 0.62f, 0.83f);
320 colors[ImGuiCol_Separator] = ImVec4(0.44f, 0.44f, 0.44f, 0.50f);
321 colors[ImGuiCol_SeparatorHovered] = ImVec4(0.00f, 0.00f, 0.00f, 0.78f);
322 colors[ImGuiCol_SeparatorActive] = ImVec4(0.29f, 0.29f, 0.29f, 1.00f);
323 colors[ImGuiCol_ResizeGrip] = ImVec4(1.00f, 1.00f, 1.00f, 0.20f);
324 colors[ImGuiCol_ResizeGripHovered] = ImVec4(0.61f, 0.61f, 0.61f, 0.67f);
325 colors[ImGuiCol_ResizeGripActive] = ImVec4(0.23f, 0.23f, 0.23f, 0.95f);
326 colors[ImGuiCol_Tab] = ImVec4(0.22f, 0.22f, 0.22f, 0.86f);
327 colors[ImGuiCol_TabHovered] = ImVec4(0.57f, 0.57f, 0.57f, 0.80f);
328 colors[ImGuiCol_TabActive] = ImVec4(0.47f, 0.47f, 0.47f, 1.00f);
329 colors[ImGuiCol_TabUnfocused] = ImVec4(0.11f, 0.11f, 0.11f, 0.97f);
330 colors[ImGuiCol_TabUnfocusedActive] = ImVec4(0.21f, 0.21f, 0.21f, 1.00f);
331 colors[ImGuiCol_DockingPreview] = ImVec4(0.00f, 0.00f, 0.00f, 0.70f);
332 colors[ImGuiCol_DockingEmptyBg] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
333 colors[ImGuiCol_PlotLines] = ImVec4(0.61f, 0.61f, 0.61f, 1.00f);
334 colors[ImGuiCol_PlotLinesHovered] = ImVec4(1.00f, 0.43f, 0.35f, 1.00f);
335 colors[ImGuiCol_PlotHistogram] = ImVec4(0.90f, 0.70f, 0.00f, 1.00f);
336 colors[ImGuiCol_PlotHistogramHovered] = ImVec4(1.00f, 0.60f, 0.00f, 1.00f);
337 colors[ImGuiCol_TableHeaderBg] = ImVec4(0.19f, 0.19f, 0.20f, 1.00f);
338 colors[ImGuiCol_TableBorderStrong] = ImVec4(0.31f, 0.31f, 0.35f, 1.00f);
339 colors[ImGuiCol_TableBorderLight] = ImVec4(0.23f, 0.23f, 0.25f, 1.00f);
340 colors[ImGuiCol_TableRowBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
341 colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.06f);
342 colors[ImGuiCol_TextSelectedBg] = ImVec4(0.59f, 0.59f, 0.59f, 0.35f);
343 colors[ImGuiCol_DragDropTarget] = ImVec4(1.00f, 1.00f, 1.00f, 1.00f);
344 colors[ImGuiCol_NavHighlight] = ImVec4(0.46f, 0.46f, 0.46f, 1.00f);
345 colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f);
346 colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f);
347 colors[ImGuiCol_ModalWindowDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.35f);
348 ImGuiStyle &style = ImGui::GetStyle();
349 style.WindowPadding = ImVec2(12.00f, 12.00f);
350 style.FramePadding = ImVec2(10.00f, 10.00f);
351 style.CellPadding = ImVec2(6.00f, 6.00f);
352 style.ItemSpacing = ImVec2(6.00f, 6.00f);
353 style.ItemInnerSpacing = ImVec2(6.00f, 6.00f);
354 style.TouchExtraPadding = ImVec2(0.00f, 0.00f);
355 style.IndentSpacing = 25;
356 style.ScrollbarSize = 15;
357 style.GrabMinSize = 10;
358 style.WindowBorderSize = 0;
359 style.ChildBorderSize = 0;
360 style.PopupBorderSize = 0;
361 style.FrameBorderSize = 0;
362 style.TabBorderSize = 0;
363 style.WindowRounding = 8;
364 style.ChildRounding = 6;
365 style.FrameRounding = 10;
366 style.PopupRounding = 7;
367 style.ScrollbarRounding = 9;
368 style.GrabRounding = 9;
369 style.LogSliderDeadzone = 4;
370 style.TabRounding = 6;
371 style.WindowMenuButtonPosition = 0;
374std::string GetStyleData()
377 output[
"type"] =
"THEME";
382 ImGuiStyle &style = ImGui::GetStyle();
384 for (
int i = 0; i < ImGuiCol_COUNT; i++)
386 const ImVec4 &col = style.Colors[i];
387 const char *name = ImGui::GetStyleColorName(i);
393 colors[std::to_string(i)] = color;
396 output[
"colors"] = colors;
397 tmp[
"x"] = style.FramePadding.x;
398 tmp[
"y"] = style.FramePadding.y;
399 styles[
"FramePadding"] = tmp;
400 tmp[
"x"] = style.WindowPadding.x;
401 tmp[
"y"] = style.WindowPadding.y;
402 styles[
"WindowPadding"] = tmp;
403 tmp[
"x"] = style.ItemSpacing.x;
404 tmp[
"y"] = style.ItemSpacing.y;
405 styles[
"ItemSpacing"] = tmp;
406 tmp[
"x"] = style.ItemInnerSpacing.x;
407 tmp[
"y"] = style.ItemInnerSpacing.y;
408 styles[
"WindowPadding"] = tmp;
409 styles[
"WindowRounding"] = style.WindowRounding;
410 styles[
"FrameRounding"] = style.FrameRounding;
411 styles[
"IndentSpacing"] = style.IndentSpacing;
412 styles[
"ScrollbarSize"] = style.ScrollbarSize;
413 styles[
"ScrollbarRounding"] = style.ScrollbarRounding;
414 styles[
"GrabMinSize"] = style.GrabMinSize;
415 styles[
"GrabRounding"] = style.GrabRounding;
416 styles[
"WindowBorderSize"] = style.WindowBorderSize;
417 styles[
"ChildBorderSize"] = style.ChildBorderSize;
418 styles[
"FrameBorderSize"] = style.FrameBorderSize;
419 styles[
"TabBorderSize"] = style.TabBorderSize;
420 output[
"styles"] = styles;
421 output[
"themeName"] = themeName;
428static bool ImportImGuiSettings(std::string settings)
434 if (std::string(theme[
"type"]) !=
"THEME")
439 ImGuiStyle &style = ImGui::GetStyle();
441 for (
int i = 0; i < ImGuiCol_COUNT; i++)
443 style.Colors[i] = ImVec4((
float)(theme[
"colors"][std::to_string(i)][
"x"]), (
float)(theme[
"colors"][std::to_string(i)][
"y"]), (
float)(theme[
"colors"][std::to_string(i)][
"z"]), (
float)(theme[
"colors"][std::to_string(i)][
"w"]));
446 theme = theme[
"styles"];
447 style.FramePadding = ImVec2(theme[
"FramePadding"][
"x"], theme[
"FramePadding"][
"x"]);
448 style.WindowPadding = ImVec2(theme[
"WindowPadding"][
"x"], theme[
"WindowPadding"][
"x"]);
449 style.ItemSpacing = ImVec2(theme[
"ItemSpacing"][
"x"], theme[
"ItemSpacing"][
"x"]);
450 style.WindowPadding = ImVec2(theme[
"WindowPadding"][
"x"], theme[
"WindowPadding"][
"x"]);
451 style.WindowRounding = theme[
"WindowRounding"];
452 style.FrameRounding = theme[
"FrameRounding"];
453 style.IndentSpacing = theme[
"IndentSpacing"];
454 style.ScrollbarSize = theme[
"ScrollbarSize"];
455 style.ScrollbarRounding = theme[
"ScrollbarRounding"];
456 style.GrabMinSize = theme[
"GrabMinSize"];
457 style.GrabRounding = theme[
"GrabRounding"];
458 style.WindowBorderSize = theme[
"WindowBorderSize"];
459 style.ChildBorderSize = theme[
"ChildBorderSize"];
460 style.FrameBorderSize = theme[
"FrameBorderSize"];
461 style.TabBorderSize = theme[
"TabBorderSize"];
472bool LoadThemeFromStr(std::string data)
474 return ImportImGuiSettings(data);
477bool LoadThemeFromFile(std::string filename)
479 std::fstream newfile;
480 newfile.open(filename.c_str(), std::ios::in);
482 if (newfile.is_open())
485 std::string res =
"";
486 getline(newfile, res,
'\0');
488 return ImportImGuiSettings(res);
495void ShowStyleEditor(
bool *pOpen)
497 ImGuiStyle *ref = NULL;
498 ImGui::Begin(
"Theme Editor", pOpen);
501 ImGuiStyle &style = ImGui::GetStyle();
502 static ImGuiStyle ref_saved_style;
504 static bool init =
true;
506 if (init && ref == NULL)
508 ref_saved_style = style;
515 ref = &ref_saved_style;
518 ImGui::PushItemWidth(ImGui::GetWindowWidth() * 0.50f);
519 ImGui::InputText(
"Theme Name", themeName, 256);
522 if (ImGui::SliderFloat(
"FrameRounding", &style.FrameRounding, 0.0f, 12.0f,
"%.0f"))
524 style.GrabRounding = style.FrameRounding;
528 bool border = (style.WindowBorderSize > 0.0f);
530 if (ImGui::Checkbox(
"WindowBorder", &border))
532 style.WindowBorderSize = border ? 1.0f : 0.0f;
538 bool border = (style.FrameBorderSize > 0.0f);
540 if (ImGui::Checkbox(
"FrameBorder", &border))
542 style.FrameBorderSize = border ? 1.0f : 0.0f;
547 bool border = (style.PopupBorderSize > 0.0f);
549 if (ImGui::Checkbox(
"PopupBorder", &border))
551 style.PopupBorderSize = border ? 1.0f : 0.0f;
556 if (ImGui::BeginTabBar(
"##tabs", ImGuiTabBarFlags_None))
558 if (ImGui::BeginTabItem(
"Sizes"))
561 ImGui::SliderFloat2(
"WindowPadding", (
float *)&style.WindowPadding, 0.0f, 20.0f,
"%.0f");
562 ImGui::SliderFloat2(
"FramePadding", (
float *)&style.FramePadding, 0.0f, 20.0f,
"%.0f");
563 ImGui::SliderFloat2(
"CellPadding", (
float *)&style.CellPadding, 0.0f, 20.0f,
"%.0f");
564 ImGui::SliderFloat2(
"ItemSpacing", (
float *)&style.ItemSpacing, 0.0f, 20.0f,
"%.0f");
565 ImGui::SliderFloat2(
"ItemInnerSpacing", (
float *)&style.ItemInnerSpacing, 0.0f, 20.0f,
"%.0f");
566 ImGui::SliderFloat2(
"TouchExtraPadding", (
float *)&style.TouchExtraPadding, 0.0f, 10.0f,
"%.0f");
567 ImGui::SliderFloat(
"IndentSpacing", &style.IndentSpacing, 0.0f, 30.0f,
"%.0f");
568 ImGui::SliderFloat(
"ScrollbarSize", &style.ScrollbarSize, 1.0f, 20.0f,
"%.0f");
569 ImGui::SliderFloat(
"GrabMinSize", &style.GrabMinSize, 1.0f, 20.0f,
"%.0f");
570 ImGui::Text(
"Borders");
571 ImGui::SliderFloat(
"WindowBorderSize", &style.WindowBorderSize, 0.0f, 1.0f,
"%.0f");
572 ImGui::SliderFloat(
"ChildBorderSize", &style.ChildBorderSize, 0.0f, 1.0f,
"%.0f");
573 ImGui::SliderFloat(
"PopupBorderSize", &style.PopupBorderSize, 0.0f, 1.0f,
"%.0f");
574 ImGui::SliderFloat(
"FrameBorderSize", &style.FrameBorderSize, 0.0f, 1.0f,
"%.0f");
575 ImGui::SliderFloat(
"TabBorderSize", &style.TabBorderSize, 0.0f, 1.0f,
"%.0f");
576 ImGui::Text(
"Rounding");
577 ImGui::SliderFloat(
"WindowRounding", &style.WindowRounding, 0.0f, 12.0f,
"%.0f");
578 ImGui::SliderFloat(
"ChildRounding", &style.ChildRounding, 0.0f, 12.0f,
"%.0f");
579 ImGui::SliderFloat(
"FrameRounding", &style.FrameRounding, 0.0f, 12.0f,
"%.0f");
580 ImGui::SliderFloat(
"PopupRounding", &style.PopupRounding, 0.0f, 12.0f,
"%.0f");
581 ImGui::SliderFloat(
"ScrollbarRounding", &style.ScrollbarRounding, 0.0f, 12.0f,
"%.0f");
582 ImGui::SliderFloat(
"GrabRounding", &style.GrabRounding, 0.0f, 12.0f,
"%.0f");
583 ImGui::SliderFloat(
"LogSliderDeadzone", &style.LogSliderDeadzone, 0.0f, 12.0f,
"%.0f");
584 ImGui::SliderFloat(
"TabRounding", &style.TabRounding, 0.0f, 12.0f,
"%.0f");
585 ImGui::Text(
"Alignment");
586 ImGui::SliderFloat2(
"WindowTitleAlign", (
float *)&style.WindowTitleAlign, 0.0f, 1.0f,
"%.2f");
587 int window_menu_button_position = style.WindowMenuButtonPosition + 1;
589 if (ImGui::Combo(
"WindowMenuButtonPosition", (
int *)&window_menu_button_position,
"None\0Left\0Right\0"))
591 style.WindowMenuButtonPosition = window_menu_button_position - 1;
594 ImGui::Combo(
"ColorButtonPosition", (
int *)&style.ColorButtonPosition,
"Left\0Right\0");
595 ImGui::SliderFloat2(
"ButtonTextAlign", (
float *)&style.ButtonTextAlign, 0.0f, 1.0f,
"%.2f");
597 ImGui::SliderFloat2(
"SelectableTextAlign", (
float *)&style.SelectableTextAlign, 0.0f, 1.0f,
"%.2f");
599 ImGui::Text(
"Safe Area Padding");
601 ImGui::SliderFloat2(
"DisplaySafeAreaPadding", (
float *)&style.DisplaySafeAreaPadding, 0.0f, 30.0f,
"%.0f");
605 if (ImGui::BeginTabItem(
"Colors"))
607 static int output_dest = 0;
608 static bool output_only_modified =
true;
609 static ImGuiTextFilter filter;
610 filter.Draw(
"Filter colors", ImGui::GetFontSize() * 16);
611 static ImGuiColorEditFlags alpha_flags = 0;
613 if (ImGui::RadioButton(
"Opaque", alpha_flags == ImGuiColorEditFlags_None))
615 alpha_flags = ImGuiColorEditFlags_None;
620 if (ImGui::RadioButton(
"Alpha", alpha_flags == ImGuiColorEditFlags_AlphaPreview))
622 alpha_flags = ImGuiColorEditFlags_AlphaPreview;
627 if (ImGui::RadioButton(
"Both", alpha_flags == ImGuiColorEditFlags_AlphaPreviewHalf))
629 alpha_flags = ImGuiColorEditFlags_AlphaPreviewHalf;
633 ImGui::BeginChild(
"##colors", ImVec2(0, 0),
true, ImGuiWindowFlags_AlwaysVerticalScrollbar | ImGuiWindowFlags_AlwaysHorizontalScrollbar | ImGuiWindowFlags_NavFlattened);
634 ImGui::PushItemWidth(-160);
636 for (
int i = 0; i < ImGuiCol_COUNT; i++)
638 const char *name = ImGui::GetStyleColorName(i);
640 if (!filter.PassFilter(name))
646 ImGui::ColorEdit4(
"##color", (
float *)&style.Colors[i], ImGuiColorEditFlags_AlphaBar | alpha_flags);
648 if (memcmp(&style.Colors[i], &ref->Colors[i],
sizeof(ImVec4)) != 0)
653 ImGui::SameLine(0.0f, style.ItemInnerSpacing.x);
655 if (ImGui::Button(
"Save"))
657 ref->Colors[i] = style.Colors[i];
660 ImGui::SameLine(0.0f, style.ItemInnerSpacing.x);
662 if (ImGui::Button(
"Revert"))
664 style.Colors[i] = ref->Colors[i];
668 ImGui::SameLine(0.0f, style.ItemInnerSpacing.x);
669 ImGui::TextUnformatted(name);
673 ImGui::PopItemWidth();
681 ImGui::PopItemWidth();
static JSON_HEDLEY_WARN_UNUSED_RESULT basic_json parse(InputType &&i, const parser_callback_t cb=nullptr, const bool allow_exceptions=true, const bool ignore_comments=false)
deserialize from a compatible input
a class to store JSON values
basic_json<> json
default JSON class
NLOHMANN_BASIC_JSON_TPL_DECLARATION std::string to_string(const NLOHMANN_BASIC_JSON_TPL &j)
user-defined to_string function for JSON values