mbien commented on code in PR #8371:
URL: https://github.com/apache/netbeans/pull/8371#discussion_r2029970329


##########
java/ant.grammar/src/org/netbeans/modules/ant/grammar/AntHighlightsLayerFactory.java:
##########
@@ -38,18 +34,16 @@
 public class AntHighlightsLayerFactory implements HighlightsLayerFactory {
 
     public @Override HighlightsLayer[] createLayers(final Context context) {
-        AttributeSet _attrs = 
MimeLookup.getLookup("text/x-jsp").lookup(FontColorSettings.class).getTokenFontColors("expression-language");
 // NOI18N
-        final AttributeSet attrs;
-        if (_attrs == null) {
-            // Fallback from 
web.core.syntax/src/org/netbeans/modules/web/core/syntax/resources/fontsColors.xml:
-            SimpleAttributeSet _sattrs = new SimpleAttributeSet();
-            _sattrs.addAttribute(StyleConstants.Background, new 
Color(0xe3f2e1));
-            attrs = _sattrs;
-        } else {
-            attrs = _attrs;
-        }
-        return new HighlightsLayer[] {HighlightsLayer.create("ant", 
ZOrder.SYNTAX_RACK.forPosition(10), true,
-                new AntHighlightsContainer((AbstractDocument) 
context.getDocument(), attrs))}; // NOI18N
+        HighlightsLayer highlighter = HighlightsLayer.create(
+            "ant",  // NOI18N
+            ZOrder.SYNTAX_RACK.forPosition(10), 
+            true, 
+            new AntHighlightsContainer(
+                (AbstractDocument) context.getDocument(),
+                
MimeLookup.getLookup("text/x-jsp").lookup(FontColorSettings.class).getTokenFontColors("expression-language")
 // NOI18N

Review Comment:
   right. It will use the base colors if the theme does not provide a color for 
it. FlatLaf light has a highlighting layer defined for those property values, 
the dark variant has not, so it will look like on the screenshot. Which is 
better than using the hardcoded value which was meant for light themes. This 
was especially a problem while trying to create your own theme.
   
   thanks for reviewing!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscr...@netbeans.apache.org
For additional commands, e-mail: notifications-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists

Reply via email to