Browse Source
There's still some customization that needs to be done on the theme assignment, but overall it's usable.filter-focus
6 changed files with 90 additions and 10 deletions
@ -1 +1 @@ |
|||
Subproject commit 8435230abb2f3246e6aa2f36dc8ec7342dc33792 |
|||
Subproject commit d75b3f7aa95cd86b0b07ed26da3e3a17299b5a24 |
@ -0,0 +1,81 @@ |
|||
(import "ImGui.cake" "AutoColor.cake") |
|||
|
|||
;; TODO: ImGui.cake import should handle this via export/auto-infect |
|||
(c-import "imgui.h") |
|||
(add-c-search-directory-module "Dependencies/imgui") |
|||
|
|||
(defun-local auto-color-to-imgui-color (color auto-color &return ImVec4) |
|||
(return (ImVec4 |
|||
(/ (at 0 color) 255.f) |
|||
(/ (at 1 color) 255.f) |
|||
(/ (at 2 color) 255.f) |
|||
1.00f))) |
|||
|
|||
(defun imgui-colors-from-current-background () |
|||
(scope |
|||
(var base16-colors ([] 16 auto-color) (array 0)) |
|||
(when (auto-color-pick-from-current-background base16-colors) |
|||
(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 14 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 0 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 1 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 0 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 2 base16-colors))) |
|||
(set (at ImGuiCol_TabUnfocused colors) (auto-color-to-imgui-color (at 0 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 5 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))) |
|||
;; (set (at ImGuiCol_WindowBg colors) (auto-color-to-imgui-color (at 0 base16-colors))) |
|||
;; (set (at ImGuiCol_FrameBg 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 3 base16-colors))) |
|||
;; (set (at ImGuiCol_Button colors) (auto-color-to-imgui-color (at 1 base16-colors))) |
|||
))) |
Loading…
Reference in new issue