From 6b5456f132382ddde51543d0f8a27e3295e59e77 Mon Sep 17 00:00:00 2001 From: Arne Elster Date: Sun, 26 Sep 2021 20:34:50 +0200 Subject: [PATCH] HexEditor: Remove magic color constant for modified bytes The magic constant does not work together well with themes. As there does not seem to be a suitable palette color for this, simply invert the color. --- Userland/Applications/HexEditor/HexEditor.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Applications/HexEditor/HexEditor.cpp b/Userland/Applications/HexEditor/HexEditor.cpp index e1a3a17e00..a67f10254c 100644 --- a/Userland/Applications/HexEditor/HexEditor.cpp +++ b/Userland/Applications/HexEditor/HexEditor.cpp @@ -574,8 +574,8 @@ void HexEditor::paint_event(GUI::PaintEvent& event) Gfx::Color text_color = edited_flag ? Color::Red : palette().color(foreground_role()); if (highlight_flag) { - background_color = palette().selection(); - text_color = edited_flag ? Color::from_rgb(0xFFC0CB) : palette().selection_text(); + background_color = edited_flag ? palette().selection().inverted() : palette().selection(); + text_color = edited_flag ? palette().selection_text().inverted() : palette().selection_text(); } else if (byte_position == m_position && m_edit_mode == EditMode::Text) { background_color = palette().inactive_selection(); text_color = palette().inactive_selection_text(); @@ -605,8 +605,8 @@ void HexEditor::paint_event(GUI::PaintEvent& event) text_color = edited_flag ? Color::Red : palette().color(foreground_role()); if (highlight_flag) { - background_color = palette().selection(); - text_color = edited_flag ? Color::from_rgb(0xFFC0CB) : palette().selection_text(); + background_color = edited_flag ? palette().selection().inverted() : palette().selection(); + text_color = edited_flag ? palette().selection_text().inverted() : palette().selection_text(); } else if (byte_position == m_position && m_edit_mode == EditMode::Hex) { background_color = palette().inactive_selection(); text_color = palette().inactive_selection_text();