-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b5129b7
commit 44a6aef
Showing
4 changed files
with
131 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#include "style.h" | ||
|
||
#include <imgui_wrap.h> | ||
|
||
|
||
namespace | ||
{ | ||
constexpr ImColor WindowBackgroundColor_Classic(29, 75, 99, 217); | ||
constexpr ImColor WindowBackgroundColor_Dark(4, 8, 25, 240); | ||
constexpr ImColor WindowMainBackgroundColor_Classic(35, 92, 121, 255); | ||
constexpr ImColor WindowMainBackgroundColor_Dark(10, 25, 50, 255); | ||
} | ||
|
||
void imgui_set_style(bool dark_mode) | ||
{ | ||
if (dark_mode) | ||
{ | ||
ImGui::StyleColorsDark(); | ||
ImGui::GetStyle().Colors[ImGuiCol_WindowBg] = WindowBackgroundColor_Dark; | ||
} | ||
else | ||
{ | ||
ImGui::StyleColorsClassic(); | ||
ImGui::GetStyle().Colors[ImGuiCol_WindowBg] = WindowBackgroundColor_Classic; | ||
} | ||
} | ||
|
||
std::array<float, 4> get_background_color(bool dark_mode) | ||
{ | ||
const auto c = static_cast<ImVec4>(dark_mode ? WindowMainBackgroundColor_Dark : WindowMainBackgroundColor_Classic); | ||
return std::array<float, 4>{ c.x, c.y, c.z, c.w }; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#pragma once | ||
|
||
#include <array> | ||
|
||
void imgui_set_style(bool dark_mode); | ||
|
||
std::array<float, 4> get_background_color(bool dark_mode); |