}
}//GEN-LAST:event_jButton2ActionPerformed
private void updateTheme(ColorTheme theme, JEditorPane pane) {
EditorKit editorKit = pane.getEditorKit();
Color background = new Color(0xffffff);
Color currentLine = new Color(0xefefef);
Color selection = new Color(0xd6d6d6);
Color foreground = new Color(0x4d4d4c);
Color comment = new Color(0x8e908c);
Color blue = new Color(0x4271ae);
Color green = new Color(0x718c00);
Color purple = new Color(0x8959a8);
Color red = new Color(0xc82829);
Color orange = new Color(0xf5871f);
Color yellow = new Color(0xeab700);
DefaultSyntaxKit kit = (DefaultSyntaxKit) editorKit;
pane.setBackground(background);
//0 = default style
//2 = italic
//1 = bold
kit.setProperty("Style.COMMENT", toHex(comment,2)); //block and line comments
kit.setProperty("Style.COMMENT2", toHex(Color.PINK,0)); //??
kit.setProperty("Style.DEFAULT", toHex(foreground,0));
kit.setProperty("Style.DELIMITER", toHex(Color.PINK,1));
kit.setProperty("Style.ERROR", toHex(Color.PINK,3));
kit.setProperty("Style.IDENTIFIER", toHex(blue,0)); //everything?
kit.setProperty("Style.KEYWORD", toHex(purple,1)); //
kit.setProperty("Style.KEYWORD2", toHex(purple,1)); // #include
kit.setProperty("Style.NUMBER", toHex(red,1)); //number literals
kit.setProperty("Style.OPERATOR", toHex(foreground,0)); //plus, dot, comma, asterix, etc
kit.setProperty("Style.REGEX", toHex(foreground,0));
kit.setProperty("Style.STRING", toHex(green,0)); //string literals
kit.setProperty("Style.STRING2", toHex(Color.PINK,0));
kit.setProperty("Style.TYPE", toHex(green,0)); //void, int
kit.setProperty("Style.TYPE2", toHex(Color.PINK,0));
kit.setProperty("Style.TYPE3", toHex(Color.PINK,0));
kit.setProperty("Style.WARNING", toHex(Color.PINK,0));
kit.setProperty("CaretColor", toHex(red));
kit.setProperty("SelectionColor", toHex(selection));
kit.setProperty("PairMarker.Color",toHex(yellow));
kit.setProperty("TokenMarker.Color",toHex(yellow));
kit.setProperty("LineNumbers.Background",toHex(currentLine));
kit.setProperty("LineNumbers.CurrentBack",toHex(selection));
kit.setProperty("LineNumbers.Foreground",toHex(Color.BLACK));
kit.setProperty("LineNumbers.RightMargin","7");
/*
Style.COMMENT 0x339933, 2
Style.COMMENT2 0x339933, 3
Style.DEFAULT 0x000000, 0
Style.DELIMITER 0x000000, 1
Style.ERROR 0xCC0000, 3
Style.IDENTIFIER 0x000000, 0
Style.KEYWORD 0x3333ee, 0
Style.KEYWORD2 0x3333ee, 3
Style.NUMBER 0x999933, 1
Style.OPERATOR 0x000000, 0
Style.REGEX 0xcc6600, 0
Style.STRING 0xcc6600, 0
Style.STRING2 0xcc6600, 1
Style.TYPE 0x000000, 2
Style.TYPE2 0x000000, 1
Style.TYPE3 0x000000, 3
Style.WARNING 0xCC0000, 0
*/
editorKit.install(pane);
pane.setFont(customFont.deriveFont(14f));
}