diff --git a/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h b/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h index 4af1e6ad8..eccb54910 100644 --- a/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h +++ b/lib/libimhex/include/hex/ui/imgui_imhex_extensions.h @@ -28,8 +28,30 @@ enum ImGuiCustomCol { ImGuiCustomCol_ToolbarPurple, ImGuiCustomCol_ToolbarBrown, + ImGuiCustomCol_LoggerDebug, + ImGuiCustomCol_LoggerInfo, + ImGuiCustomCol_LoggerWarning, + ImGuiCustomCol_LoggerError, + ImGuiCustomCol_LoggerFatal, + + ImGuiCustomCol_AchievementUnlocked, + + ImGuiCustomCol_FindHighlight, + + ImGuiCustomCol_DiffAdded, + ImGuiCustomCol_DiffRemoved, + ImGuiCustomCol_DiffChanged, + + ImGuiCustomCol_AdvancedEncodingASCII, + ImGuiCustomCol_AdvancedEncodingSingleChar, + ImGuiCustomCol_AdvancedEncodingMultiChar, + ImGuiCustomCol_AdvancedEncodingUnknown, + ImGuiCustomCol_Highlight, + ImGuiCustomCol_Patches, + ImGuiCustomCol_PatternSelected, + ImGuiCustomCol_IEEEToolSign, ImGuiCustomCol_IEEEToolExp, ImGuiCustomCol_IEEEToolMantissa, diff --git a/plugins/builtin/romfs/themes/classic.json b/plugins/builtin/romfs/themes/classic.json index a5c124063..22b696027 100644 --- a/plugins/builtin/romfs/themes/classic.json +++ b/plugins/builtin/romfs/themes/classic.json @@ -73,7 +73,23 @@ "toolbar-green": "#388B42FF", "toolbar-purple": "#672A78FF", "toolbar-red": "#E74C3CFF", - "toolbar-yellow": "#F1C40FFF" + "toolbar-yellow": "#F1C40FFF", + "logger-debug": "#388B42FF", + "logger-info": "#06539BFF", + "logger-warning": "#F1C40FFF", + "logger-error": "#E74C3CFF", + "logger-fatal": "#672A78FF", + "achievement-unlocked": "#F1C40FFF", + "find-highlight": "#672A78FF", + "diff-added": "#388B42FF", + "diff-removed": "#E74C3CFF", + "diff-changed": "#F1C40FFF", + "advanced-encoding-ascii": "#06539BFF", + "advanced-encoding-single": "#E74C3CFF", + "advanced-encoding-multi": "#F1C40FFF", + "advanced-encoding-unknown": "#E74C3CFF", + "patches": "#E74C3CFF", + "pattern-selected": "#06539BFF" }, "imnodes": { "box-selector": "#5252A164", diff --git a/plugins/builtin/romfs/themes/dark.json b/plugins/builtin/romfs/themes/dark.json index 8e07110b9..b0a9d225b 100644 --- a/plugins/builtin/romfs/themes/dark.json +++ b/plugins/builtin/romfs/themes/dark.json @@ -73,7 +73,23 @@ "toolbar-green": "#388B42FF", "toolbar-purple": "#672A78FF", "toolbar-red": "#E74C3CFF", - "toolbar-yellow": "#F1C40FFF" + "toolbar-yellow": "#F1C40FFF", + "logger-debug": "#388B42FF", + "logger-info": "#06539BFF", + "logger-warning": "#F1C40FFF", + "logger-error": "#E74C3CFF", + "logger-fatal": "#672A78FF", + "achievement-unlocked": "#F1C40FFF", + "find-highlight": "#672A78FF", + "diff-added": "#388B42FF", + "diff-removed": "#E74C3CFF", + "diff-changed": "#F1C40FFF", + "advanced-encoding-ascii": "#06539BFF", + "advanced-encoding-single": "#E74C3CFF", + "advanced-encoding-multi": "#F1C40FFF", + "advanced-encoding-unknown": "#E74C3CFF", + "patches": "#E74C3CFF", + "pattern-selected": "#06539BFF" }, "imnodes": { "box-selector": "#3D85E01E", diff --git a/plugins/builtin/romfs/themes/light.json b/plugins/builtin/romfs/themes/light.json index b6badcd02..e1d687b1b 100644 --- a/plugins/builtin/romfs/themes/light.json +++ b/plugins/builtin/romfs/themes/light.json @@ -73,7 +73,23 @@ "toolbar-green": "#388B42FF", "toolbar-purple": "#672A78FF", "toolbar-red": "#E74C3CFF", - "toolbar-yellow": "#F1C40FFF" + "toolbar-yellow": "#F1C40FFF", + "logger-debug": "#388B42FF", + "logger-info": "#06539BFF", + "logger-warning": "#F1C40FFF", + "logger-error": "#E74C3CFF", + "logger-fatal": "#672A78FF", + "achievement-unlocked": "#F1C40FFF", + "find-highlight": "#672A78FF", + "diff-added": "#388B42FF", + "diff-removed": "#E74C3CFF", + "diff-changed": "#F1C40FFF", + "advanced-encoding-ascii": "#06539BFF", + "advanced-encoding-single": "#E74C3CFF", + "advanced-encoding-multi": "#F1C40FFF", + "advanced-encoding-unknown": "#E74C3CFF", + "patches": "#E74C3CFF", + "pattern-selected": "#06539BFF" }, "imnodes": { "box-selector": "#5AAAFA1E", diff --git a/plugins/builtin/source/content/themes.cpp b/plugins/builtin/source/content/themes.cpp index 276d26d44..b766ebc3c 100644 --- a/plugins/builtin/source/content/themes.cpp +++ b/plugins/builtin/source/content/themes.cpp @@ -168,21 +168,37 @@ namespace hex::plugin::builtin { { const static ThemeManager::ColorMap ImHexColorMap = { - { "desc-button", ImGuiCustomCol_DescButton }, - { "desc-button-hovered", ImGuiCustomCol_DescButtonHovered }, - { "desc-button-active", ImGuiCustomCol_DescButtonActive }, - { "toolbar-gray", ImGuiCustomCol_ToolbarGray }, - { "toolbar-red", ImGuiCustomCol_ToolbarRed }, - { "toolbar-yellow", ImGuiCustomCol_ToolbarYellow }, - { "toolbar-green", ImGuiCustomCol_ToolbarGreen }, - { "toolbar-blue", ImGuiCustomCol_ToolbarBlue }, - { "toolbar-purple", ImGuiCustomCol_ToolbarPurple }, - { "toolbar-brown", ImGuiCustomCol_ToolbarBrown }, - { "highlight", ImGuiCustomCol_Highlight }, - { "IEEE-tool-sign", ImGuiCustomCol_IEEEToolSign }, - { "IEEE-tool-exp", ImGuiCustomCol_IEEEToolExp }, - { "IEEE-tool-mantissa", ImGuiCustomCol_IEEEToolMantissa }, - { "blur-background", ImGuiCustomCol_BlurBackground } + { "desc-button", ImGuiCustomCol_DescButton }, + { "desc-button-hovered", ImGuiCustomCol_DescButtonHovered }, + { "desc-button-active", ImGuiCustomCol_DescButtonActive }, + { "toolbar-gray", ImGuiCustomCol_ToolbarGray }, + { "toolbar-red", ImGuiCustomCol_ToolbarRed }, + { "toolbar-yellow", ImGuiCustomCol_ToolbarYellow }, + { "toolbar-green", ImGuiCustomCol_ToolbarGreen }, + { "toolbar-blue", ImGuiCustomCol_ToolbarBlue }, + { "toolbar-purple", ImGuiCustomCol_ToolbarPurple }, + { "toolbar-brown", ImGuiCustomCol_ToolbarBrown }, + { "logger-debug", ImGuiCustomCol_LoggerDebug }, + { "logger-info", ImGuiCustomCol_LoggerInfo }, + { "logger-warning", ImGuiCustomCol_LoggerWarning }, + { "logger-error", ImGuiCustomCol_LoggerError }, + { "logger-fatal", ImGuiCustomCol_LoggerFatal }, + { "achievement-unlocked", ImGuiCustomCol_AchievementUnlocked }, + { "find-highlight", ImGuiCustomCol_FindHighlight }, + { "highlight", ImGuiCustomCol_Highlight }, + { "diff-added", ImGuiCustomCol_DiffAdded }, + { "diff-removed", ImGuiCustomCol_DiffRemoved }, + { "diff-changed", ImGuiCustomCol_DiffChanged }, + { "advanced-encoding-ascii", ImGuiCustomCol_AdvancedEncodingASCII }, + { "advanced-encoding-single", ImGuiCustomCol_AdvancedEncodingSingleChar }, + { "advanced-encoding-multi", ImGuiCustomCol_AdvancedEncodingMultiChar }, + { "advanced-encoding-unknown", ImGuiCustomCol_AdvancedEncodingUnknown }, + { "patches", ImGuiCustomCol_Patches }, + { "pattern-selected", ImGuiCustomCol_PatternSelected }, + { "IEEE-tool-sign", ImGuiCustomCol_IEEEToolSign }, + { "IEEE-tool-exp", ImGuiCustomCol_IEEEToolExp }, + { "IEEE-tool-mantissa", ImGuiCustomCol_IEEEToolMantissa }, + { "blur-background", ImGuiCustomCol_BlurBackground } }; diff --git a/plugins/builtin/source/content/views/view_achievements.cpp b/plugins/builtin/source/content/views/view_achievements.cpp index 246806b86..e4a59fcb8 100644 --- a/plugins/builtin/source/content/views/view_achievements.cpp +++ b/plugins/builtin/source/content/views/view_achievements.cpp @@ -37,7 +37,7 @@ namespace hex::plugin::builtin { // Determine achievement border color based on unlock state const auto borderColor = [&] { if (achievement.isUnlocked()) - return ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarYellow, 1.0F); + return ImGui::GetCustomColorU32(ImGuiCustomCol_AchievementUnlocked, 1.0F); else if (node->isUnlockable()) return ImGui::GetColorU32(ImGuiCol_Button, 1.0F); else @@ -118,7 +118,7 @@ namespace hex::plugin::builtin { ImGui::Separator(); separator = true; - ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarYellow), "[ {} ]", LangEntry("hex.builtin.view.achievements.click")); + ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_AchievementUnlocked), "[ {} ]", LangEntry("hex.builtin.view.achievements.click")); } // Draw achievement description if available @@ -413,7 +413,7 @@ namespace hex::plugin::builtin { ImGui::SetNextWindowSize(windowSize); if (ImGui::Begin("##achievement_unlocked", nullptr, ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse | ImGuiWindowFlags_NoDocking | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoFocusOnAppearing | ImGuiWindowFlags_NoInputs)) { // Draw unlock text - ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarYellow), "{}", "hex.builtin.view.achievements.unlocked"_lang); + ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_AchievementUnlocked), "{}", "hex.builtin.view.achievements.unlocked"_lang); // Draw achievement icon ImGui::Image(this->m_currAchievement->getIcon(), scaled({ 20, 20 })); diff --git a/plugins/builtin/source/content/views/view_diff.cpp b/plugins/builtin/source/content/views/view_diff.cpp index dfb647d91..12eb9118c 100644 --- a/plugins/builtin/source/content/views/view_diff.cpp +++ b/plugins/builtin/source/content/views/view_diff.cpp @@ -112,9 +112,9 @@ namespace hex::plugin::builtin { // Handle the case where one provider is larger than the other one if (address > otherProvider->getActualSize()) { if (otherIndex == 1) - return getDiffColor(ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarGreen)); + return getDiffColor(ImGui::GetCustomColorU32(ImGuiCustomCol_DiffAdded)); else - return getDiffColor(ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarRed)); + return getDiffColor(ImGui::GetCustomColorU32(ImGuiCustomCol_DiffRemoved)); } // Read the current byte from the other provider @@ -123,7 +123,7 @@ namespace hex::plugin::builtin { // Compare the two bytes, highlight both in yellow if they are different if (otherByte != *data) - return getDiffColor(ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarYellow)); + return getDiffColor(ImGui::GetCustomColorU32(ImGuiCustomCol_DiffChanged)); // No difference return std::nullopt; @@ -304,13 +304,13 @@ namespace hex::plugin::builtin { ImGui::TableNextColumn(); switch (diff.type) { case DifferenceType::Modified: - ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarYellow), "hex.builtin.view.diff.modified"_lang); + ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_DiffChanged), "hex.builtin.view.diff.modified"_lang); break; case DifferenceType::Added: - ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarGreen), "hex.builtin.view.diff.added"_lang); + ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_DiffAdded), "hex.builtin.view.diff.added"_lang); break; case DifferenceType::Removed: - ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarRed), "hex.builtin.view.diff.removed"_lang); + ImGui::TextFormattedColored(ImGui::GetCustomColorVec4(ImGuiCustomCol_DiffRemoved), "hex.builtin.view.diff.removed"_lang); break; } diff --git a/plugins/builtin/source/content/views/view_find.cpp b/plugins/builtin/source/content/views/view_find.cpp index 89d807f09..856435bae 100644 --- a/plugins/builtin/source/content/views/view_find.cpp +++ b/plugins/builtin/source/content/views/view_find.cpp @@ -16,7 +16,7 @@ namespace hex::plugin::builtin { ViewFind::ViewFind() : View("hex.builtin.view.find.name") { - const static auto HighlightColor = [] { return (ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarPurple) & 0x00FFFFFF) | 0x70000000; }; + const static auto HighlightColor = [] { return (ImGui::GetCustomColorU32(ImGuiCustomCol_FindHighlight) & 0x00FFFFFF) | 0x70000000; }; ImHexApi::HexEditor::addBackgroundHighlightingProvider([this](u64 address, const u8* data, size_t size, bool) -> std::optional { hex::unused(data, size); diff --git a/plugins/builtin/source/content/views/view_logs.cpp b/plugins/builtin/source/content/views/view_logs.cpp index e2bfed2ff..855c29720 100644 --- a/plugins/builtin/source/content/views/view_logs.cpp +++ b/plugins/builtin/source/content/views/view_logs.cpp @@ -13,15 +13,15 @@ namespace hex::plugin::builtin { static ImColor getColor(std::string_view level) { if (level.contains("DEBUG")) - return ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarGreen); + return ImGui::GetCustomColorVec4(ImGuiCustomCol_LoggerDebug); else if (level.contains("INFO")) - return ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarBlue); + return ImGui::GetCustomColorVec4(ImGuiCustomCol_LoggerInfo); else if (level.contains("WARN")) - return ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarYellow); + return ImGui::GetCustomColorVec4(ImGuiCustomCol_LoggerWarning); else if (level.contains("ERROR")) - return ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarRed); + return ImGui::GetCustomColorVec4(ImGuiCustomCol_LoggerError); else if (level.contains("FATAL")) - return ImGui::GetCustomColorVec4(ImGuiCustomCol_ToolbarPurple); + return ImGui::GetCustomColorVec4(ImGuiCustomCol_LoggerFatal); return ImGui::GetStyleColorVec4(ImGuiCol_Text); } diff --git a/plugins/builtin/source/content/views/view_patches.cpp b/plugins/builtin/source/content/views/view_patches.cpp index 75c026a2d..e1a79bda7 100644 --- a/plugins/builtin/source/content/views/view_patches.cpp +++ b/plugins/builtin/source/content/views/view_patches.cpp @@ -43,7 +43,7 @@ namespace hex::plugin::builtin { const auto &patches = provider->getPatches(); if (patches.contains(offset) && patches.at(offset) != byte) - return ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarRed); + return ImGui::GetCustomColorU32(ImGuiCustomCol_Patches); else return std::nullopt; }); diff --git a/plugins/builtin/source/ui/hex_editor.cpp b/plugins/builtin/source/ui/hex_editor.cpp index ae76cbb1d..7930b5396 100644 --- a/plugins/builtin/source/ui/hex_editor.cpp +++ b/plugins/builtin/source/ui/hex_editor.cpp @@ -131,11 +131,11 @@ namespace hex::plugin::builtin::ui { const auto [decoded, advance] = encodingFile.getEncodingFor(buffer); const ImColor color = [&]{ if (decoded.length() == 1 && std::isalnum(decoded[0])) - return ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarBlue); + return ImGui::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingASCII); else if (decoded.length() == 1 && advance == 1) - return ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarRed); + return ImGui::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingSingleChar); else if (decoded.length() > 1 && advance == 1) - return ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarYellow); + return ImGui::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingMultiChar); else if (advance > 1) return ImGui::GetColorU32(ImGuiCol_Text); else @@ -527,7 +527,7 @@ namespace hex::plugin::builtin::ui { if (y < this->m_encodingLineStartAddresses.size()) { if (this->m_encodingLineStartAddresses[y] >= this->m_bytesPerRow) { - encodingData.emplace_back(y * this->m_bytesPerRow + this->m_provider->getBaseAddress() + this->m_provider->getCurrentPageAddress(), CustomEncodingData(".", 1, ImGui::GetCustomColorU32(ImGuiCustomCol_ToolbarRed))); + encodingData.emplace_back(y * this->m_bytesPerRow + this->m_provider->getBaseAddress() + this->m_provider->getCurrentPageAddress(), CustomEncodingData(".", 1, ImGui::GetCustomColorU32(ImGuiCustomCol_AdvancedEncodingUnknown))); this->m_encodingLineStartAddresses.push_back(0); } else { u32 offset = this->m_encodingLineStartAddresses[y]; diff --git a/plugins/builtin/source/ui/pattern_drawer.cpp b/plugins/builtin/source/ui/pattern_drawer.cpp index d223f5496..41300ca1c 100644 --- a/plugins/builtin/source/ui/pattern_drawer.cpp +++ b/plugins/builtin/source/ui/pattern_drawer.cpp @@ -58,7 +58,7 @@ namespace hex::plugin::builtin::ui { auto selected = isPatternSelected(address, size); if (selected) - ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetStyleColorVec4(ImGuiCol_HeaderActive)); + ImGui::PushStyleColor(ImGuiCol_Text, ImGui::GetCustomColorVec4(ImGuiCustomCol_PatternSelected)); if constexpr (HasReturn) { auto result = callback();