From a33a73d73a411e544f3dae53e057761a5be9ca5c Mon Sep 17 00:00:00 2001 From: Gary Talent Date: Sat, 31 May 2025 01:34:00 -0500 Subject: [PATCH] [nostalgia/gfx/studio/palette] Add preview to color editor --- .../gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp b/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp index 8b2847f3..d133843c 100644 --- a/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp +++ b/src/nostalgia/modules/gfx/src/studio/paletteeditor/paletteeditor-imgui.cpp @@ -307,6 +307,15 @@ void PaletteEditorImGui::drawColorEditor() noexcept { colorInput("Red", r, inputFocused, FocusCmd::Red); colorInput("Green", g, inputFocused, FocusCmd::Green); colorInput("Blue", b, inputFocused, FocusCmd::Blue); + // color preview + { + ImGui::PushStyleColor( + ImGuiCol_ChildBg, + color32(color16(static_cast(r), static_cast(g), static_cast(b))) | 0xff'00'00'00); + ImGui::BeginChild("ColorPreview", {0, 25}); + ImGui::EndChild(); + ImGui::PopStyleColor(); + } if (ig::PushButton("Apply to all pages", {-1, ig::BtnSz.y})) { std::ignore = pushCommand( m_pal, m_page, m_selectedColorRow);