I am new here on Stackoverflow and have full of excitement bringing up my first question. My first question is all about changing the color appearance of MySQL Workbench from the default of white background to its negative value of black.
I was planning to pair the theme with my Dark Theme Eclipse Juno. Adjusting my eye contrast to the quick change of color could damage my eyesight.
Furthermore about this question, I am open for suggestion if such change is possible or not.
Thanks.
It's not really a programming question, but it's a quick one so let me answer that. MySQL Workbench's themes are a collection of colors for certain main parts of the application. It is planned to allow customizing them in a later version. In order to get a dark theme as one of the templates please file a feature request at http://bugs.mysql.com. But keep in mind, not every UI element is colored according to the Workbench theme, e.g. text boxes still stay white as they use the Windows standard colors.
Here's how to change MySQL Workbench's colors (INCLUDING THE BACKGROUND COLOR).
Open the XML file called code_editor.xml
located in the data folder of the MySQL Workbench's installation directory (usually C:\Program Files\MySQL\MySQL Workbench 6.3 CE\data
). Here you'll find a lot of styling for different code elements, but there are some missing.
MySQL Workbench uses scintilla as the code editor, and scintilla defines a few more styles that you can use in the code_editor.xml
file. The one that is used for the background color is style id 32.
Here's the complete list for MySQL (scintilla has thousands of styles for many languages) with my configuration:
<style id= "0" fore-color="#DDDDDD" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_DEFAULT -->
<style id= "1" fore-color="#999999" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_COMMENT -->
<style id= "2" fore-color="#999999" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_COMMENTLINE -->
<style id= "3" fore-color="#DDDDDD" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_VARIABLE -->
<style id= "4" fore-color="#9B859D" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_SYSTEMVARIABLE -->
<style id= "5" fore-color="#9B859D" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_KNOWNSYSTEMVARIABLE -->
<style id= "6" fore-color="#FF8080" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_NUMBER -->
<style id= "7" fore-color="#7AAAD7" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_MAJORKEYWORD -->
<style id= "8" fore-color="#7AAAD7" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_KEYWORD -->
<style id= "9" fore-color="#9B859D" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_DATABASEOBJECT -->
<style id="10" fore-color="#DDDDDD" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_PROCEDUREKEYWORD -->
<style id="11" fore-color="#B9CB89" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_STRING -->
<style id="12" fore-color="#B9CB89" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_SQSTRING -->
<style id="13" fore-color="#B9CB89" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_DQSTRING -->
<style id="14" fore-color="#FFBB80" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_OPERATOR -->
<style id="15" fore-color="#9B859D" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_FUNCTION -->
<style id="16" fore-color="#DDDDDD" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_IDENTIFIER -->
<style id="17" fore-color="#B9CB89" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_QUOTEDIDENTIFIER -->
<style id="18" fore-color="#B9CB89" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_USER1 -->
<style id="19" fore-color="#B9CB89" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_USER2 -->
<style id="20" fore-color="#B9CB89" back-color="#2A2A2A" bold="No" /> <!-- SCE_MYSQL_USER3 -->
<style id="21" fore-color="#FFBB80" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_HIDDENCOMMAND -->
<style id="22" fore-color="#909090" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_PLACEHOLDER -->
<!-- These two are for scintilla globally. -->
<style id="32" fore-color="#DDDDDD" back-color="#2A2A2A" bold="No" /> <!-- STYLE_DEFAULT THIS IS THE ONE FOR THE BACKGROUND!!!!! -->
<style id="33" fore-color="#2A2A2A" back-color="#DDDDDD" bold="No" /> <!-- STYLE_LINENUMBER -->
<!-- All styles again in their variant in a hidden command (with a 0x40 offset). -->
<style id="65" fore-color="#999999" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_COMMENT -->
<style id="66" fore-color="#999999" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_COMMENTLINE -->
<style id="67" fore-color="#DDDDDD" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_VARIABLE -->
<style id="68" fore-color="#9B859D" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_SYSTEMVARIABLE -->
<style id="69" fore-color="#9B859D" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_KNOWNSYSTEMVARIABLE -->
<style id="70" fore-color="#FF8080" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_NUMBER -->
<style id="71" fore-color="#7AAAD7" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_MAJORKEYWORD -->
<style id="72" fore-color="#7AAAD7" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_KEYWORD -->
<style id="73" fore-color="#9B859D" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_DATABASEOBJECT -->
<style id="74" fore-color="#DDDDDD" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_PROCEDUREKEYWORD -->
<style id="75" fore-color="#B9CB89" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_STRING -->
<style id="76" fore-color="#B9CB89" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_SQSTRING -->
<style id="77" fore-color="#B9CB89" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_DQSTRING -->
<style id="78" fore-color="#FFBB80" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_OPERATOR -->
<style id="79" fore-color="#9B859D" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_FUNCTION -->
<style id="80" fore-color="#DDDDDD" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_IDENTIFIER -->
<style id="81" fore-color="#B9CB89" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_QUOTEDIDENTIFIER -->
<style id="82" fore-color="#B9CB89" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_USER1 -->
<style id="83" fore-color="#B9CB89" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_USER2 -->
<style id="84" fore-color="#B9CB89" back-color="#707070" bold="No" /> <!-- SCE_MYSQL_USER3 -->
<style id="85" fore-color="#FFBB80" back-color="#909090" bold="No" /> <!-- SCE_MYSQL_HIDDENCOMMAND -->
<style id="86" fore-color="#AAAAAA" back-color="#909090" bold="No" /> <!-- SCE_MYSQL_PLACEHOLDER -->
Just a copy of Gaston's answer, but with Monokai theme colors.
<!--
dark-gray: #282828;
brown-gray: #49483E;
gray: #888888;
light-gray: #CCCCCC;
ghost-white: #F8F8F0;
light-ghost-white: #F8F8F2;
yellow: #E6DB74;
blue: #66D9EF;
pink: #F92672;
purple: #AE81FF;
brown: #75715E;
orange: #FD971F;
light-orange: #FFD569;
green: #A6E22E;
sea-green: #529B2F;
-->
<style id="32" fore-color="#DDDDDD" back-color="#282828" bold="No" /> <!-- STYLE_DEFAULT !BACKGROUND! -->
<style id="33" fore-color="#DDDDDD" back-color="#282828" bold="No" /> <!-- STYLE_LINENUMBER -->
<style id= "0" fore-color="#DDDDDD" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_DEFAULT -->
<style id= "1" fore-color="#999999" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_COMMENT -->
<style id= "2" fore-color="#999999" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_COMMENTLINE -->
<style id= "3" fore-color="#DDDDDD" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_VARIABLE -->
<style id= "4" fore-color="#66D9EF" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_SYSTEMVARIABLE -->
<style id= "5" fore-color="#66D9EF" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_KNOWNSYSTEMVARIABLE -->
<style id= "6" fore-color="#AE81FF" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_NUMBER -->
<style id= "7" fore-color="#F92672" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_MAJORKEYWORD -->
<style id= "8" fore-color="#F92672" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_KEYWORD -->
<style id= "9" fore-color="#9B859D" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_DATABASEOBJECT -->
<style id="10" fore-color="#DDDDDD" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_PROCEDUREKEYWORD -->
<style id="11" fore-color="#E6DB74" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_STRING -->
<style id="12" fore-color="#E6DB74" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_SQSTRING -->
<style id="13" fore-color="#E6DB74" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_DQSTRING -->
<style id="14" fore-color="#F92672" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_OPERATOR -->
<style id="15" fore-color="#9B859D" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_FUNCTION -->
<style id="16" fore-color="#DDDDDD" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_IDENTIFIER -->
<style id="17" fore-color="#E6DB74" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_QUOTEDIDENTIFIER -->
<style id="18" fore-color="#529B2F" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_USER1 -->
<style id="19" fore-color="#529B2F" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_USER2 -->
<style id="20" fore-color="#529B2F" back-color="#282828" bold="No" /> <!-- SCE_MYSQL_USER3 -->
<style id="21" fore-color="#66D9EF" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_HIDDENCOMMAND -->
<style id="22" fore-color="#909090" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_PLACEHOLDER -->
<!-- All styles again in their variant in a hidden command -->
<style id="65" fore-color="#999999" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_COMMENT -->
<style id="66" fore-color="#999999" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_COMMENTLINE -->
<style id="67" fore-color="#DDDDDD" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_VARIABLE -->
<style id="68" fore-color="#66D9EF" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_SYSTEMVARIABLE -->
<style id="69" fore-color="#66D9EF" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_KNOWNSYSTEMVARIABLE -->
<style id="70" fore-color="#AE81FF" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_NUMBER -->
<style id="71" fore-color="#F92672" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_MAJORKEYWORD -->
<style id="72" fore-color="#F92672" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_KEYWORD -->
<style id="73" fore-color="#9B859D" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_DATABASEOBJECT -->
<style id="74" fore-color="#DDDDDD" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_PROCEDUREKEYWORD -->
<style id="75" fore-color="#E6DB74" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_STRING -->
<style id="76" fore-color="#E6DB74" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_SQSTRING -->
<style id="77" fore-color="#E6DB74" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_DQSTRING -->
<style id="78" fore-color="#F92672" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_OPERATOR -->
<style id="79" fore-color="#9B859D" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_FUNCTION -->
<style id="80" fore-color="#DDDDDD" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_IDENTIFIER -->
<style id="81" fore-color="#E6DB74" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_QUOTEDIDENTIFIER -->
<style id="82" fore-color="#529B2F" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_USER1 -->
<style id="83" fore-color="#529B2F" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_USER2 -->
<style id="84" fore-color="#529B2F" back-color="#49483E" bold="No" /> <!-- SCE_MYSQL_USER3 -->
<style id="85" fore-color="#66D9EF" back-color="#888888" bold="No" /> <!-- SCE_MYSQL_HIDDENCOMMAND -->
<style id="86" fore-color="#AAAAAA" back-color="#888888" bold="No" /> <!-- SCE_MYSQL_PLACEHOLDER -->
Quoting Yoga...
For Mac users, the code_editor.xml file is in MBP HD/ Applications/MySQLWorkbench.app/Contents/Resources/data/
I just discovered by dumbfounded experimentation (i.e. first thing I tried, worked) that if I copy that file to...
/Users/your.username/Library/Application Support/MySQL/Workbench/code_editor.xml
...and then edit it there, it does indeed override. Just worked perfectly for me on Mac OS X Sierra and MySQL Workbench 6.3.
try to disabled Dark Mode on Mysql Workbench run this on terminal
defaults write com.oracle.workbench.MySQLWorkbench NSRequiresAquaSystemAppearance -bool yes