From c5e5224755b282336a30fbbe86c0019c8a67813f Mon Sep 17 00:00:00 2001 From: chatlanin Date: Wed, 25 Feb 2026 15:44:51 +0300 Subject: [PATCH] fix gl_color --- src/vertex_engine/glfw/glfw.hpp | 2 +- src/vertex_engine/gui/style/style.hpp.BASE | 227 --------------------- 2 files changed, 1 insertion(+), 228 deletions(-) delete mode 100755 src/vertex_engine/gui/style/style.hpp.BASE diff --git a/src/vertex_engine/glfw/glfw.hpp b/src/vertex_engine/glfw/glfw.hpp index abfc9b2..58fdf09 100755 --- a/src/vertex_engine/glfw/glfw.hpp +++ b/src/vertex_engine/glfw/glfw.hpp @@ -18,7 +18,7 @@ namespace VE // что не есть хорошо для умных указателей GLFWwindow* m_win; std::unique_ptr m_context; - glm::vec4 m_bgcolor = { 0.1f, 0.1f, 0.1f, 1.f }; + glm::vec4 m_bgcolor = { 0.19f, 0.2f, 0.25f, 1.f }; struct win_data { diff --git a/src/vertex_engine/gui/style/style.hpp.BASE b/src/vertex_engine/gui/style/style.hpp.BASE deleted file mode 100755 index aad8474..0000000 --- a/src/vertex_engine/gui/style/style.hpp.BASE +++ /dev/null @@ -1,227 +0,0 @@ -#pragma once - -#include "vertex_engine/utils/utils.hpp" // IWYU pragma: keep -#include "icons.hpp" // IWYU pragma: keep -#include "fonts.hpp" -#include "vertex_engine/utils/func.hpp" -#include "vertex_engine/gui/plots/2d/implot.hpp" - -namespace VE::style -{ - inline void set_base_style() - { - ImVec4* col = ImGui::GetStyle().Colors; - - col[ImGuiCol_Tab] = ImVec4(0.1f, 0.09f, 0.12f, 1.f); - col[ImGuiCol_TabActive] = ImVec4(0.2f, 0.19f, 0.21f, 1.f); - col[ImGuiCol_TabHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - // colors[ImGuiCol_TabUnfocused] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); - // colors[ImGuiCol_TabUnfocusedActive] = active; - - col[ImGuiCol_TitleBg] = ImVec4(0.1f, 0.09f, 0.12f, 1.f); - col[ImGuiCol_TitleBgActive] = ImVec4(0.07f, 0.07f, 0.09f, 1.f); - col[ImGuiCol_TitleBgCollapsed] = ImVec4(0.1f, 0.09f, 0.12f, 1.f); - - col[ImGuiCol_Text] = ImVec4(0.8f, 0.8f, 0.83f, 1.f); - col[ImGuiCol_TextDisabled] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - col[ImGuiCol_TextSelectedBg] = ImVec4(0.25f, 1.f, 0.f, 0.43f); - - col[ImGuiCol_Border] = ImVec4(0.8f, 0.8f, 0.83f, 0.88f); - col[ImGuiCol_BorderShadow] = ImVec4(0.92f, 0.91f, 0.88f, 0.f); - - col[ImGuiCol_FrameBg] = ImVec4(0.1f, 0.09f, 0.12f, 1.f); - col[ImGuiCol_FrameBgActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - col[ImGuiCol_FrameBgHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - - col[ImGuiCol_ScrollbarBg] = ImVec4(0.1f, 0.09f, 0.12f, 1.f); - col[ImGuiCol_ScrollbarGrab] = ImVec4(0.8f, 0.8f, 0.83f, 0.31f); - col[ImGuiCol_ScrollbarGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.f); - col[ImGuiCol_ScrollbarGrabHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - - col[ImGuiCol_SliderGrab] = ImVec4(0.8f, 0.8f, 0.83f, 0.31f); - col[ImGuiCol_SliderGrabActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.f); - - col[ImGuiCol_Button] = ImVec4(0.1f, 0.09f, 0.12f, 1.f); - col[ImGuiCol_ButtonActive] = ImVec4(0.12f, 0.11f, 0.14f, 1.f); - col[ImGuiCol_ButtonHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - - col[ImGuiCol_Header] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - col[ImGuiCol_HeaderActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.f); - col[ImGuiCol_HeaderHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - - col[ImGuiCol_Separator] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - col[ImGuiCol_SeparatorActive] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - col[ImGuiCol_SeparatorHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - - col[ImGuiCol_ResizeGrip] = ImVec4(0.f, 0.f, 0.f, 0.f); - col[ImGuiCol_ResizeGripActive] = ImVec4(0.06f, 0.05f, 0.07f, 1.f); - col[ImGuiCol_ResizeGripHovered] = ImVec4(0.13f, 0.12f, 0.15f, 1.f); - - col[ImGuiCol_PlotLines] = ImVec4(0.4f, 0.39f, 0.38f, 0.63f); - col[ImGuiCol_PlotHistogram] = ImVec4(0.4f, 0.39f, 0.38f, 0.63f); - col[ImGuiCol_PlotLinesHovered] = ImVec4(0.25f, 1.f, 0.f, 1.f); - col[ImGuiCol_PlotHistogramHovered] = ImVec4(0.25f, 1.f, 0.f, 1.f); - - // colors[ImGuiCol_TableRowBg] = ImVec4(0, 0, 0, 0); - // colors[ImGuiCol_TableHeaderBg] = accent_dark; - // colors[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.02f); - // colors[ImGuiCol_TableBorderLight] = ImVec4(1.00f, 1.00f, 1.00f, 0.02f); - // colors[ImGuiCol_TableBorderStrong] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f); - - // colors[ImGuiCol_NavHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); - // colors[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); - // colors[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); - - col[ImGuiCol_ChildBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.f); - col[ImGuiCol_PopupBg] = ImVec4(0.07f, 0.07f, 0.09f, 1.f); - col[ImGuiCol_WindowBg] = ImVec4(0.06f, 0.05f, 0.07f, 1.f); - col[ImGuiCol_MenuBarBg] = ImVec4(0.1f, 0.09f, 0.12f, 1.f); - col[ImGuiCol_ModalWindowDimBg] = ImVec4(1.f, 0.98f, 0.95f, 0.73f); - - col[ImGuiCol_CheckMark] = ImVec4(0.8f, 0.8f, 0.83f, 0.31f); - // colors[ImGuiCol_DragDropTarget] = attention; - } - - inline void set_system_style() - { - const ImVec4 bg_dark = ImVec4(0.15f, 0.16f, 0.21f, 1.00f); - const ImVec4 bg_mid = ImVec4(0.20f, 0.21f, 0.27f, 1.00f); - const ImVec4 accent_dark = ImVec4(0.292f, 0.360f, 0.594f, 1.000f); - const ImVec4 accent_light = ImVec4(0.409f, 0.510f, 0.835f, 1.000f); - const ImVec4 active = ImVec4(0.107f, 0.118f, 0.157f, 1.000f); - // const ImVec4 active = func::color("#89B4FB", 0.99f); - const ImVec4 attention = ImVec4(0.821f, 1.000f, 0.000f, 1.000f); - - ImVec4* col = ImGui::GetStyle().Colors; - col[ImGuiCol_Tab] = ImVec4(1.00f, 1.00f, 1.00f, 0.02f); - col[ImGuiCol_TabActive] = accent_dark; - col[ImGuiCol_TabHovered] = accent_light; - col[ImGuiCol_TabUnfocused] = ImVec4(0.24f, 0.23f, 0.29f, 1.00f); - col[ImGuiCol_TabUnfocusedActive] = active; - - col[ImGuiCol_TitleBg] = accent_dark; - col[ImGuiCol_TitleBgActive] = accent_dark; - col[ImGuiCol_TitleBgCollapsed] = accent_dark; - - col[ImGuiCol_Text] = ImVec4(0.89f, 0.89f, 0.92f, 1.00f); - col[ImGuiCol_TextDisabled] = ImVec4(0.38f, 0.45f, 0.64f, 1.00f); - col[ImGuiCol_TextSelectedBg] = accent_light; - - col[ImGuiCol_Border] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f); - col[ImGuiCol_BorderShadow] = ImVec4(0.00f, 0.00f, 0.00f, 0.06f); - - col[ImGuiCol_FrameBg] = ImVec4(1.00f, 1.00f, 1.00f, 0.02f); - col[ImGuiCol_FrameBgActive] = active; - col[ImGuiCol_FrameBgHovered] = accent_light; - - col[ImGuiCol_ScrollbarBg] = bg_mid; - col[ImGuiCol_ScrollbarGrab] = ImVec4(0.89f, 0.89f, 0.93f, 0.27f); - col[ImGuiCol_ScrollbarGrabActive] = active; - col[ImGuiCol_ScrollbarGrabHovered] = accent_light; - - col[ImGuiCol_SliderGrab] = accent_dark; - col[ImGuiCol_SliderGrabActive] = accent_light; - - col[ImGuiCol_Button] = accent_dark; - col[ImGuiCol_ButtonHovered] = accent_light; - col[ImGuiCol_ButtonActive] = active; - - col[ImGuiCol_Header] = accent_dark; - col[ImGuiCol_HeaderActive] = active; - col[ImGuiCol_HeaderHovered] = accent_light; - - col[ImGuiCol_Separator] = accent_dark; - col[ImGuiCol_SeparatorActive] = active; - col[ImGuiCol_SeparatorHovered] = accent_light; - - col[ImGuiCol_ResizeGrip] = accent_dark; - col[ImGuiCol_ResizeGripActive] = active; - col[ImGuiCol_ResizeGripHovered] = accent_light; - - col[ImGuiCol_PlotLines] = accent_light; - col[ImGuiCol_PlotHistogram] = accent_light; - col[ImGuiCol_PlotLinesHovered] = active; - col[ImGuiCol_PlotHistogramHovered] = active; - - col[ImGuiCol_TableRowBg] = ImVec4(0, 0, 0, 0); - col[ImGuiCol_TableHeaderBg] = accent_dark; - col[ImGuiCol_TableRowBgAlt] = ImVec4(1.00f, 1.00f, 1.00f, 0.02f); - col[ImGuiCol_TableBorderLight] = ImVec4(1.00f, 1.00f, 1.00f, 0.02f); - col[ImGuiCol_TableBorderStrong] = ImVec4(1.00f, 1.00f, 1.00f, 0.10f); - - col[ImGuiCol_NavHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); - col[ImGuiCol_NavWindowingDimBg] = ImVec4(0.80f, 0.80f, 0.80f, 0.20f); - col[ImGuiCol_NavWindowingHighlight] = ImVec4(1.00f, 1.00f, 1.00f, 0.70f); - - col[ImGuiCol_ChildBg] = ImVec4(0.2f, 0.21f, 0.27f, 0.f); - col[ImGuiCol_PopupBg] = bg_mid; - col[ImGuiCol_WindowBg] = bg_mid; - col[ImGuiCol_MenuBarBg] = accent_dark; - col[ImGuiCol_ModalWindowDimBg] = ImVec4(1.00f, 0.98f, 0.95f, 0.73f); - - col[ImGuiCol_CheckMark] = accent_dark; - col[ImGuiCol_DragDropTarget] = attention; - -#ifdef IMGUI_HAS_DOCK - colors[ImGuiCol_DockingPreview] = ImVec4(0.85f, 0.85f, 0.85f, 0.28f); - colors[ImGuiCol_DockingEmptyBg] = ImVec4(0.38f, 0.38f, 0.38f, 1.00f); -#endif - - ImPlot::StyleColorsAuto(); - - ImVec4* pcol = ImPlot::GetStyle().Colors; - pcol[ImPlotCol_PlotBg] = ImVec4(0, 0, 0, 0); - pcol[ImPlotCol_PlotBorder] = ImVec4(0, 0, 0, 0); - pcol[ImPlotCol_Selection] = attention; - pcol[ImPlotCol_Crosshairs] = col[ImGuiCol_Text]; - - ImPlot::GetStyle().DigitalPadding = 20; - - auto& st = ImPlot::GetStyle(); - st.PlotPadding = st.LegendPadding = {12, 12}; - st.LabelPadding = st.LegendInnerPadding = {6, 6}; - st.LegendSpacing = {10, 2}; - st.AnnotationPadding = {4,2}; - - const ImU32 Dracula[] = {4288967266, 4285315327, 4286315088, 4283782655, 4294546365, 4287429361, 4291197439, 4294830475, 4294113528, 4284106564 }; - ImPlot::GetStyle().Colormap = ImPlot::AddColormap("Dracula",Dracula,10); - } - - inline void init() - { - /* use this - https://www.unknowncheats.me/forum/c-and-c-/189635-imgui-style-settings.html */ - ImGuiStyle& st = ImGui::GetStyle(); - - st.WindowRounding = st.ChildRounding = st.PopupRounding = st.ScrollbarRounding = st.GrabRounding = st.TabRounding = 1.f; - st.WindowBorderSize = st.ChildBorderSize = st.PopupBorderSize = st.TabBorderSize = 0.f; - st.WindowMenuButtonPosition = ImGuiDir_None; - st.WindowPadding = ImVec2(5.f, 5.f); - - st.FramePadding = ImVec2{ 6.f, 3.f }; - st.FramePadding = ImVec2(5.f, 5.f); - st.FrameBorderSize = 1; - st.FrameRounding = 0.f; - - st.ItemSpacing = ImVec2(8.f, 8.f); - st.ItemInnerSpacing = ImVec2(8.f, 6.f); - - st.ScrollbarSize = 12.f; - st.ScrollbarRounding = 0.f; - - st.GrabMinSize = 5.f; - st.GrabRounding = 0.f; - - st.PopupRounding = 0.f; - st.PopupBorderSize = 0.f; - - st.IndentSpacing = 25.f; - st.TabRounding = 0.f; - st.ChildRounding = 0.f; - st.CellPadding = ImVec2{ 6.f, 3.f }; - - // set_base_style(); - set_system_style(); - - fonts::init(); - }; -};