├── .gitattributes ├── .gitignore ├── README.md ├── screenshots ├── dark-theme.png └── light-theme.png └── setupSolarized.m /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ##################### 2 | ## Matlab / Simulink 3 | ##################### 4 | 5 | # Autosave file name extensions 6 | *.asv 7 | *.autosave 8 | 9 | 10 | ################# 11 | ## Eclipse 12 | ################# 13 | 14 | *.pydevproject 15 | .project 16 | .metadata 17 | bin/ 18 | tmp/ 19 | *.tmp 20 | *.bak 21 | *.swp 22 | *~.nib 23 | local.properties 24 | .classpath 25 | .settings/ 26 | .loadpath 27 | 28 | # External tool builders 29 | .externalToolBuilders/ 30 | 31 | # Locally stored "Eclipse launch configurations" 32 | *.launch 33 | 34 | # CDT-specific 35 | .cproject 36 | 37 | # PDT-specific 38 | .buildpath 39 | 40 | 41 | ################# 42 | ## Visual Studio 43 | ################# 44 | 45 | ## Ignore Visual Studio temporary files, build results, and 46 | ## files generated by popular Visual Studio add-ons. 47 | 48 | # User-specific files 49 | *.suo 50 | *.user 51 | *.sln.docstates 52 | 53 | # Build results 54 | 55 | [Dd]ebug/ 56 | [Rr]elease/ 57 | x64/ 58 | build/ 59 | [Bb]in/ 60 | [Oo]bj/ 61 | 62 | # MSTest test Results 63 | [Tt]est[Rr]esult*/ 64 | [Bb]uild[Ll]og.* 65 | 66 | *_i.c 67 | *_p.c 68 | *.ilk 69 | *.meta 70 | *.obj 71 | *.pch 72 | *.pdb 73 | *.pgc 74 | *.pgd 75 | *.rsp 76 | *.sbr 77 | *.tlb 78 | *.tli 79 | *.tlh 80 | *.tmp 81 | *.tmp_proj 82 | *.log 83 | *.vspscc 84 | *.vssscc 85 | .builds 86 | *.pidb 87 | *.log 88 | *.scc 89 | 90 | # Visual C++ cache files 91 | ipch/ 92 | *.aps 93 | *.ncb 94 | *.opensdf 95 | *.sdf 96 | *.cachefile 97 | 98 | # Visual Studio profiler 99 | *.psess 100 | *.vsp 101 | *.vspx 102 | 103 | # Guidance Automation Toolkit 104 | *.gpState 105 | 106 | # ReSharper is a .NET coding add-in 107 | _ReSharper*/ 108 | *.[Rr]e[Ss]harper 109 | 110 | # TeamCity is a build add-in 111 | _TeamCity* 112 | 113 | # DotCover is a Code Coverage Tool 114 | *.dotCover 115 | 116 | # NCrunch 117 | *.ncrunch* 118 | .*crunch*.local.xml 119 | 120 | # Installshield output folder 121 | [Ee]xpress/ 122 | 123 | # DocProject is a documentation generator add-in 124 | DocProject/buildhelp/ 125 | DocProject/Help/*.HxT 126 | DocProject/Help/*.HxC 127 | DocProject/Help/*.hhc 128 | DocProject/Help/*.hhk 129 | DocProject/Help/*.hhp 130 | DocProject/Help/Html2 131 | DocProject/Help/html 132 | 133 | # Click-Once directory 134 | publish/ 135 | 136 | # Publish Web Output 137 | *.Publish.xml 138 | *.pubxml 139 | 140 | # NuGet Packages Directory 141 | ## TODO: If you have NuGet Package Restore enabled, uncomment the next line 142 | #packages/ 143 | 144 | # Windows Azure Build Output 145 | csx 146 | *.build.csdef 147 | 148 | # Windows Store app package directory 149 | AppPackages/ 150 | 151 | # Others 152 | sql/ 153 | *.Cache 154 | ClientBin/ 155 | [Ss]tyle[Cc]op.* 156 | ~$* 157 | *~ 158 | *.dbmdl 159 | *.[Pp]ublish.xml 160 | *.pfx 161 | *.publishsettings 162 | 163 | # RIA/Silverlight projects 164 | Generated_Code/ 165 | 166 | # Backup & report files from converting an old project file to a newer 167 | # Visual Studio version. Backup files are not needed, because we have git ;-) 168 | _UpgradeReport_Files/ 169 | Backup*/ 170 | UpgradeLog*.XML 171 | UpgradeLog*.htm 172 | 173 | # SQL Server files 174 | App_Data/*.mdf 175 | App_Data/*.ldf 176 | 177 | ############# 178 | ## Windows detritus 179 | ############# 180 | 181 | # Windows image file caches 182 | Thumbs.db 183 | ehthumbs.db 184 | 185 | # Folder config file 186 | Desktop.ini 187 | 188 | # Recycle Bin used on file shares 189 | $RECYCLE.BIN/ 190 | 191 | # Mac crap 192 | .DS_Store 193 | 194 | 195 | ############# 196 | ## Python 197 | ############# 198 | 199 | *.py[co] 200 | 201 | # Packages 202 | *.egg 203 | *.egg-info 204 | dist/ 205 | build/ 206 | eggs/ 207 | parts/ 208 | var/ 209 | sdist/ 210 | develop-eggs/ 211 | .installed.cfg 212 | 213 | # Installer logs 214 | pip-log.txt 215 | 216 | # Unit test / coverage reports 217 | .coverage 218 | .tox 219 | 220 | #Translations 221 | *.mo 222 | 223 | #Mr Developer 224 | .mr.developer.cfg 225 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Solarized for MATLAB 2 | 3 | ## Precision colors for machines and people 4 | 5 | ### Solarized 6 | 7 | Solarized was created by [Ethan Schoonover][ES] and you can find out more 8 | about the design work that went into it on his [project page][ES-solarized]. If 9 | you would like to use Solarized in editors other than MATLAB or on your terminal, 10 | Ethan hosts the [main repository][SolarizedRepo] which combines all the available 11 | ports in one place. 12 | 13 | ### Solarized for MATLAB 14 | 15 | Solarized was initially ported for MATLAB by [Ben Hager][BH] and can be 16 | found at . [Wang Yudong][wyudong] add 17 | color setup to restore Matlab's defaults. 18 | 19 | ### Screenshots 20 | 21 | Solarized Light Color Scheme 22 | 23 | ![LightImg](https://github.com/wyudong/solarized-matlab/blob/master/screenshots/light-theme.png) 24 | 25 | Solarized Dark Color Scheme 26 | 27 | ![DarkImg](https://github.com/wyudong/solarized-matlab/blob/master/screenshots/dark-theme.png) 28 | 29 | ### Installation 30 | 31 | You can download the files in one of two ways: 32 | 33 | * using `git clone git://github.com/wyudong/solarized-matlab.git` 34 | * using the **Download** button to get the ZIP file and extracting the files to 35 | a folder 36 | 37 | Once the files are on your PC, add the folder `solarized-matlab` to your Matlab 38 | path or **copy** the file file `setupSolarized.m` it to your working folder. 39 | 40 | ### Usage 41 | 42 | The `setupSolarized.m` script can be run from the Matlab command window. The file 43 | must be in current working directory or in another directory that is in your path. 44 | The type of Solarized theme loaded is based on a string passed to the function 45 | when it is run. Here are examples of loading the *light* and *dark* themes. 46 | 47 | * `>> setupSolarized('light');` 48 | * `>> setupSolarized('dark');` 49 | 50 | This will load the color scheme. 51 | 52 | * `>> setupSolarized('default');` 53 | 54 | Now restore the color scheme to Matlab's *default* option is also supported. 55 | 56 | [ES]: http://ethanschoonover.com 57 | [ES-Solarized]: http://ethanschoonover.com/solarized 58 | [SolarizedRepo]: https://github.com/altercation/solarized 59 | [BH]: http://benhager.com 60 | [wyudong]: http://wyudong.com 61 | -------------------------------------------------------------------------------- /screenshots/dark-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benhager/solarized-matlab/99daa9734bf84226228e8278884103e5ca0a77fa/screenshots/dark-theme.png -------------------------------------------------------------------------------- /screenshots/light-theme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/benhager/solarized-matlab/99daa9734bf84226228e8278884103e5ca0a77fa/screenshots/light-theme.png -------------------------------------------------------------------------------- /setupSolarized.m: -------------------------------------------------------------------------------- 1 | function varargout = setupSolarized(varargin) %#ok 2 | %=============================================================================== 3 | % FUNCTION: 4 | % setupSolarized.m 5 | % 6 | % PURPOSE: 7 | % Loads the Solarized color scheme, either light or dark as specified by the 8 | % user. More information about the Solarzied project can be found online: 9 | % 10 | % http://ethanschoonover.com/solarized 11 | % 12 | % RESULTS OF SCRIPT: 13 | % o The script loads the color pallet as defined by the solarized project 14 | % o Optional string inputs are 'light', ''dark', or 'default' (see examples 15 | % below for proper usage. The default option will restore the Matlab default 16 | % color scheme. 17 | % 18 | % EXAMPLE: 19 | % o setupSolarized('light'); 20 | % o setupSolarized('dark'); 21 | % o setupSolarized('default'); 22 | %=============================================================================== 23 | 24 | %=============================================================================== 25 | % REVISION HISTORY: 26 | % o Add colors setup to return to default 27 | % - Wang Yudong / 2015-01-05 28 | % o Utilities Toolbox: 29 | % - B. Hager / 2013-05-31 <- Original and debugged. 30 | % 31 | % COPYRIGHT: 32 | % This work and derivatives of this work are copyrighted by Honda 33 | % Aircraft Company. Any use without permission is strictly 34 | % prohibited. 35 | %=============================================================================== 36 | %% Initial Setup 37 | if (nargin==1) 38 | slrzd = varargin{1}; 39 | elseif (nargin==0) 40 | slrzd = 'default'; 41 | end 42 | 43 | % Setup the color pallet % SOLARIZED HEX 16/8 TERMCOL XTERM/HEX L*A*B RGB HSB 44 | % divide by 256 for Matlab % --------- ------- ---- ------- ----------- ---------- ----------- ----------- 45 | sol.base03 = [ 0 43 54] / 256; % base03 #002b36 8/4 brblack 234 #1c1c1c 15 -12 -12 0 43 54 193 100 21 46 | sol.base02 = [ 7 54 66] / 256; % base02 #073642 0/4 black 235 #262626 20 -12 -12 7 54 66 192 90 26 47 | sol.base01 = [ 88 110 117] / 256; % base01 #586e75 10/7 brgreen 240 #585858 45 -07 -07 88 110 117 194 25 46 48 | sol.base00 = [101 123 131] / 256; % base00 #657b83 11/7 bryellow 241 #626262 50 -07 -07 101 123 131 195 23 51 49 | sol.base0 = [131 148 150] / 256; % base0 #839496 12/6 brblue 244 #808080 60 -06 -03 131 148 150 186 13 59 50 | sol.base1 = [147 161 161] / 256; % base1 #93a1a1 14/4 brcyan 245 #8a8a8a 65 -05 -02 147 161 161 180 9 63 51 | sol.base2 = [238 232 213] / 256; % base2 #eee8d5 7/7 white 254 #e4e4e4 92 -00 10 238 232 213 44 11 93 52 | sol.base3 = [253 246 227] / 256; % base3 #fdf6e3 15/7 brwhite 230 #ffffd7 97 00 10 253 246 227 44 10 99 53 | sol.yellow = [181 137 0] / 256; % yellow #b58900 3/3 yellow 136 #af8700 60 10 65 181 137 0 45 100 71 54 | sol.orange = [203 75 22] / 256; % orange #cb4b16 9/3 brred 166 #d75f00 50 50 55 203 75 22 18 89 80 55 | sol.red = [220 50 47] / 256; % red #dc322f 1/1 red 160 #d70000 50 65 45 220 50 47 1 79 86 56 | sol.magenta = [211 54 130] / 256; % magenta #d33682 5/5 magenta 125 #af005f 50 65 -05 211 54 130 331 74 83 57 | sol.violet = [108 113 196] / 256; % violet #6c71c4 13/5 brmagenta 61 #5f5faf 50 15 -45 108 113 196 237 45 77 58 | sol.blue = [ 38 139 210] / 256; % blue #268bd2 4/4 blue 33 #0087ff 55 -10 -45 38 139 210 205 82 82 59 | sol.cyan = [ 42 161 152] / 256; % cyan #2aa198 6/6 cyan 37 #00afaf 60 -35 -05 42 161 152 175 74 63 60 | sol.green = [133 153 0] / 256; % green #859900 2/2 green 64 #5f8700 60 -20 65 133 153 0 68 100 60 61 | mat.black = [ 0 0 0] / 256; 62 | mat.white = [255 255 255] / 256; 63 | mat.blue = [ 0 0 255] / 256; 64 | mat.green = [ 34 139 34] / 256; 65 | mat.violet = [160 32 240] / 256; 66 | mat.red178 = [178 0 0] / 256; 67 | mat.red230 = [230 0 0] / 256; 68 | mat.golden = [178 140 0] / 256; 69 | mat.orange = [255 148 0] / 256; 70 | mat.chamois = [238 225 180] / 256; 71 | mat.iceblue = [202 232 232] / 256; 72 | mat.persian = [ 0 163 163] / 256; 73 | mat.yellow = [252 252 220] / 256; 74 | 75 | %% Setup Color Scheme for Light/Dark Options 76 | if strcmp(slrzd,'light') 77 | sycb = 0; % Set 'Use system colors' checkbox to False 78 | txc = sol.base00; % Set 'Text' color 79 | bgc = sol.base3; % Set 'Background' color 80 | kwd = sol.blue; % Set 'Keywords' color 81 | cmt = sol.cyan; % Set 'Comments' color - spec calls for base1, not sure about that... 82 | str = sol.magenta; % Set 'Strings' color 83 | ustr = sol.orange; % Set 'Unterminated strings' color 84 | scmd = sol.yellow; % Set 'System commands' color 85 | errs = sol.red; % Set 'Errors' color 86 | hyp = sol.blue; % Set 'Hyperlinks' color 87 | warn = sol.orange; % Set 'Warnings' color 88 | afhb = 0; % Set 'Autofix highlight' checkbox to False 89 | afh = sol.base2; % Set 'Autofix highlight' color 90 | % ahib = 0; % Set 'Automatically highlight' checkbox to False 91 | % ahi = sol.violet; % Set 'Automatically highlight' color 92 | vwss = sol.green; % Set 'Variables with shared scope' color 93 | hsb = 0; % Set 'Highlight sections' checkbox to False 94 | hsbc = mat.yellow; % Set 'Highlight sections' color to default yellow 95 | hclb = 1; % Set 'Highlight current line' checkbox to True 96 | hcl = sol.base2; % Set 'Highlight current line' color 97 | slnb = 1; % Set 'Show line numbers' checkbox to True 98 | rtlb = 1; % Set 'Show line' checkbox in Right-hand text limit to True 99 | elseif strcmp(slrzd,'dark') 100 | sycb = 0; % Set 'Use system colors' checkbox to False 101 | txc = sol.base0; % Set 'Text' color 102 | bgc = sol.base03; % Set 'Background' color 103 | kwd = sol.blue; % Set 'Keywords' color 104 | cmt = sol.cyan; % Set 'Comments' color - spec calls for base1, not sure about that... 105 | str = sol.magenta; % Set 'Strings' color 106 | ustr = sol.orange; % Set 'Unterminated strings' color 107 | scmd = sol.yellow; % Set 'System commands' color 108 | errs = sol.red; % Set 'Errors' color 109 | hyp = sol.blue; % Set 'Hyperlinks' color 110 | warn = sol.orange; % Set 'Warnings' color 111 | afhb = 0; % Set 'Autofix highlight' checkbox to False 112 | afh = sol.base00; % Set 'Autofix highlight' color 113 | % ahib = 0; % Set 'Automatically highlight' checkbox to False 114 | % ahi = sol.violet; % Set 'Automatically highlight' color 115 | vwss = sol.green; % Set 'Variables with shared scope' color 116 | hsb = 0; % Set 'Highlight sections' checkbox to False 117 | hsbc = sol.base02; % Set 'Highlight sections' color to default yellow 118 | hclb = 1; % Set 'Highlight current line' checkbox to True 119 | hcl = sol.base02; % Set 'Highlight current line' color 120 | slnb = 1; % Set 'Show line numbers' checkbox to True 121 | rtlb = 1; % Set 'Show line' checkbox in Right-hand text limit to True 122 | elseif strcmp(slrzd,'default') 123 | sycb = 1; % Set 'Use system colors' checkbox to True 124 | txc = mat.black; % Set 'Text' color 125 | bgc = mat.white; % Set 'Background' color 126 | kwd = mat.blue; % Set 'Keywords' color 127 | cmt = mat.green; % Set 'Comments' color - spec calls for base1, not sure about that... 128 | str = mat.violet; % Set 'Strings' color 129 | ustr = mat.red178; % Set 'Unterminated strings' color 130 | scmd = mat.golden; % Set 'System commands' color 131 | errs = mat.red230; % Set 'Errors' color 132 | hyp = mat.blue; % Set 'Hyperlinks' color 133 | warn = mat.orange; % Set 'Warnings' color 134 | afhb = 1; % Set 'Autofix highlight' checkbox to True 135 | afh = mat.chamois; % Set 'Autofix highlight' color 136 | % ahib = true; % Set 'Automatically highlight' checkbox to True 137 | % ahi = mat.iceblue; % Set 'Automatically highlight' color 138 | vwss = mat.persian; % Set 'Variables with shared scope' color 139 | hsb = 1; % Set 'Highlight sections' checkbox to True 140 | hsbc = mat.yellow; % Set 'Highlight sections' color to default yellow 141 | hclb = 0; % Set 'Highlight current line' checkbox to False 142 | hcl = sol.base2; % Set 'Highlight current line' color 143 | slnb = 1; % Set 'Show line numbers' checkbox to True 144 | rtlb = 1; % Set 'Show line' checkbox in Right-hand text limit to True 145 | end 146 | 147 | %% Desktop tool colors 148 | com.mathworks.services.Prefs.setBooleanPref('ColorsUseSystem',sycb); clear('sycb') 149 | 150 | com.mathworks.services.Prefs.setColorPref('ColorsText',java.awt.Color(txc(1), txc(2), txc(3))); 151 | com.mathworks.services.ColorPrefs.notifyColorListeners('ColorsText'); clear('txc') 152 | 153 | com.mathworks.services.Prefs.setColorPref('ColorsBackground',java.awt.Color(bgc(1), bgc(2), bgc(3))); 154 | com.mathworks.services.ColorPrefs.notifyColorListeners('ColorsBackground'); clear('bgc') 155 | 156 | %% Setup MATLAB syntax highlighting colors 157 | com.mathworks.services.Prefs.setColorPref('Colors_M_Keywords',java.awt.Color(kwd(1), kwd(2), kwd(3))); 158 | com.mathworks.services.ColorPrefs.notifyColorListeners('Colors_M_Keywords'); clear('kwd') 159 | 160 | com.mathworks.services.Prefs.setColorPref('Colors_M_Comments',java.awt.Color(cmt(1), cmt(2), cmt(3))); 161 | com.mathworks.services.ColorPrefs.notifyColorListeners('Colors_M_Comments'); clear('cmt') 162 | 163 | com.mathworks.services.Prefs.setColorPref('Colors_M_Strings',java.awt.Color(str(1), str(2), str(3))); 164 | com.mathworks.services.ColorPrefs.notifyColorListeners('Colors_M_Strings'); clear('str') 165 | 166 | com.mathworks.services.Prefs.setColorPref('Colors_M_UnterminatedStrings',java.awt.Color(ustr(1), ustr(2), ustr(3))); 167 | com.mathworks.services.ColorPrefs.notifyColorListeners('Colors_M_UnterminatedStrings'); clear('ustr') 168 | 169 | com.mathworks.services.Prefs.setColorPref('Colors_M_SystemCommands',java.awt.Color(scmd(1), scmd(2), scmd(3))); 170 | com.mathworks.services.ColorPrefs.notifyColorListeners('Colors_M_SystemCommands'); clear('scmd') 171 | 172 | com.mathworks.services.Prefs.setColorPref('Colors_M_Errors',java.awt.Color(errs(1), errs(2), errs(3))); 173 | com.mathworks.services.ColorPrefs.notifyColorListeners('Colors_M_Errors');clear('errs') 174 | 175 | %% Other colors 176 | com.mathworks.services.Prefs.setColorPref('Colors_HTML_HTMLLinks',java.awt.Color(hyp(1), hyp(2), hyp(3))); 177 | com.mathworks.services.ColorPrefs.notifyColorListeners('Colors_HTML_HTMLLinks'); clear('hyp') 178 | 179 | %% Code analyzer colors 180 | com.mathworks.services.Prefs.setColorPref('Colors_M_Warnings',java.awt.Color(warn(1), warn(2), warn(3))); 181 | com.mathworks.services.ColorPrefs.notifyColorListeners('Colors_M_Warnings'); clear('warn') 182 | 183 | com.mathworks.services.Prefs.setBooleanPref('ColorsUseMLintAutoFixBackground',afhb); 184 | com.mathworks.services.Prefs.setColorPref('ColorsMLintAutoFixBackground',java.awt.Color(afh(1), afh(2), afh(3))); 185 | com.mathworks.services.ColorPrefs.notifyColorListeners('ColorsMLintAutoFixBackground'); clear('afhb','afh') 186 | 187 | %% Variable and function colors 188 | % com.mathworks.services.Prefs.setBooleanPref('Editor.VariableHighlighting.Automatic',ahib); 189 | % com.mathworks.services.Prefs.setColorPref('Editor.VariableHighlighting.Color',java.awt.Color(ahi(1), ahi(2), ahi(3))); 190 | % com.mathworks.services.ColorPrefs.notifyColorListeners('Editor.VariableHighlighting.Color'); clear('ahib','ahi') 191 | 192 | % *** need to add checkbox option for variables with shared scope here 193 | com.mathworks.services.Prefs.setColorPref('Editor.NonlocalVariableHighlighting.TextColor',java.awt.Color(vwss(1), vwss(2), vwss(3))); 194 | com.mathworks.services.ColorPrefs.notifyColorListeners('Editor.NonlocalVariableHighlighting.TextColor');clear('vwss') 195 | 196 | %% Section display options 197 | com.mathworks.services.Prefs.setBooleanPref('EditorCodepadHighVisible',hsb); 198 | com.mathworks.services.Prefs.setColorPref('Editorhighlight-lines', java.awt.Color(hsbc(1), hsbc(2), hsbc(3))); 199 | clear('hsb','hsbc'); 200 | 201 | %% Editor/Debugger General display options 202 | com.mathworks.services.Prefs.setBooleanPref('Editorhighlight-caret-row-boolean',hclb); 203 | com.mathworks.services.Prefs.setColorPref('Editorhighlight-caret-row-boolean-color',java.awt.Color(hcl(1), hcl(2), hcl(3))); 204 | com.mathworks.services.ColorPrefs.notifyColorListeners('Editorhighlight-caret-row-boolean-color'); clear('hclb','hcl') 205 | 206 | com.mathworks.services.Prefs.setBooleanPref('EditorShowLineNumbers',slnb); clear('slnb') 207 | 208 | com.mathworks.services.Prefs.setBooleanPref('EditorRightTextLineVisible',rtlb); 209 | %EditorRightTextLineLimit=I80 210 | %EditorRightTextLimitLineWidth=I1 211 | clear('rtlb') 212 | 213 | %% Cleanup 214 | clear('sol') 215 | clear('mat') 216 | --------------------------------------------------------------------------------