diff --git a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/pcode/DebuggerPcodeStepperProvider.java b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/pcode/DebuggerPcodeStepperProvider.java index 57e85b7ed1..740487b813 100644 --- a/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/pcode/DebuggerPcodeStepperProvider.java +++ b/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/gui/pcode/DebuggerPcodeStepperProvider.java @@ -310,7 +310,7 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter { } protected static String htmlColor(Color color, String display) { - return String.format("%s", WebColors.toString(color), + return String.format("%s", WebColors.toString(color, false), HTMLUtilities.escapeHTML(display)); } diff --git a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/AbstractAddressRangeFilter.java b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/AbstractAddressRangeFilter.java index ea095b9100..99b2d93da5 100644 --- a/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/AbstractAddressRangeFilter.java +++ b/Ghidra/Features/VersionTracking/src/main/java/ghidra/feature/vt/gui/filters/AbstractAddressRangeFilter.java @@ -123,7 +123,7 @@ public abstract class AbstractAddressRangeFilter extends AncillaryFilter // // Lower Score Panel // - String fgColor = WebColors.toString(FG_TOOLTIP_DEFAULT); + String fgColor = WebColors.toString(FG_TOOLTIP_DEFAULT, false); lowerRangePanel = new JPanel(new GridLayout(2, 1)); JLabel lowLabel = new GHtmlLabel("low"); diff --git a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/ColorEditor.java b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/ColorEditor.java index 7f8ae726cd..55a7648354 100644 --- a/Ghidra/Framework/Docking/src/main/java/docking/options/editor/ColorEditor.java +++ b/Ghidra/Framework/Docking/src/main/java/docking/options/editor/ColorEditor.java @@ -88,7 +88,8 @@ public class ColorEditor extends PropertyEditorSupport { private void updateColor(Color newColor) { // change the color to a darker value if the color being set is light - String colorString = WebColors.toString(ColorUtils.contrastForegroundColor(newColor)); + String colorString = + WebColors.toString(ColorUtils.contrastForegroundColor(newColor), false); previewLabel.setText( "
click
"); diff --git a/Ghidra/Framework/Gui/src/main/java/ghidra/util/WebColors.java b/Ghidra/Framework/Gui/src/main/java/ghidra/util/WebColors.java index 2f93bdecab..cb19c04294 100644 --- a/Ghidra/Framework/Gui/src/main/java/ghidra/util/WebColors.java +++ b/Ghidra/Framework/Gui/src/main/java/ghidra/util/WebColors.java @@ -23,6 +23,11 @@ import java.util.Map; * Class for web color support. This class defines many of the colors used by html. This class * includes methods for converting a color to a string (name or hex value) and for converting * those strings back to a color. + *

+ * Usage Note: Java's HTML rendering engine supports colors in hex form ('#aabb11'). Also, the + * engine supports many web color names ('silver'). However, not all web color names defined in + * this file are supported. Thus, when specifying HTML colors, do not rely on these web color + * names. */ public abstract class WebColors { private static final Map nameToColorMap = new HashMap<>(); @@ -229,7 +234,7 @@ public abstract class WebColors { } /** - * Returns the hex value string for the given color + * Returns the hex value string for the given color * @param color the color * @return the string */ @@ -382,7 +387,7 @@ public abstract class WebColors { value = value.substring(4, value.length() - 1); } - // strip off to comma separated values + // strip off to comma separated values String[] split = value.split(","); if (split.length != 3) { return null; @@ -404,7 +409,7 @@ public abstract class WebColors { value = value.substring(5, value.length() - 1); } - // strip off to comma separated values + // strip off to comma separated values value = value.replaceAll(" ", ""); String[] split = value.split(","); if (split.length != 4) {