[nostalgia/gfx/studio/palette] Add preview to color editor
All checks were successful
Build / build (push) Successful in 1m16s

This commit is contained in:
Gary Talent 2025-05-31 01:34:00 -05:00
parent e1cfcc8b5f
commit a33a73d73a

View File

@ -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<uint8_t>(r), static_cast<uint8_t>(g), static_cast<uint8_t>(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<ApplyColorAllPagesCommand>(
m_pal, m_page, m_selectedColorRow);