Browse Source

Tweak auto-theme colors

* Add opacity where it should be (for dims)
* Added more different colors for tabs, frame backgrounds
filter-focus
Macoy Madson 1 month ago
parent
commit
ec6375e053
  1. 114
      src/ImGuiAutoColor.cake

114
src/ImGuiAutoColor.cake

@ -36,71 +36,71 @@
(var target-set-time float 0.f)
(defun-local auto-color-to-imgui-color (color auto-color &return ImVec4)
(defun-local auto-color-to-imgui-color (color auto-color opacity float &return ImVec4)
(return (ImVec4
(/ (at 0 color) 255.f)
(/ (at 1 color) 255.f)
(/ (at 2 color) 255.f)
1.00f)))
opacity)))
(defun-local set-imgui-colors-from-base16 (base16-colors (* auto-color))
(var colors (* ImVec4) (field (imgui-call GetStyle) Colors))
(set (at ImGuiCol_Text colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_TextDisabled colors) (auto-color-to-imgui-color (at 3 base16-colors)))
(set (at ImGuiCol_WindowBg colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_ChildBg colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_PopupBg colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_Border colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_BorderShadow colors) (auto-color-to-imgui-color (at 14 base16-colors)))
(set (at ImGuiCol_FrameBg colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_FrameBgHovered colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_FrameBgActive colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_TitleBg colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_TitleBgActive colors) (auto-color-to-imgui-color (at 2 base16-colors)))
(set (at ImGuiCol_TitleBgCollapsed colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_MenuBarBg colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_ScrollbarBg colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_ScrollbarGrab colors) (auto-color-to-imgui-color (at 13 base16-colors)))
(set (at ImGuiCol_ScrollbarGrabHovered colors) (auto-color-to-imgui-color (at 14 base16-colors)))
(set (at ImGuiCol_ScrollbarGrabActive colors) (auto-color-to-imgui-color (at 15 base16-colors)))
(set (at ImGuiCol_CheckMark colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_SliderGrab colors) (auto-color-to-imgui-color (at 12 base16-colors)))
(set (at ImGuiCol_SliderGrabActive colors) (auto-color-to-imgui-color (at 6 base16-colors)))
(set (at ImGuiCol_Button colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_ButtonHovered colors) (auto-color-to-imgui-color (at 2 base16-colors)))
(set (at ImGuiCol_ButtonActive colors) (auto-color-to-imgui-color (at 6 base16-colors)))
(set (at ImGuiCol_Header colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_HeaderHovered colors) (auto-color-to-imgui-color (at 2 base16-colors)))
(set (at ImGuiCol_HeaderActive colors) (auto-color-to-imgui-color (at 9 base16-colors)))
(set (at ImGuiCol_Separator colors) (auto-color-to-imgui-color (at 10 base16-colors)))
(set (at ImGuiCol_SeparatorHovered colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_SeparatorActive colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_ResizeGrip colors) (auto-color-to-imgui-color (at 11 base16-colors)))
(set (at ImGuiCol_ResizeGripHovered colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_ResizeGripActive colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_Tab colors) (auto-color-to-imgui-color (at 2 base16-colors)))
(set (at ImGuiCol_TabHovered colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_TabActive colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_TabUnfocused colors) (auto-color-to-imgui-color (at 2 base16-colors)))
(set (at ImGuiCol_TabUnfocusedActive colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_DockingPreview colors) (auto-color-to-imgui-color (at 2 base16-colors)))
(set (at ImGuiCol_DockingEmptyBg colors) (auto-color-to-imgui-color (at 0 base16-colors)))
(set (at ImGuiCol_PlotLines colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_PlotLinesHovered colors) (auto-color-to-imgui-color (at 13 base16-colors)))
(set (at ImGuiCol_PlotHistogram colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_PlotHistogramHovered colors) (auto-color-to-imgui-color (at 5 base16-colors)))
(set (at ImGuiCol_TableHeaderBg colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_TableBorderStrong colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_TableBorderLight colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_TableRowBg colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_TableRowBgAlt colors) (auto-color-to-imgui-color (at 8 base16-colors)))
(set (at ImGuiCol_TextSelectedBg colors) (auto-color-to-imgui-color (at 2 base16-colors)))
(set (at ImGuiCol_DragDropTarget colors) (auto-color-to-imgui-color (at 7 base16-colors)))
(set (at ImGuiCol_NavHighlight colors) (auto-color-to-imgui-color (at 9 base16-colors)))
(set (at ImGuiCol_NavWindowingHighlight colors) (auto-color-to-imgui-color (at 2 base16-colors)))
(set (at ImGuiCol_NavWindowingDimBg colors) (auto-color-to-imgui-color (at 1 base16-colors)))
(set (at ImGuiCol_ModalWindowDimBg colors) (auto-color-to-imgui-color (at 2 base16-colors))))
(set (at ImGuiCol_Text colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_TextDisabled colors) (auto-color-to-imgui-color (at 3 base16-colors) 1.f))
(set (at ImGuiCol_WindowBg colors) (auto-color-to-imgui-color (at 0 base16-colors) 1.f))
(set (at ImGuiCol_ChildBg colors) (auto-color-to-imgui-color (at 0 base16-colors) 1.f))
(set (at ImGuiCol_PopupBg colors) (auto-color-to-imgui-color (at 0 base16-colors) 1.f))
(set (at ImGuiCol_Border colors) (auto-color-to-imgui-color (at 0 base16-colors) 1.f))
(set (at ImGuiCol_BorderShadow colors) (auto-color-to-imgui-color (at 14 base16-colors) 1.f))
(set (at ImGuiCol_FrameBg colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_FrameBgHovered colors) (auto-color-to-imgui-color (at 6 base16-colors) 1.f))
(set (at ImGuiCol_FrameBgActive colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_TitleBg colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_TitleBgActive colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_TitleBgCollapsed colors) (auto-color-to-imgui-color (at 0 base16-colors) 1.f))
(set (at ImGuiCol_MenuBarBg colors) (auto-color-to-imgui-color (at 0 base16-colors) 1.f))
(set (at ImGuiCol_ScrollbarBg colors) (auto-color-to-imgui-color (at 0 base16-colors) 1.f))
(set (at ImGuiCol_ScrollbarGrab colors) (auto-color-to-imgui-color (at 13 base16-colors) 1.f))
(set (at ImGuiCol_ScrollbarGrabHovered colors) (auto-color-to-imgui-color (at 14 base16-colors) 1.f))
(set (at ImGuiCol_ScrollbarGrabActive colors) (auto-color-to-imgui-color (at 15 base16-colors) 1.f))
(set (at ImGuiCol_CheckMark colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_SliderGrab colors) (auto-color-to-imgui-color (at 12 base16-colors) 1.f))
(set (at ImGuiCol_SliderGrabActive colors) (auto-color-to-imgui-color (at 6 base16-colors) 1.f))
(set (at ImGuiCol_Button colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_ButtonHovered colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_ButtonActive colors) (auto-color-to-imgui-color (at 6 base16-colors) 1.f))
(set (at ImGuiCol_Header colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_HeaderHovered colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_HeaderActive colors) (auto-color-to-imgui-color (at 9 base16-colors) 1.f))
(set (at ImGuiCol_Separator colors) (auto-color-to-imgui-color (at 10 base16-colors) 1.f))
(set (at ImGuiCol_SeparatorHovered colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_SeparatorActive colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_ResizeGrip colors) (auto-color-to-imgui-color (at 11 base16-colors) 1.f))
(set (at ImGuiCol_ResizeGripHovered colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_ResizeGripActive colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_Tab colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_TabHovered colors) (auto-color-to-imgui-color (at 6 base16-colors) 1.f))
(set (at ImGuiCol_TabActive colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_TabUnfocused colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_TabUnfocusedActive colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_DockingPreview colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_DockingEmptyBg colors) (auto-color-to-imgui-color (at 0 base16-colors) 1.f))
(set (at ImGuiCol_PlotLines colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_PlotLinesHovered colors) (auto-color-to-imgui-color (at 13 base16-colors) 1.f))
(set (at ImGuiCol_PlotHistogram colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_PlotHistogramHovered colors) (auto-color-to-imgui-color (at 5 base16-colors) 1.f))
(set (at ImGuiCol_TableHeaderBg colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_TableBorderStrong colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_TableBorderLight colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_TableRowBg colors) (auto-color-to-imgui-color (at 1 base16-colors) 1.f))
(set (at ImGuiCol_TableRowBgAlt colors) (auto-color-to-imgui-color (at 8 base16-colors) 1.f))
(set (at ImGuiCol_TextSelectedBg colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_DragDropTarget colors) (auto-color-to-imgui-color (at 7 base16-colors) 1.f))
(set (at ImGuiCol_NavHighlight colors) (auto-color-to-imgui-color (at 9 base16-colors) 1.f))
(set (at ImGuiCol_NavWindowingHighlight colors) (auto-color-to-imgui-color (at 2 base16-colors) 1.f))
(set (at ImGuiCol_NavWindowingDimBg colors) (auto-color-to-imgui-color (at 1 base16-colors) 0.8f))
(set (at ImGuiCol_ModalWindowDimBg colors) (auto-color-to-imgui-color (at 2 base16-colors) 0.8f)))
(defun imgui-auto-color-initialize ()
(each-in-array current-base16-colors i

Loading…
Cancel
Save