package net.bitpot.railways.gui;

import com.intellij.openapi.editor.colors.EditorColors;
import com.intellij.ui.JBColor;
import com.intellij.ui.SimpleTextAttributes;

import java.awt.*;

/**
 *
 * @author Basil Gren
 *         on 23.02.14.
 */
public abstract class RailwaysColors {

    public static Color HIGHLIGHT_BG_COLOR =
            EditorColors.TEXT_SEARCH_RESULT_ATTRIBUTES.getDefaultAttributes().getBackgroundColor();
    public static Color PARAM_TOKEN_COLOR = JBColor.MAGENTA;
    public static Color OPTIONAL_TOKEN_COLOR = JBColor.GRAY;

    public static final SimpleTextAttributes REGULAR_HL_ATTR =
            new SimpleTextAttributes(HIGHLIGHT_BG_COLOR, null,
                    null, SimpleTextAttributes.STYLE_PLAIN);


    public static final SimpleTextAttributes PARAM_TOKEN_ATTR =
            new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,
                    PARAM_TOKEN_COLOR);

    public static final SimpleTextAttributes PARAM_TOKEN_HL_ATTR =
            new SimpleTextAttributes(HIGHLIGHT_BG_COLOR, PARAM_TOKEN_COLOR,
                    null, SimpleTextAttributes.STYLE_PLAIN);

    public static final SimpleTextAttributes OPTIONAL_TOKEN_ATTR =
            new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, OPTIONAL_TOKEN_COLOR);

    public static final SimpleTextAttributes OPTIONAL_TOKEN_HL_ATTR =
            new SimpleTextAttributes(HIGHLIGHT_BG_COLOR, OPTIONAL_TOKEN_COLOR,
                    null, SimpleTextAttributes.STYLE_PLAIN);
}
@@ -83,16 +83,77 @@
 Colors;%0A
+import com.intellij.openapi.editor.colors.TextAttributesKey;%0A
 import c
@@ -461,16 +461,37 @@
 ibutes()
+%0A                    
 .getBack
@@ -505,16 +505,17 @@
 olor();%0A
+%0A
     publ
@@ -554,24 +554,36 @@
 R = 
-JBColor.MAGENTA;
+schemeColor(%22RUBY_SYMBOL%22);%0A
 %0A   
@@ -641,16 +641,41 @@
 .GRAY;%0A%0A
+%0A    // Text attributes%0A%0A
     publ
@@ -741,34 +741,29 @@
         
-new Simple
+plain
 TextAttr
 ibutes(H
@@ -746,39 +746,39 @@
    plainTextAttr
-ibutes(
+(null, 
 HIGHLIGHT_BG_COL
@@ -783,79 +783,12 @@
 OLOR
-, null,%0A                    null, SimpleTextAttributes.STYLE_PLAIN
 );%0A%0A
-%0A
     
@@ -863,87 +863,22 @@
     
-new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN,%0A                    
+plainTextAttr(
 PARA
@@ -882,32 +882,38 @@
 ARAM_TOKEN_COLOR
+, null
 );%0A%0A    public s
@@ -983,130 +983,182 @@
     
-new SimpleTextAttributes(HIGHLIGHT_BG_COLOR, PARAM_TOKEN_COLOR,%0A                    null, SimpleTextAttributes.STYLE_PLAIN
+plainTextAttr(PARAM_TOKEN_COLOR, HIGHLIGHT_BG_COLOR);%0A%0A    public static final SimpleTextAttributes OPTIONAL_TOKEN_ATTR =%0A            plainTextAttr(OPTIONAL_TOKEN_COLOR, null
 );%0A%0A
@@ -1209,32 +1209,35 @@
  OPTIONAL_TOKEN_
+HL_
 ATTR =%0A         
@@ -1243,109 +1243,252 @@
     
-new SimpleTextAttributes(SimpleTextAttributes.STYLE_PLAIN, OPTIONAL_TOKEN_COLOR);%0A%0A    public
+plainTextAttr(OPTIONAL_TOKEN_COLOR, HIGHLIGHT_BG_COLOR);%0A%0A%0A    private static Color schemeColor(String name) %7B%0A        return TextAttributesKey.find(name)%0A                .getDefaultAttributes().getForegroundColor();%0A    %7D%0A%0A%0A    private
  static 
 fina
@@ -1475,38 +1475,32 @@
  private static 
-final 
 SimpleTextAttrib
@@ -1508,44 +1508,62 @@
 tes 
-OPTIONAL_TOKEN_HL_ATTR =%0A   
+plainTextAttr(Color fgColor, Color bgColor) %7B%0A
         
  new
@@ -1558,16 +1558,22 @@
         
+return
  new Sim
@@ -1594,54 +1594,26 @@
 tes(
-HIGHLIGHT_BG_COLOR, OPTIONAL_TOKEN_COLOR,%0A    
+bgColor, fgColor,%0A
     
@@ -1665,9 +1665,15 @@
 PLAIN);%0A
+    %7D%0A
 %7D

Make route query param color the same as in the current color scheme.