[nostalgia/core/studio] Add color preview to color picker in TileSheetEditor
This commit is contained in:
parent
462375aa5d
commit
22216c66d6
@ -108,8 +108,9 @@ void TileSheetEditorImGui::drawTileSheet(const geo::Vec2 &fbSize) noexcept {
|
|||||||
|
|
||||||
void TileSheetEditorImGui::drawPalettePicker() noexcept {
|
void TileSheetEditorImGui::drawPalettePicker() noexcept {
|
||||||
// header
|
// header
|
||||||
if (ImGui::BeginTable("PaletteTable", 2, ImGuiTableFlags_RowBg)) {
|
if (ImGui::BeginTable("PaletteTable", 3, ImGuiTableFlags_RowBg)) {
|
||||||
ImGui::TableSetupColumn("No.", 0, 0.35);
|
ImGui::TableSetupColumn("No.", 0, 0.45);
|
||||||
|
ImGui::TableSetupColumn("", 0, 0.22);
|
||||||
ImGui::TableSetupColumn("Color16", 0, 3);
|
ImGui::TableSetupColumn("Color16", 0, 3);
|
||||||
ImGui::TableHeadersRow();
|
ImGui::TableHeadersRow();
|
||||||
for (auto i = 0u; auto c: m_tileSheetEditor.pal().colors) {
|
for (auto i = 0u; auto c: m_tileSheetEditor.pal().colors) {
|
||||||
@ -123,6 +124,9 @@ void TileSheetEditorImGui::drawPalettePicker() noexcept {
|
|||||||
}
|
}
|
||||||
// Column: color RGB
|
// Column: color RGB
|
||||||
ImGui::TableNextColumn();
|
ImGui::TableNextColumn();
|
||||||
|
auto ic = ImGui::GetColorU32(ImVec4(redf(c), greenf(c), bluef(c), 1));
|
||||||
|
ImGui::TableSetBgColor(ImGuiTableBgTarget_CellBg, ic);
|
||||||
|
ImGui::TableNextColumn();
|
||||||
ImGui::Text("(%02d, %02d, %02d)", red16(c), green16(c), blue16(c));
|
ImGui::Text("(%02d, %02d, %02d)", red16(c), green16(c), blue16(c));
|
||||||
ImGui::TableNextRow();
|
ImGui::TableNextRow();
|
||||||
ImGui::PopID();
|
ImGui::PopID();
|
||||||
|
Loading…
Reference in New Issue
Block a user