Merge remote-tracking branch 'origin/GP-3592-dragonmacher-pcode-stepper-rendering--SQUASHED' into patch

This commit is contained in:
Ryan Kurtz
2023-07-24 17:54:52 -04:00
4 changed files with 12 additions and 6 deletions
@@ -310,7 +310,7 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {
} }
protected static String htmlColor(Color color, String display) { protected static String htmlColor(Color color, String display) {
return String.format("<font color=\"%s\">%s</font>", WebColors.toString(color), return String.format("<font color=\"%s\">%s</font>", WebColors.toString(color, false),
HTMLUtilities.escapeHTML(display)); HTMLUtilities.escapeHTML(display));
} }
@@ -123,7 +123,7 @@ public abstract class AbstractAddressRangeFilter<T> extends AncillaryFilter<T>
// //
// Lower Score Panel // 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)); lowerRangePanel = new JPanel(new GridLayout(2, 1));
JLabel lowLabel = JLabel lowLabel =
new GHtmlLabel("<html><font size=\"2\" color=\"" + fgColor + "\">low</font>"); new GHtmlLabel("<html><font size=\"2\" color=\"" + fgColor + "\">low</font>");
@@ -88,7 +88,8 @@ public class ColorEditor extends PropertyEditorSupport {
private void updateColor(Color newColor) { private void updateColor(Color newColor) {
// change the color to a darker value if the color being set is light // 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( previewLabel.setText(
"<HTML><CENTER><I><FONT SIZE=2 COLOR=" + colorString + ">click</FONT></I></CENTER>"); "<HTML><CENTER><I><FONT SIZE=2 COLOR=" + colorString + ">click</FONT></I></CENTER>");
@@ -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 * 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 * includes methods for converting a color to a string (name or hex value) and for converting
* those strings back to a color. * those strings back to a color.
* <p>
* 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 { public abstract class WebColors {
private static final Map<String, Color> nameToColorMap = new HashMap<>(); private static final Map<String, Color> nameToColorMap = new HashMap<>();