From abbef06142e968518590517d8db11c13029831b7 Mon Sep 17 00:00:00 2001 From: scawful Date: Sun, 14 Jul 2024 19:00:18 -0400 Subject: [PATCH] add snes format copy to clipboard color picker --- src/app/editor/modules/palette_editor.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/app/editor/modules/palette_editor.cc b/src/app/editor/modules/palette_editor.cc index 8a4c0a89..c6991f3b 100644 --- a/src/app/editor/modules/palette_editor.cc +++ b/src/app/editor/modules/palette_editor.cc @@ -262,12 +262,19 @@ absl::Status PaletteEditor::HandleColorPopup(gfx::SnesPalette& palette, int i, CustomFormatString(buf, IM_ARRAYSIZE(buf), "(%.3ff, %.3ff, %.3ff)", col[0], col[1], col[2]); - if (Selectable(buf)) SetClipboardText(buf); + CustomFormatString(buf, IM_ARRAYSIZE(buf), "(%d,%d,%d)", cr, cg, cb); if (Selectable(buf)) SetClipboardText(buf); + CustomFormatString(buf, IM_ARRAYSIZE(buf), "#%02X%02X%02X", cr, cg, cb); if (Selectable(buf)) SetClipboardText(buf); + + // SNES Format + CustomFormatString(buf, IM_ARRAYSIZE(buf), "0x%04X", + ConvertRGBtoSNES(ImVec4(col[0], col[1], col[2], 1.0f))); + if (Selectable(buf)) SetClipboardText(buf); + EndPopup(); }