69 if (current_palette_id_ < 0 || current_palette_id_ >= (
int)dungeon_pal_group.size()) {
70 ImGui::TextColored(ImVec4(1, 0, 0, 1),
"Invalid palette ID");
75 int num_colors = palette.size();
77 ImGui::Text(
"Colors (%d):", num_colors);
80 const int colors_per_row = 15;
81 const float color_button_size = 24.0f;
83 for (
int i = 0; i < num_colors; i++) {
87 auto color = palette[i];
88 ImVec4 col(color.rgb().x / 255.0f,
89 color.rgb().y / 255.0f,
90 color.rgb().z / 255.0f,
96 ImGui::PushStyleColor(ImGuiCol_Border, ImVec4(1, 1, 0, 1));
97 ImGui::PushStyleVar(ImGuiStyleVar_FrameBorderSize, 2.0f);
100 if (ImGui::ColorButton(absl::StrFormat(
"##color%d", i).c_str(), col,
101 ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_NoPicker,
102 ImVec2(color_button_size, color_button_size))) {
108 ImGui::PopStyleVar();
109 ImGui::PopStyleColor();
113 if (ImGui::IsItemHovered()) {
114 ImGui::SetTooltip(
"Color %d\nSNES: 0x%04X\nRGB: (%d, %d, %d)",
116 (
int)color.rgb().x, (
int)color.rgb().y, (
int)color.rgb().z);
120 if ((i + 1) % colors_per_row != 0 && i < num_colors - 1) {
137 ImGuiColorEditFlags_NoAlpha | ImGuiColorEditFlags_PickerHueWheel)) {
144 uint16_t
snes_color = (b << 10) | (g << 5) | r;
157 ImGui::Text(
"RGB (0-255): (%d, %d, %d)",
163 ImGui::Text(
"SNES BGR555: 0x%04X", original_color.snes());
166 if (ImGui::Button(
"Reset to Original")) {
168 original_color.rgb().y / 255.0f,
169 original_color.rgb().z / 255.0f,