mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-14 16:12:14 +00:00
GP-3592 - Fixed incorrect colors in dark mode
This commit is contained in:
parent
07b664bbbf
commit
4412fddbea
@ -310,7 +310,7 @@ public class DebuggerPcodeStepperProvider extends ComponentProviderAdapter {
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ public abstract class AbstractAddressRangeFilter<T> extends AncillaryFilter<T>
|
||||
//
|
||||
// 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("<html><font size=\"2\" color=\"" + fgColor + "\">low</font>");
|
||||
|
@ -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(
|
||||
"<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
|
||||
* includes methods for converting a color to a string (name or hex value) and for converting
|
||||
* 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 {
|
||||
private static final Map<String, Color> 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) {
|
||||
|
Loading…
Reference in New Issue
Block a user