├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── develop ├── RGBint2hex.m ├── annotated_default.png ├── color2javaRGBint.m ├── sample.cpp ├── sample.html ├── sample.java ├── sample.m ├── sample.tlc ├── sample.v ├── sample.vhdl ├── sample.x3d ├── sample.x3dv ├── sample.xml ├── short_sample.m └── template_scheme.prf ├── logo.png ├── schemer_export.m ├── schemer_import.m └── schemes ├── .gitattributes ├── .gitignore ├── CONTRIBUTING.md ├── LICENSE ├── README.md ├── cobalt.prf ├── darkmate.prf ├── darksteel.prf ├── default.prf ├── matrix.prf ├── monokai.prf ├── oblivion.prf ├── screenshots ├── cobalt.png ├── darkmate.png ├── darksteel.png ├── default.png ├── matrix.png ├── monokai.png ├── oblivion.png ├── solarized-dark.png ├── solarized-light.png ├── tango.png └── vibrant.png ├── solarized-dark.prf ├── solarized-light.prf ├── tango.prf └── vibrant.prf /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # 5 | # The above will handle all files NOT found below 6 | # 7 | 8 | ##--------------------------------------------------- 9 | # Common .gitattributes 10 | ##--------------------------------------------------- 11 | 12 | # Documents 13 | # ============ 14 | *.txt text 15 | *.md text 16 | 17 | # Graphics 18 | # ============ 19 | *.png binary 20 | *.jpg binary 21 | *.jpeg binary 22 | *.gif binary 23 | *.tif binary 24 | *.tiff binary 25 | *.ico binary 26 | *.svg text 27 | *.eps binary 28 | 29 | 30 | ##--------------------------------------------------- 31 | # Basic .gitattributes for a MATLAB repo 32 | ##--------------------------------------------------- 33 | 34 | # Source files 35 | # ============ 36 | *.m text 37 | *.prf text 38 | 39 | # Binary files 40 | # ============ 41 | *.p binary 42 | *.mex* binary 43 | *.fig binary 44 | *.mat binary 45 | *.mdl binary 46 | *.slx binary 47 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Editor autosave files 2 | *~ 3 | *.asv 4 | # Compiled MEX binaries (all platforms) 5 | *.mex* 6 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing 2 | ============ 3 | 4 | Adding a new colour scheme 5 | -------------------------- 6 | 7 | If you have created a new colour scheme, please add it to the [matlab-schemes] 8 | repository and *not* here. Instructions for this are available 9 | [here](https://github.com/scottclowe/matlab-schemes/blob/master/CONTRIBUTING.md). 10 | 11 | If you have already added a new colour scheme to [matlab-schemes] via an 12 | accepted pull request and want to mirror the change in [matlab-schemer], you 13 | will need to use [git-subtree]. 14 | 15 | Some general handy instructions for `git subtree` are available 16 | [here](https://medium.com/@v/git-subtrees-a-tutorial-6ff568381844#.lwmv2uwwk), 17 | [here](https://blogs.atlassian.com/2013/05/alternatives-to-git-submodule-git-subtree/), 18 | and [here](https://developer.atlassian.com/blog/2015/05/the-power-of-git-subtree/). 19 | Specifically for use with this repository, the instructions are as follows. 20 | 21 | You will first need to set up subtree so there is a remote tracking the 22 | [matlab-schemes] repository in addition to the usual origin remote tracking 23 | your fork of [matlab-schemer]. 24 | ```bash 25 | # One-time setup 26 | git remote add matlab-schemes https://github.com/scottclowe/matlab-schemes.git 27 | ``` 28 | 29 | Having done this setup, you can now merge commits from matlab-schemes into 30 | matlab-schemer as follows: 31 | ```bash 32 | git pull 33 | git subtree pull --prefix schemes matlab-schemes master 34 | git push 35 | ``` 36 | 37 | Improving MATLAB Schemer 38 | ------------------------ 39 | 40 | If you have made enhancements or bug fixes to MATLAB Schemer, itself please add 41 | them with a regular [pull request] to this repository. 42 | 43 | 44 | [matlab-schemer]: https://github.com/scottclowe/matlab-schemer 45 | [matlab-schemes]: https://github.com/scottclowe/matlab-schemes 46 | [git-subtree]: https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt 47 | [pull request]: https://help.github.com/articles/using-pull-requests/ 48 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2016, Scott C. Lowe 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in 11 | the documentation and/or other materials provided with the distribution 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 17 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![MATLAB FileExchange](https://img.shields.io/badge/MATLAB-FileExchange-orange.svg)][fex] 2 | 3 | 4 | MATLAB Schemer 5 | ============== 6 | 7 | This MATLAB package makes it easy to change the color scheme (a.k.a. theme) of 8 | the MATLAB display and GUI. 9 | 10 | You can use Schemer to import a predefined color scheme, transfer your color 11 | settings between installations, or create your own color scheme. 12 | 13 | A collection of color schemes is available in the schemes folder. 14 | Samples of these can be seen in [schemes/README.md](schemes/README.md), 15 | and browsed in the folder [schemes/screenshots](schemes/screenshots). 16 | This is a static subtree copy of the contents of the repository 17 | [matlab-schemes]. 18 | 19 | ![MATLAB Schemer logo](logo.png) 20 | 21 | 22 | Importing a color scheme 23 | ------------------------ 24 | 25 | Color schemes can be easily imported by running `schemer_import` at the MATLAB 26 | command prompt, without needing any inputs. This will open a GUI to select the 27 | file to import the color scheme from. 28 | 29 | When importing a color scheme, most of the settings will change immediately. 30 | However, some settings will require MATLAB to be restarted: 31 | - Variable highlighting colours 32 | - Wavy underlines for errors 33 | - Wavy underlines for warnings 34 | 35 | For more details, see the documentation on the function `schemer_import`, 36 | available with `help schemer_import`. 37 | 38 | 39 | Transferring a color scheme between MATLAB installations 40 | -------------------------------------------------------- 41 | 42 | If you are using a personalised color scheme in MATLAB, you may wish to save 43 | it for yourself so you can re-implement it easily if you reintall MATLAB. 44 | Or you may wish to transfer your personalised color scheme from one machine 45 | to another. This section describes the steps relevant in either scenario. 46 | 47 | On the source machine, run `schemer_export` to save a temporary color scheme 48 | file, and then transfer this file to the destination machine. 49 | 50 | When importing the new color scheme, instead of running `schemer_import` without 51 | any inputs, you should run `schemer_import(true)`. This passes a flag to tell 52 | the function to not only import the colour preferences, but to also import your 53 | boolean settings (such as whether to highlight the current cell/line, etc) 54 | from the file you exported from the source installation. 55 | 56 | 57 | Reverting to the MATLAB default color scheme 58 | -------------------------------------------- 59 | 60 | Should you wish to revert to the set of colours which MATLAB ships with, you 61 | should run `schemer_import('schemes/default.prf')`. 62 | 63 | This will import the MATLAB default theme from the stylesheet `default.prf` 64 | which comes as part of Schemer. 65 | 66 | To restore the out-of-the-box state for boolean settings (such as whether to 67 | highlight the current line) in addition to the colours, run 68 | `schemer_import('schemes/default.prf', true)`. 69 | 70 | You may be tempted to instead revert the colours by clicking the 71 | `Restore Default Colors` buttons in the `Color` pane of the MATLAB preferences. 72 | However, this will be less effective than importing the default colours through 73 | Schemer because these buttons will not reset all the MATLAB colour preferences. 74 | (There is no reset button for the Editor display preferences pane, nor for the 75 | other language syntax supported by MATLAB, which is available in the Editor 76 | Languages panel.) 77 | 78 | 79 | Creating a color scheme for others to use 80 | ----------------------------------------- 81 | 82 | When creating a color scheme to share with the rest of the world, it is 83 | recommended to ensure colours are chosen appropriately for all possible 84 | settings, even if they are not enabled. 85 | 86 | For example, if you are creating a dark colour scheme, you may have cell 87 | highlighting disabled but it would still be ill-advised to leave the background 88 | highlight colour for cell displays as the default pale beige because other users 89 | may have this setting enabled. 90 | 91 | 92 | ### Exporting through the GUI 93 | 94 | If you have made a custom color scheme using the MATLAB GUI to pick the colours, 95 | you can export the new color scheme with `schemer_export`. 96 | 97 | Please note, this requires you to have visited all relevant panes of the 98 | Preferences window at least once since MATLAB was installed, even if the 99 | settings have not been changed from the default. 100 | See the help for `schemer_export` for more details. 101 | 102 | 103 | ### Porting a theme from a different editor 104 | 105 | If you are converting a color scheme designed for another editor into a MATLAB 106 | stylesheet, you may find it easier to start with a duplicate of the template 107 | stylesheet [develop/template_scheme.prf](develop/template_scheme.prf) and copy 108 | the colours into this. 109 | 110 | To understand which colour settings the parameter names correspond to, you can 111 | refer to the annotated screenshot, 112 | [develop/annotated_default.png](develop/annotated_default.png). 113 | 114 | ![Annotated screenshot](develop/annotated_default.png) 115 | 116 | The values for each colour in the .prf stylesheet must be recorded as single 117 | RGB integers, with each colour channel in 8-bit (0-255), R as big endian, 118 | and a opaque alpha channel. Because the format for RGB colours in Java allows 119 | for an alpha channel and the integers are signed, all the colours you record 120 | in your .prf file should be negative, spanning the range 121 | `-16777216` (black, `[0,0,0]`) to `-1` (white, `[255,255,255]`). 122 | 123 | The text file for your pre-existing theme will typically specify its colous in 124 | hexadecimal format, or in terms of R, G, B values. You will need 125 | to convert the colours from this format into the format which MATLAB preference 126 | files use to specify colours instead. 127 | The Schemer package comes with a utility function 128 | [develop/color2javaRGBint.m](develop/color2javaRGBint.m) 129 | to help make this easier. See the `color2javaRGBint` documentation for more 130 | details. 131 | 132 | 133 | ### Setting colours for additional languages 134 | 135 | MATLAB supports syntax highlighting for several languanges in addition to its own. 136 | Currently these languages are 137 | MuPAD, TLC, VRML, C/C++, Java, VHDL, Verilog, and XML/HTML. 138 | The colours used for the syntax highlighting of all these languages can be set 139 | in the Languages subpanel of the Editor/Debugger pane in the Preferences window. 140 | 141 | Typically, one will want to make a color scheme which has colours in these 142 | languages which match the colours of the analogous MATLAB syntax. 143 | By default, this is the behaviour which Schemer will perform. 144 | 145 | Without specifying any inputs to `schemer_export`, an exported color scheme file 146 | will contain only the colours used for MATLAB syntax highlighting and no other 147 | languages, since it is expected that users will typically not set the colours 148 | for any of these languages. When this is loaded with `schemer_import`, the missing 149 | colours for additional languages are automatically completed based on the MATLAB 150 | syntax. 151 | 152 | If you do customise the colours for the additional language syntax highlighting, 153 | you can export this by setting an appropriate flag, such as `schemer_export(3)`. 154 | For more details, see the `schemer_export` documentation. 155 | 156 | If you are designing a color scheme and are very detail-oriented, you may like to 157 | do the following. 158 | 159 | 1. Configure the colours for the MATLAB syntax first in the Preferences > Colors 160 | panel and Programming Tools subpanel, along with Editor/Debugger > Display 161 | preference pane for the Current line highlighting and Right-hand text limit. 162 | 2. Export the colorscheme with `schemer_export('tmp.prf',1)`, excluding additional 163 | language syntax from the export. 164 | 3. Load the colorscheme with `schemer_import('tmp.prf')`, which overwrites the 165 | syntax for the additional languages with automatically inferred colours. 166 | 4. Open up the panel Preferences > Editor/Debugger > Languages and inspect the 167 | quality of the colorscheme in the addition languages. 168 | 5. Fix or improve any perceived issues with the colorscheme in the Languages panel. 169 | 6. Export the colorscheme again, but this time with `schemer_export(3)` to include 170 | the customised colours for the additional languages. 171 | 172 | 173 | ### Adding your scheme to this package 174 | 175 | If you are particularly proud of your new color scheme (and why wouldn't you be) 176 | and would like to to share it with the world as part of the `matlab-schemer` 177 | package, this is possible! 178 | 179 | Please head over to our daughter repository, [matlab-schemes][], which holds the 180 | master copy of the color schemes issued here as part of Schemer in the schemes 181 | directory. 182 | 183 | If you fork [matlab-schemes][], add your `.prf` file and issue a pull request, 184 | the new scheme will be reviewed and added to the repository. 185 | This content is then mirrored here using `git subtree`. For more details, see 186 | our [CONTRIBUTING.md](CONTRIBUTING.md). 187 | 188 | 189 | Addendum 190 | -------- 191 | 192 | ### Requirements 193 | 194 | Please note that Schemer requires MATLAB to be run with Java support enabled. 195 | 196 | 197 | ### Further information 198 | 199 | For details on how the method was implemented, see 200 | [this Undocumented Matlab article](http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically). 201 | 202 | 203 | [matlab-schemes]: https://github.com/scottclowe/matlab-schemes 204 | [fex]: http://mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 205 | -------------------------------------------------------------------------------- /develop/RGBint2hex.m: -------------------------------------------------------------------------------- 1 | %RGBINT2HEX Convert RGB integer into hexadecimal colour 2 | % HEX = RGBINT2HEX(INT) given an RGB integer, convert it into a 3 | % hexadecimal string. 4 | % 5 | % This is a helper function which you can use when manually creating your 6 | % own MATLAB colour schemes. It is the inverse of COLOR2JAVARGBINT. 7 | % 8 | % See also COLOR2JAVARGBINT. 9 | 10 | % Copyright (c) 2015-2016, Scott C. Lowe 11 | % All rights reserved. 12 | % 13 | % Redistribution and use in source and binary forms, with or without 14 | % modification, are permitted provided that the following conditions are 15 | % met: 16 | % * Redistributions of source code must retain the above copyright 17 | % notice, this list of conditions and the following disclaimer. 18 | % * Redistributions in binary form must reproduce the above copyright 19 | % notice, this list of conditions and the following disclaimer in 20 | % the documentation and/or other materials provided with the distribution 21 | % 22 | % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 23 | % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24 | % IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25 | % ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 26 | % LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 27 | % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 28 | % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 29 | % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 30 | % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 31 | % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 32 | % POSSIBILITY OF SUCH DAMAGE. 33 | 34 | function hex = RGBint2hex(int) 35 | 36 | % Make a Java colour object 37 | jc = java.awt.Color(int); 38 | % Convert R,G,B into hexadecimal 39 | hex = sprintf('%02s', ... 40 | dec2hex(jc.getRed), dec2hex(jc.getGreen), dec2hex(jc.getBlue)); 41 | 42 | end 43 | -------------------------------------------------------------------------------- /develop/annotated_default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/develop/annotated_default.png -------------------------------------------------------------------------------- /develop/color2javaRGBint.m: -------------------------------------------------------------------------------- 1 | %COLOR2JAVARGBINT Converts a 256-bit color into a corresponding Java int 2 | % INT = COLOR2JAVARGBINT(HEX) converts the hexadecimal string HEX into a 3 | % negative integer INT which is used by Java as an RGB value equivalent 4 | % to the hexadecimal HEX. HEX should be a triple of 256-bit values, 5 | % possibly prepended by a hash ('#'). Alternatively, HEX can be a triple 6 | % of 16-bit values to provide a 16-bit colour instead. 7 | % 8 | % INT = COLOR2JAVARGBINT(RGB) converts the 3-element RGB colour into INT. 9 | % 10 | % INT = COLOR2JAVARGBINT(R, G, B) converts the triple [R G B] into INT. 11 | % 12 | % This is a helper function which you can use when manually creating your 13 | % own MATLAB colour schemes. 14 | % If you have a set of hexadecimal colours which you want to use, 15 | % you can copy the template colour scheme file, then convert each colour 16 | % using COLOR2JAVARGBINT. The output will be a negative integer, which 17 | % should be placed after the appropriate '...=C-' (with a only a single 18 | % minus sign present). 19 | % 20 | % See also SCHEME_EXPORT, RGBINT2HEX. 21 | 22 | % Copyright (c) 2013-2016, Scott C. Lowe 23 | % All rights reserved. 24 | % 25 | % Redistribution and use in source and binary forms, with or without 26 | % modification, are permitted provided that the following conditions are 27 | % met: 28 | % * Redistributions of source code must retain the above copyright 29 | % notice, this list of conditions and the following disclaimer. 30 | % * Redistributions in binary form must reproduce the above copyright 31 | % notice, this list of conditions and the following disclaimer in 32 | % the documentation and/or other materials provided with the distribution 33 | % 34 | % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 35 | % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 36 | % IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 37 | % ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 38 | % LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 39 | % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 40 | % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 41 | % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 42 | % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 43 | % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 44 | % POSSIBILITY OF SUCH DAMAGE. 45 | 46 | function int = color2javaRGBint(X, varargin) 47 | 48 | % Input handling 49 | if nargin==3 50 | if ~isnumeric(X) || ~isnumeric(varargin{1}) || ~isnumeric(varargin{2}) 51 | error('With three inputs given, all should be scalars'); 52 | end 53 | % Concatenate R,G,B together 54 | X = [X(:); varargin{1}(:); varargin{2}(:)]; 55 | elseif nargin~=1 56 | error('Incorrect number of inputs. Should be 1 or 3.'); 57 | end 58 | 59 | if ischar(X) 60 | % Handle Hex string conversion 61 | int = hex2javaRGBint(X); 62 | elseif isnumeric(X) 63 | % Handle RGB conversion 64 | int = RGB2javaRGBint(X); 65 | else 66 | error('Input was neither string nor numeric'); 67 | end 68 | 69 | end 70 | 71 | 72 | function int = hex2javaRGBint(hex) 73 | 74 | % Input handling 75 | if length(hex)==7 && strcmp(hex(1),'#') 76 | hex = hex(2:end); 77 | end 78 | if length(hex)==3 79 | % Assume a 16-bit colour (fff, 333, 840, etc) 80 | % This should be replicated to make ffffff, 333333, 884400, etc. 81 | % This is sometimes used on the web as shorthand for the 256-bit 82 | % colours, particularly for the grey shades. 83 | hex = reshape(repmat(hex, 2, 1), 1, 6); 84 | elseif length(hex)~=6 85 | % Length should be 6 for a three channel 256-bit hexadecimal 86 | error('Input string was not a hexadecimal number'); 87 | end 88 | 89 | % Make a Java color object 90 | jc = java.awt.Color(hex2dec(hex)); 91 | % Check what the RGB int is equal to 92 | int = jc.getRGB(); 93 | % This is equivalent to 94 | % int = hex2dec(hex) - (256^2*255 + 256*255 + 256); 95 | 96 | end 97 | 98 | 99 | 100 | function int = RGB2javaRGBint(X) 101 | 102 | % Input handling 103 | if numel(X)==1 104 | % Assume input is greyscale 105 | X = repmat(X, 3, 1); 106 | end 107 | if numel(X)~=3 108 | error('Input did not contain three colour channels'); 109 | end 110 | if any(X<0) 111 | error('R,G,B cannot be negative'); 112 | end 113 | if any(X>255) 114 | error('R,G,B should be not exceed 255'); 115 | end 116 | if all(X<1) 117 | % Rescale from 0-1 to 0-255 118 | X = round(X*255); 119 | end 120 | 121 | % Convert R, G, and B into a single integer 122 | dec = 256^2 * X(1) + 256 * X(2) + X(3); 123 | 124 | % Make a Java color object 125 | jc = java.awt.Color(dec); 126 | % Check what the RGB int is equal to 127 | int = jc.getRGB(); 128 | % This is equivalent to 129 | % int = dec - (256^2*255 + 256*255 + 256); 130 | 131 | end 132 | -------------------------------------------------------------------------------- /develop/sample.cpp: -------------------------------------------------------------------------------- 1 | /* Here's a simple Hello World program in C++, which won't 2 | * do much, but does show syntax highlighting. 3 | */ 4 | #include 5 | 6 | void some_complex_work(); 7 | 8 | int main() 9 | { 10 | if (2+2==5) 11 | { 12 | // This happens very often indeed 13 | std::cout << "Hello World!"; 14 | } 15 | else 16 | { 17 | @ // bad character makes an error 18 | character = 'a'; 19 | len = strlen("foobar"); 20 | return len; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /develop/sample.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Latin Lipsum - Hello, World! 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 |

Hello, World!

15 | 16 |

17 | Lorem ipsum dolor sit amet, appetere disputationi te eam, eu 18 | cum eius nulla everti. Id eam sale nostrud menandri! Pri an 19 | duis probo, splendide consequuntur ne vis. 20 |

21 | 22 | 23 | 24 | 25 | 28 | 31 | 32 |
26 | 27 | 29 | Dicta iudico eos ne, at iisque persecuti his. 30 |
33 |

34 | Tale iriure 35 | laboramus te sea, nec iusto veritus cu, id purto patrioque 36 | sea? Mei at dicit propriae. 37 |

38 | 39 | 40 | -------------------------------------------------------------------------------- /develop/sample.java: -------------------------------------------------------------------------------- 1 | /* HelloWorld.java 2 | * Demonstrates syntax highlighting for Java. 3 | */ 4 | package fibsandlies; 5 | import java.util.HashMap; 6 | 7 | class HelloWorld { 8 | /* 9 | * Documentation for the method appears here. 10 | * Prints the string "Hello, world!" to the console. 11 | */ 12 | public static void main(String[] args) { 13 | // Make a character 14 | char c = 'A'; 15 | // Assemble the output string 16 | string s = "Hello," + " world" + "!"; 17 | int len = s.length(); 18 | // Print to screen 19 | System.out.println(s); 20 | // Generate an error 21 | ## 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /develop/sample.m: -------------------------------------------------------------------------------- 1 | function sample() 2 | % Create an output file with sys command 3 | !touch test_file.txt 4 | fid = fopen('test_file.txt', 'w'); 5 | for i=1:20 6 | fprintf(fid, '%d unterminated\n, i); 7 | end 8 | fclose(fid); 9 | end 10 | 11 | function unusedFunc(passedInput) 12 | persistent global_value; 13 | global_value = global_value + 1; 14 | %% Title of cell 15 | printed_var = subFunc(global_value) 16 | unused_var = printed_var; 17 | function out = subFunc(scaleFactor) 18 | fprintf('Scale %.4f\n', scaleFactor); 19 | out = passedInput * scaleFactor; 20 | end 21 | end 22 | -------------------------------------------------------------------------------- /develop/sample.tlc: -------------------------------------------------------------------------------- 1 | %implements Sample "C" 2 | 3 | %% Function: SampleFunction =============================================== 4 | %% Abstract: 5 | %% Doesn't do anything, but does contain some TLC code 6 | %% with syntax highlighting. 7 | %% 8 | %function SampleFunction(inputVal, indexVal) void 9 | %% Need this library to use FILE 10 | %")> 11 | 12 | sprintf("index: %i", indexVal) 13 | 14 | %openfile testFile 15 | Some text to verbosely go into the file. 16 | %closefile testFile 17 | 18 | %assign myVar = STRING(ParamSettings.Input) 19 | char fileName[%] = "%"; 20 | 21 | %if flagTrue 22 | void *tp = %; 23 | %else 24 | %return "" 25 | %endif 26 | 27 | %% [EOF] sample.tlc 28 | -------------------------------------------------------------------------------- /develop/sample.v: -------------------------------------------------------------------------------- 1 | /* Sample Verilog code, which doesn't really do anything 2 | * but it does show syntax highlighting 3 | */ 4 | module main(inputVar, flip); 5 | input inputVar; 6 | input flip; 7 | 8 | reg flop; 9 | 10 | // Comment about dummy code which doesn't work 11 | always @(posedge flip or posedge inputVar) 12 | if (reset) 13 | begin 14 | flop <= (0 & ~inputVar); 15 | end 16 | else 17 | begin 18 | $display("Hello world!"); 19 | $finish; 20 | end 21 | endmodule 22 | -------------------------------------------------------------------------------- /develop/sample.vhdl: -------------------------------------------------------------------------------- 1 | library IEEE; 2 | use IEEE.STD_LOGIC_1164.ALL; 3 | use IEEE.NUMERIC_STD.ALL; 4 | 5 | -- Comment about the Driver here 6 | entity Driver is 7 | port( x : in std_logic; 8 | F : out std_logic 9 | ); 10 | end Driver; 11 | 12 | architecture gate_level of Driver is 13 | begin 14 | if newx(x downto (x-3))="0000" then 15 | F <= '1'; 16 | else 17 | F <= not(x(2) xor x(2)); --XNOR gate with 2 inputs 18 | end if; 19 | end gate_level; 20 | -------------------------------------------------------------------------------- /develop/sample.x3d: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 28 | 29 | 30 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 47 | 49 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /develop/sample.x3dv: -------------------------------------------------------------------------------- 1 | #X3D V3.0 utf8 2 | PROFILE Interchange 3 | META "filename" "sample.x3dv" 4 | 5 | # Define scripts 6 | DEF Script1 Script { 7 | inputOnly SFTime touchTime 8 | outputOnly SFBool toScript2 9 | outputOnly SFString string 10 | url [ "ecmascript: 11 | function touchTime() { 12 | toScript2 = TRUE; 13 | } 14 | function eventsProcessed() { 15 | string = 'Script1.eventsProcessed'; 16 | toScript3 = TRUE; 17 | } 18 | " ] 19 | } 20 | 21 | # Draw a blue ball 22 | Transform { 23 | children [ 24 | NavigationInfo { 25 | headlight FALSE 26 | avatarSize [ 0.25 1.6 0.75 ] 27 | type [ "EXAMINE" ] 28 | } 29 | DirectionalLight { 30 | } 31 | Transform { 32 | translation 2.0 0.0 1.0 33 | children [ 34 | Shape { 35 | geometry Sphere { radius 2.3 36 | } 37 | appearance Appearance { 38 | material Material { diffuseColor 0.0 0.0 1.0 39 | } 40 | } 41 | } 42 | ] 43 | } 44 | ] 45 | } 46 | 47 | # Set the viewpoint 48 | Viewpoint { position 7 -1 18 } 49 | 50 | # Set up the scripts 51 | ROUTE TS.touchTime TO Script1.touchTime 52 | ROUTE Script1.string TO Collector.fromString 53 | ROUTE Collector.string TO Result.string 54 | -------------------------------------------------------------------------------- /develop/sample.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Lorem ipsum dolor sit amet. 7 | 8 | Missing value error in bar tag 9 | 10 | Cibo malorum deseruisse nec at. Fabulas quaestio sit eu, nam 11 | viderer percipit deserunt at. 12 | & ". 15 | ]]> 16 | 17 | 18 | -------------------------------------------------------------------------------- /develop/short_sample.m: -------------------------------------------------------------------------------- 1 | function short_sample() 2 | % Short syntax highlighting sample 3 | global gbl_value; 4 | gbl_value = 20 5 | hghlghtvar = 'a_string_example_here'; 6 | 7 | %% Title of cell 8 | badstring = 'unterminated_string; 9 | unusedvar = hghlghtvar; 10 | !echo "Example `!` system command" 11 | for iterval = 1:2:gbl_value 12 | % This is a very informative comment 13 | fprintf('%s:%d\n',hghlghtvar,iterval); 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /develop/template_scheme.prf: -------------------------------------------------------------------------------- 1 | # - MATLAB color scheme 2 | # Created by 3 | # 4 | ColorsUseSystem=Bfalse 5 | ColorsUseMLintAutoFixBackground=Btrue 6 | Editor.VariableHighlighting.Automatic=Btrue 7 | Editor.NonlocalVariableHighlighting=Btrue 8 | EditorCodepadHighVisible=Btrue 9 | EditorCodeBlockDividers=Btrue 10 | Editorhighlight-caret-row-boolean=Btrue 11 | EditorRightTextLineVisible=Btrue 12 | EditorRightTextLimitLineWidth=I1 # Width of bar for right-hand text limit 13 | ColorsText=C- # Main text colour 14 | ColorsBackground=C- # Main background colour 15 | Colors_M_Keywords=C- # Text for keywords (function, for, end, etc) 16 | Colors_M_Comments=C- # Text for comments 17 | Colors_M_Strings=C- # Text for strings 18 | Colors_M_UnterminatedStrings=C- # Text for unterminated strings 19 | Colors_M_SystemCommands=C- # Text for shell commands 20 | Colors_M_Errors=C- #*Editor error messages and underlines, go-to bars 21 | Colors_HTML_HTMLLinks=C- # Text for URLs 22 | Color_CmdWinWarnings=C- #^Command window Warning text 23 | Color_CmdWinErrors=C- #^Command window Error text 24 | Colors_M_Warnings=C- #*Editor Warning underlines and go-to-warning bars 25 | ColorsMLintAutoFixBackground=C- # Background for autofixable 26 | Editor.VariableHighlighting.Color=C- #*Background for occurances of current variable 27 | Editor.NonlocalVariableHighlighting.TextColor=C- # Text for global variables 28 | Editorhighlight-lines=C- # Background of current cell 29 | Editorhighlight-caret-row-boolean-color=C- # Background of current line 30 | EditorRightTextLimitLineColor=C- # Colour of bar for right-hand text limit 31 | 32 | #Legend 33 | # * = Preference does not update until after restarting MATLAB 34 | # ^ = Preference not present on all versions of MATLAB 35 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/logo.png -------------------------------------------------------------------------------- /schemer_export.m: -------------------------------------------------------------------------------- 1 | %SCHEMER_EXPORT Export current MATLAB color scheme to text file 2 | % If this is your first time using SCHEMER_EXPORT, please ensure you 3 | % read the IMPORTANT NOTE at the bottom of the help section before using 4 | % this function. 5 | % 6 | % SCHEMER_EXPORT() with no input will prompt the user to locate a 7 | % destination file via the GUI, and will save the current color scheme 8 | % to this location. Please read the IMORTANT NOTE below 9 | % before running this script or it may not work correctly. 10 | % The MATLAB preference options which are exported are: 11 | % - All settings in the Color pane of Preferences 12 | % - All settings in the Color > Programming Tools pane 13 | % - From Editor/Debugger > Display pane, the following: 14 | % - Highlight current line (whether to highlight, and the colour) 15 | % - Right-hand text limit (colour and thickness, whether on/off) 16 | % The output format is the same as used in MATLAB's preferences file, 17 | % which is found at FULLFILE(PREFDIR,'matlab.prf'). 18 | % 19 | % SCHEMER_EXPORT(FILENAME) exports the relevant MATLAB preferences 20 | % to the file FILENAME. 21 | % 22 | % SCHEMER_EXPORT(FILENAME, FLAG_MODE) controls which settings are output 23 | % into the preference file FILENAME. Along with the colour settings for 24 | % MATLAB syntax highlighting, one can also export the boolean preferences 25 | % (such as whether cells and non-local variables, etc, should be coloured 26 | % differently to the regular backgound and text); and one can also export 27 | % the colour settings for syntax highlighting in other languages 28 | % supported by MATLAB. 29 | % 30 | % The FLAG_MODE settings available are: 31 | % 0 - neither booleans, nor additional languages are exported 32 | % 1 - boolean settings are exported, but not additional languages 33 | % 2 - additional language colours are exported, but not boolean settings 34 | % 3 - both booleans and additional languages are exported 35 | % 36 | % By default FLAG_MODE is set to 1, so boolean settings will be 37 | % exported, but the settings for syntax highlighting in additional 38 | % languages will not be. 39 | % 40 | % The colour settings for all MATLAB syntax highlighting will always be 41 | % exported, even for syntax options which are currently disabled, and 42 | % regardless of whether the boolean settings are being exported. This is 43 | % because users loading your exported color scheme may want syntax 44 | % options highlighted which you are not currently using. Consequently, 45 | % when designing a color scheme, it is advisable to set colours for all 46 | % possisble MATLAB colour settings, even if you don't usually use them. 47 | % By default, SCHEMER_IMPORT will not import boolean settings, so users 48 | % will keep their syntax options enabled or disabled as they prefer even 49 | % after importing your color scheme. 50 | % 51 | % Colours for highlighting syntax in other languages supported by MATLAB 52 | % (MuPAD, TLC, VRML, C++, Java, VHDL, Verilog, XML) can be set in the 53 | % preferences panel Editor/Debugger > Language. If you have not set any 54 | % of these colours yourself, you should not export them. If SCHEMER_IMPORT 55 | % loads a color scheme without additional language syntax included, the 56 | % MATLAB colours are extended to highlight syntax in the other languages 57 | % consistent with the MATLAB scheme. 58 | % 59 | % SCHEMER_EXPORT(FLAG_MODE, FILENAME), with a numeric input followed by a 60 | % string, will also work as above because the input order is reversible. 61 | % 62 | % SCHEMER_EXPORT(FLAG_MODE) with a single numeric input will open the GUI 63 | % to pick the filename and will save the output according to FLAG_MODE. 64 | % 65 | % RET = SCHEMER_EXPORT(...) returns 1 on success, 0 on user 66 | % cancellation at the output file selection screen, -1 on fopen error, 67 | % and -2 on any other error. 68 | % 69 | % [RET, NAMES, PREFS] = SCHEMER_EXPORT(...) also returns two cell 70 | % arrays listing the names and preferences which were saved to file. 71 | % 72 | % For more details on how to get and set MATLAB preferences with 73 | % commands, see the following URL. 74 | % http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically 75 | % 76 | % IMPORTANT NOTE: 77 | % You must have, at any point since installing MATLAB, visited the 78 | % Color, Color>Programming Tools and Editor/Debugger>Display panes of 79 | % the Preferences diaglogue within MATLAB and then clicked OK in order 80 | % for all the settings to be exported correctly. You will obviously have 81 | % done this for any settings you have changed but, for example, you may 82 | % have left the Editor/Debugger>Display settings unchanged. If this 83 | % preference pane has not been set its entries will not have been 84 | % defined, and when trying to export these they will be incorrectly saved 85 | % as off (for booleans) or black (for colours). 86 | % 87 | % Example 1: User is not sure if they have OK'd all the relevent 88 | % Preferences panes (or sure they haven't). 89 | % - Open File>Preferences 90 | % - On the left-hand side 91 | % - Click Colors 92 | % - Click Programming Tools (underneath "Colors" as a subsection) 93 | % - Click Editor/Debugger (a different panel to Colors) 94 | % - Click Display (underneath "Editor/Debugger" as a subsection) 95 | % - Click OK 96 | % (Yes, that is literally all you need to do to make sure you can 97 | % export correctly. There is no need to click anywhere which was 98 | % not mentioned. You just have to have each pane appear, and then 99 | % click OK at the end.) 100 | % - Go to your command window and execute SCHEMER_EXPORT 101 | % - The GUI appears, and you pick where to save the file. 102 | % 103 | % Example 2: User is sure they have OK'd all the relevent Preferences 104 | % panes already. 105 | % schemer_export 106 | % 107 | % Example 3: User is sure they have OK'd all the relevent Preferences 108 | % panes already, knows the path they wish to save to, and doesn't want 109 | % to export their boolean settings. 110 | % schemer_export('some/path/schemeName.prf', 0) 111 | % 112 | % Example 4: User has set some colour preferences for C/C++ syntax 113 | % highlighting in addition to MATLAB syntax highlighting, and wants to 114 | % output this along with their boolean settings 115 | % schemer_export(3) 116 | % 117 | % See also SCHEMER_IMPORT, PREFDIR, COLOR2JAVARGBINT. 118 | 119 | % Copyright (c) 2013-2016, Scott C. Lowe 120 | % All rights reserved. 121 | % 122 | % Redistribution and use in source and binary forms, with or without 123 | % modification, are permitted provided that the following conditions are 124 | % met: 125 | % * Redistributions of source code must retain the above copyright 126 | % notice, this list of conditions and the following disclaimer. 127 | % * Redistributions in binary form must reproduce the above copyright 128 | % notice, this list of conditions and the following disclaimer in 129 | % the documentation and/or other materials provided with the distribution 130 | % 131 | % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 132 | % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 133 | % IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 134 | % ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 135 | % LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 136 | % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 137 | % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 138 | % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 139 | % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 140 | % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 141 | % POSSIBILITY OF SUCH DAMAGE. 142 | 143 | function varargout = schemer_export(fname, flag_mode) 144 | 145 | % ------------------------ Parameters ------------------------------------- 146 | SCHEMER_VERSION = 'v1.4.0'; 147 | SCHEMER_URLGIT = 'https://github.com/scottclowe/matlab-schemer'; 148 | SCHEMER_URLFEX = 'https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer'; 149 | DEFOUTNAME = 'ColorSchemeForMATLAB.prf'; 150 | 151 | % ------------------------ Input handling --------------------------------- 152 | % Default inputs 153 | if nargin<2 154 | % Default is on. Recipient can pick themselves whether to import. 155 | flag_mode = 1; 156 | end 157 | if nargin<1 158 | fname = []; 159 | end 160 | % Input switching 161 | if nargin>=1 && ~ischar(fname) && ~isempty(fname) 162 | if ~isnumeric(fname) 163 | error('Invalid input argument 1'); 164 | end 165 | if nargin==1 166 | % First input omitted 167 | flag_mode = fname; 168 | fname = []; 169 | elseif ischar(flag_mode) 170 | % Inputs switched 171 | tmp = fname; 172 | fname = flag_mode; 173 | flag_mode = tmp; 174 | clear tmp; 175 | else 176 | error('Invalid combination of inputs'); 177 | end 178 | end 179 | % Mode handling 180 | if ~isnumeric(flag_mode) 181 | error('Export mode flag must be numeric.'); 182 | elseif flag_mode < 0 || flag_mode > 3 183 | error('Bad mode specified: %s', num2str(flag_mode)); 184 | end 185 | inc_bools = mod(flag_mode, 2); 186 | inc_otherlangs = flag_mode >= 2; 187 | % 0: no bools, no other languages 188 | % 1: yes bools, no other languages 189 | % 2: no bools, yes other languages 190 | % 3: yes bools, yes other languages 191 | 192 | % ------------------------ Settings --------------------------------------- 193 | % Names of boolean preferences which should always be output 194 | names_boolean = { ... 195 | 'ColorsUseSystem' ; ... % Color: Desktop: Use system colors 196 | }; 197 | % Names of boolean preferences which the user can choose whether to output 198 | names_boolextra = { ... 199 | 'ColorsUseMLintAutoFixBackground' ; ... % Color>PT: Analyser: autofix highlight 200 | 'Editor.VariableHighlighting.Automatic' ; ... % Color>PT: Var&fn: auto highlight 201 | 'Editor.NonlocalVariableHighlighting' ; ... % Color>PT: Var&fn: with shared scope 202 | 'EditorCodepadHighVisible' ; ... % Color>PT: CellDisp: highlight cells 203 | 'EditorCodeBlockDividers' ; ... % Color>PT: CellDisp: show lines between cells 204 | 'Editorhighlight-caret-row-boolean' ; ... % Editor>Display: Highlight current line 205 | 'EditorRightTextLineVisible' ; ... % Editor>Display: Show Right-hand text limit 206 | }; 207 | % Names of preferences for which the values are integers 208 | names_integer = { ... 209 | 'EditorRightTextLimitLineWidth' ; ... % Editor>Display: Right-hand text limit Width 210 | }; 211 | % The names of the main colour panels, so we can let the user know by name 212 | % if there is an issue with any of them 213 | panels_main = { ... 214 | 'Color' ; ... 215 | 'Color > Programming Tools' ; ... 216 | 'Editor/Debugger > Display' ; ... 217 | }; 218 | % Names of colour preferences which are in the main panels and used in 219 | % MATLAB syntax highlighting 220 | names_color_main = { ... 221 | { ... % Color panel 222 | 'ColorsText' ; ... % Color: Desktop: main text colour 223 | 'ColorsBackground' ; ... % Color: Desktop: main background 224 | 'Colors_M_Keywords' ; ... % Color: Syntax: keywords 225 | 'Colors_M_Comments' ; ... % Color: Syntax: comments 226 | 'Colors_M_Strings' ; ... % Color: Syntax: strings 227 | 'Colors_M_UnterminatedStrings' ; ... % Color: Syntax: unterminated strings 228 | 'Colors_M_SystemCommands' ; ... % Color: Syntax: system commands 229 | 'Colors_M_Errors' ; ... % Color: Syntax: errors 230 | 'Colors_HTML_HTMLLinks' ; ... % Color: Other: hyperlinks 231 | } ... 232 | { ... % Color > Programming Tools 233 | 'Colors_M_Warnings' ; ... % Color>PT: Analyser: warnings 234 | 'ColorsMLintAutoFixBackground' ; ... % Color>PT: Analyser: autofix 235 | 'Editor.VariableHighlighting.Color' ; ... % Color>PT: Var&fn: highlight 236 | 'Editor.NonlocalVariableHighlighting.TextColor' ; ... % Color>PT: Var&fn: with shared scope 237 | 'Editorhighlight-lines' ; ... % Color>PT: CellDisp: highlight 238 | } ... 239 | { ... % Editor/Debugger > Display 240 | 'Editorhighlight-caret-row-boolean-color' ; ... % Editor>Display: Highlight current line Color 241 | 'EditorRightTextLimitLineColor' ; ... % Editor>Display: Right-hand text limit line Color 242 | } 243 | }; 244 | % Names of colour preferences which are known to have been added since the 245 | % year 2011, and so their presence in the preferences is not guaranteed 246 | % column 1: name of setting 247 | % column 2: first version in which preference might have been implemented 248 | % column 3: first version in which preference has been observed to exist 249 | names_color_versioned = { ... 250 | 'Color_CmdWinWarnings' , ... % Color: Command Window Warning messages 251 | '7.13' , ... % Known to NOT be in 2011a (7.12) 252 | '8.2' ; ... % Known to be in 2013b 253 | 'Color_CmdWinErrors' , ... % Color: Command Window Error messages 254 | '8.3' , ... % Known to NOT be in 2013b (8.2) 255 | '8.4' ; ... % Known to be in 2014b 256 | }; 257 | % Names of colour preferences for syntax highlighting in languages other 258 | % than MATLAB 259 | names_color_otherlangs = { ... 260 | { ... % MuPAD 261 | 'Editor.Language.MuPAD.Color.keyword' ; ... 262 | 'Editor.Language.MuPAD.Color.operator' ; ... 263 | 'Editor.Language.MuPAD.Color.block-comment' ; ... 264 | 'Editor.Language.MuPAD.Color.option' ; ... 265 | 'Editor.Language.MuPAD.Color.string' ; ... 266 | 'Editor.Language.MuPAD.Color.function' ; ... 267 | 'Editor.Language.MuPAD.Color.constant' ; ... 268 | } ... 269 | { ... % TLC 270 | 'Editor.Language.TLC.Color.Colors_M_SystemCommands' ; ... 271 | 'Editor.Language.TLC.Color.Colors_M_Keywords' ; ... 272 | 'Editor.Language.TLC.Color.Colors_M_Comments' ; ... 273 | 'Editor.Language.TLC.Color.string-literal' ; ... 274 | } ... 275 | { ... % C/C++ 276 | 'Editor.Language.C.Color.keywords' ; ... 277 | 'Editor.Language.C.Color.line-comment' ; ... 278 | 'Editor.Language.C.Color.string-literal' ; ... 279 | 'Editor.Language.C.Color.preprocessor' ; ... 280 | 'Editor.Language.C.Color.char-literal' ; ... 281 | 'Editor.Language.C.Color.errors' ; ... 282 | } ... 283 | { ... % Java 284 | 'Editor.Language.Java.Color.keywords' ; ... 285 | 'Editor.Language.Java.Color.line-comment' ; ... 286 | 'Editor.Language.Java.Color.string-literal' ; ... 287 | 'Editor.Language.Java.Color.char-literal' ; ... 288 | } ... 289 | { ... % VHDL 290 | 'Editor.Language.VHDL.Color.Colors_M_Keywords' ; ... 291 | 'Editor.Language.VHDL.Color.operator' ; ... 292 | 'Editor.Language.VHDL.Color.Colors_M_Comments' ; ... 293 | 'Editor.Language.VHDL.Color.string-literal' ; ... 294 | } ... 295 | { ... % Verilog 296 | 'Editor.Language.Verilog.Color.Colors_M_Comments' ; ... 297 | 'Editor.Language.Verilog.Color.operator' ; ... 298 | 'Editor.Language.Verilog.Color.Colors_M_Keywords' ; ... 299 | 'Editor.Language.Verilog.Color.string-literal' ; ... 300 | } ... 301 | { ... % XML 302 | 'Editor.Language.XML.Color.error' ; ... 303 | 'Editor.Language.XML.Color.tag' ; ... 304 | 'Editor.Language.XML.Color.attribute' ; ... 305 | 'Editor.Language.XML.Color.operator' ; ... 306 | 'Editor.Language.XML.Color.value' ; ... 307 | 'Editor.Language.XML.Color.comment' ; ... 308 | 'Editor.Language.XML.Color.doctype' ; ... 309 | 'Editor.Language.XML.Color.ref' ; ... 310 | 'Editor.Language.XML.Color.pi-content' ; ... 311 | 'Editor.Language.XML.Color.cdata-section' ; ... 312 | } 313 | }; 314 | 315 | % Names of colour preferences for syntax highlighting in languages other 316 | % than MATLAB 317 | names_color_vrml = { ... 318 | % VRML 319 | 'Editor.Language.VRML.Color.keyword' ; ... 320 | 'Editor.Language.VRML.Color.node-keyword' ; ... 321 | 'Editor.Language.VRML.Color.field-keyword' ; ... 322 | 'Editor.Language.VRML.Color.data-type-keyword' ; ... 323 | 'Editor.Language.VRML.Color.terminal-symbol' ; ... 324 | 'Editor.Language.VRML.Color.comment' ; ... 325 | 'Editor.Language.VRML.Color.string' ; ... 326 | }; 327 | % First version of matlab which uses VRMLX3DV instead of VRML 328 | version_vrmlx3dv = '9.0'; 329 | 330 | % Names of preferences for other language syntax and where setting value 331 | % is a string 332 | % column 1: name of preference 333 | % column 2: a regex which the string must match if it is to be exported 334 | % use '.' or '.+' to allow any non-empty string to be output 335 | % use '' or '.*' for anything, including empty strings 336 | % use '\S' for anything except empty or whitespace-only strings 337 | % use '^str1|str2|str3$' to allow only a finite set of strings 338 | names_string_otherlang = { ... 339 | 'Editor.Language.Java.method' , ... % Java: Show methods 340 | '^(none|bold|italic)$' ; ... 341 | }; 342 | 343 | 344 | % ------------------------ Setup ------------------------------------------ 345 | % Initialise output 346 | if nargout==0 347 | % Empty if no output requested 348 | varargout = {}; 349 | else 350 | % -2 to signify unknown error otherwise 351 | varargout = {-2}; 352 | end 353 | % If we are outputting all the bools, add them to the list to do 354 | if inc_bools 355 | names_boolean = [names_boolean; names_boolextra]; 356 | end 357 | 358 | % ------------------------ Check ------------------------------------- 359 | % Check the user is not exporting without having visited any of the 360 | % preference panels, or has otherwise set text and background to match 361 | if isequal(com.mathworks.services.Prefs.getColorPref('ColorsText').getRGB, ... 362 | com.mathworks.services.Prefs.getColorPref('ColorsBackground').getRGB) 363 | 364 | % Define the base error message. We will add to it depending on the 365 | % exact set up. 366 | msg = 'Colour for text and background appear to be the same.'; 367 | 368 | % The values match, so give an error 369 | if com.mathworks.services.Prefs.getColorPref('ColorsText').getRGB ... 370 | == -16777216 371 | % Since the colour is black, it seems the user hasn't visited the 372 | % colour preference panes at all 373 | msg = [msg, 10, ... 374 | 'Are you sure you have visited all the preference panels,'... 375 | ' as per the instructions in the function description?']; 376 | 377 | elseif com.mathworks.services.Prefs.getBooleanPref('ColorsUseSystem') 378 | % The colour is something else, but both text and background match. 379 | % The user is managing to use the colours by overriding them with 380 | % the system colours. 381 | msg = [msg, 10, ... 382 | 'Although you have enabled system colors, the underlying ', ... 383 | 'colour settings match. This is not permitted because the ', ... 384 | 'text would be illegible if system colours were disabled.']; 385 | 386 | else 387 | % The colour is something else, but both text and background match. 388 | % Presumably the text is currently illegible to the user right now. 389 | msg = [msg, 10, ... 390 | 'This is not permitted because the text is illegible.']; 391 | end 392 | 393 | % Raise the error with the completed message 394 | error(msg); 395 | end 396 | 397 | % Go through all the main color preference panels, checking their settings 398 | % are available to us 399 | % Initialise outer level of holding variables 400 | cprefs_main = cell(size(names_color_main)); 401 | colors_main = cell(size(names_color_main)); 402 | % Loop over every one of the main colour preference panels 403 | for iPanel = 1:numel(names_color_main) 404 | % Fetch the colours for this panel 405 | [cprefs_main{iPanel}, colors_main{iPanel}] = ... 406 | fetch_colors(names_color_main{iPanel}); 407 | % Only give the error on the Color and Programming Tools pages, because 408 | % there are only two colours set in the Editor > Display and they could 409 | % plausibly both be black. We instead check this panel seperately below. 410 | if iPanel <= 2 && all(colors_main{iPanel} == -16777216) 411 | % This panel appears to all be black, so we make an error 412 | error(... 413 | ['Colours for all of %1$s panel appear to be black. ' 10 ... 414 | 'This will be because you have never set the preferences ' ... 415 | 'in this panel. You can do so by visiting the %1$s ' ... 416 | 'Preferences page and clicking OK, as detailed in the ' ... 417 | 'description of this function.'], panels_main{iPanel}); 418 | end 419 | end 420 | % Check the Editor > Display panel has been initialised. 421 | % If it hasn't, the line width will appear to be 0, which is not a possible 422 | % setting. 423 | if com.mathworks.services.Prefs.getIntegerPref(... 424 | 'EditorRightTextLimitLineWidth') == 0 425 | % It hasn't been set, so we generate an error 426 | error(... 427 | ['Properties from the %1$s preference panel could not be loaded. ' ... 428 | 10 ... 429 | 'This will be because you have never set the preferences in '... 430 | 'this panel. You can do so by visiting the %1$s ' ... 431 | 'Preferences page and clicking OK, as detailed in the ' ... 432 | 'description of this function.'], panels_main{3}); 433 | end 434 | 435 | % Let the user know they are doing a stupid thing if they export when using 436 | % the default settings 437 | if com.mathworks.services.Prefs.getBooleanPref('ColorsUseSystem') 438 | warning(... 439 | ['You are exporting with system colors for main text and background.'... 440 | 10, 'The exported theme will look different on different systems.']); 441 | end 442 | 443 | % ------------------------ File stuff ------------------------------------- 444 | if isempty(fname) 445 | % Get user's name 446 | username = java.lang.System.getProperty('user.name'); 447 | % Prepend username to default filename 448 | outFileName = [char(username) DEFOUTNAME]; 449 | % Dialog asking for savename, with smart default output filename 450 | [filename, pathname] = uiputfile(outFileName, ... 451 | 'Select file to write MATLAB color scheme'); 452 | % End if user cancels 453 | if isequal(filename, 0); 454 | if nargout>0; varargout{1} = 0; end; 455 | return; 456 | end 457 | fname = fullfile(pathname, filename); 458 | end 459 | 460 | % Open for write access of text file, create if necessary 461 | fid = fopen(fname, 'w+t', 'n'); 462 | if isequal(fid, -1); 463 | if nargout>0; varargout{1} = -1; end; 464 | return; 465 | end 466 | % Add a cleanup object incase of failure 467 | finishup = onCleanup(@() fclose(fid)); 468 | 469 | % Find the name of the color scheme based on the filename 470 | [~, schemename] = fileparts(fname); 471 | 472 | % Write a few comments to the start of the file 473 | fprintf(fid, '# %s - MATLAB color scheme\n', schemename); 474 | fprintf(fid, '# Generated with schemer_export %s, on MATLAB %s\n', ... 475 | SCHEMER_VERSION, version); 476 | fprintf(fid, '# %s\n', char(java.util.Date)); 477 | fprintf(fid, '# To enable this color scheme in MATLAB use schemer_import, available at:\n'); 478 | fprintf(fid, '# %s\n', SCHEMER_URLGIT); 479 | fprintf(fid, '# %s\n', SCHEMER_URLFEX); 480 | 481 | 482 | % ------------------------ Read and Write --------------------------------- 483 | % Loop through the boolean type settings 484 | prefs_boolean = cell(size(names_boolean)); 485 | for i=1:length(names_boolean) 486 | % Check the name of this preference 487 | nm = names_boolean{i}; 488 | % Get the value of this boolean preference 489 | prefs_boolean{i} = com.mathworks.services.Prefs.getBooleanPref(nm); 490 | % Construct the string to output 491 | outstr = [nm '=B']; 492 | if prefs_boolean{i} 493 | outstr = [outstr 'true']; 494 | else 495 | outstr = [outstr 'false']; 496 | end 497 | outstr = [outstr '\n']; 498 | % Write this boolean value to the output file 499 | fprintf(fid, outstr); 500 | end 501 | 502 | % Loop through the integer type settings 503 | prefs_integer = cell(size(names_integer)); 504 | for i=1:length(names_integer) 505 | % Check the name of this preference 506 | nm = names_integer{i}; 507 | % Get the integer value for this preference 508 | prefs_integer{i} = com.mathworks.services.Prefs.getIntegerPref(nm); 509 | % Write this integer value to the output file 510 | fprintf(fid, '%s=I%d\n', nm, prefs_integer{i}); 511 | end 512 | 513 | % Loop through the colour type settings for MATLAB syntax highlighting 514 | for iPanel=1:numel(names_color_main) 515 | for iPref=1:numel(names_color_main{iPanel}) 516 | % Check the name of this preference 517 | nm = names_color_main{iPanel}{iPref}; 518 | % Write its colour value to the output file 519 | fprintf(fid, '%s=C%d\n', nm, colors_main{iPanel}(iPref)); 520 | end 521 | end 522 | 523 | % Loop over colours which may or may not be available 524 | % Initialise cell arrays for successful fields 525 | onames_versioned = {}; 526 | cprefs_versioned = {}; 527 | % Loop over the colours 528 | for iPref=1:size(names_color_versioned, 1) 529 | % Check the name of this preference 530 | nm = names_color_versioned{iPref, 1}; 531 | % Try to get the colour for this preference 532 | prf = com.mathworks.services.Prefs.getColorPref(nm); 533 | % If the current MATLAB version is less the first version where it is 534 | % not known whether it has implemented this preference feature 535 | % Or if the MATLAB version is less than the first version known to have 536 | % implemented the feature and the colour appears to be black 537 | % Then we skip this preference 538 | if verLessThan('matlab', names_color_versioned{iPref, 2}) ... 539 | || ( ... 540 | verLessThan('matlab', names_color_versioned{iPref, 3}) ... 541 | && prf.getRGB==-16777216 ... 542 | ) 543 | % It appears that this version of MATLAB does not include this 544 | % preference. So we skip it. 545 | continue; 546 | end 547 | % Otherwise, we write its colour value to the output file 548 | fprintf(fid, '%s=C%d\n', nm, prf.getRGB); 549 | % And we add the values to the list to output 550 | onames_versioned{end+1} = nm; 551 | cprefs_versioned{end+1} = prf; 552 | end 553 | 554 | 555 | % Initialise a cell array to output for other language syntax 556 | onames_langs = {}; 557 | cprefs_langs = {}; 558 | % Loop through the colour type settings for other language syntax, only if 559 | % it is requested 560 | if inc_otherlangs 561 | % Go through all the language color syntax preference panels, checking 562 | % their settings are available to us 563 | % Loop over every one of the main colour preference panels 564 | for iPanel = 1:numel(names_color_otherlangs) 565 | [panel_prefs, panel_colors] = fetch_colors(... 566 | names_color_otherlangs{iPanel}); 567 | if all(panel_colors==-16777216) 568 | % All the colours in this panel are black, so we assume the 569 | % color settings have not loaded because they have not been set 570 | continue; 571 | end 572 | % Not all the colours are black, so we assume we have loaded the 573 | % values for this language panel. 574 | 575 | % Loop again over every colour setting in the panel 576 | for iPref = 1:numel(names_color_otherlangs{iPanel}) 577 | % Get the name for the color setting we are interested in 578 | nm = names_color_otherlangs{iPanel}{iPref}; 579 | % Write its colour value to the output file 580 | fprintf(fid, '%s=C%d\n', nm, panel_colors(iPref)); 581 | end 582 | % Remember the prefences so we can return them 583 | onames_langs = [onames_langs; names_color_otherlangs{iPanel}]; 584 | cprefs_langs = [cprefs_langs; panel_prefs]; 585 | end 586 | end 587 | 588 | % We have to do special handling for VRML because in R2016a, MathWorks 589 | % changed the encoding name from VRML to VRMLX3DV. Aside from this, nothing 590 | % else was changed. The rest of the preference name is the same, and the 591 | % default values are unchanged. 592 | if inc_otherlangs 593 | % Deal with VRML and VRMLX3DV possibilities 594 | if verLessThan('matlab', version_vrmlx3dv) 595 | names_color_vrml_usable = names_color_vrml; 596 | else 597 | names_color_vrml_usable = strrep(names_color_vrml, ... 598 | '.VRML.', '.VRMLX3DV.'); 599 | end 600 | % Get the colours from the appropriate preference names 601 | [panel_prefs, panel_colors] = fetch_colors(names_color_vrml_usable); 602 | % If all the colours in this panel are black, we assume the color 603 | % settings have not loaded because they have not been set. 604 | if ~all(panel_colors==-16777216) 605 | for iPref = 1:numel(names_color_vrml) 606 | % Get the name for the color setting we are interested in 607 | nm = names_color_vrml{iPref}; 608 | % Write its colour value to the output file 609 | fprintf(fid, '%s=C%d\n', nm, panel_colors(iPref)); 610 | end 611 | % Remember the prefences so we can return them 612 | onames_langs = [onames_langs; names_color_otherlangs{iPanel}]; 613 | cprefs_langs = [cprefs_langs; panel_prefs]; 614 | end 615 | end 616 | 617 | % Do strings for other languages 618 | if inc_otherlangs 619 | for iPref=1:size(names_string_otherlang, 1) 620 | % Get the name for the string preference we are interested in 621 | nm = names_string_otherlang{iPref, 1}; 622 | % Read the string 623 | str = com.mathworks.services.Prefs.getStringPref(nm); 624 | % Turn it from a java.lang.String object to a regular char object 625 | str = char(str); 626 | % Check it is okay 627 | if isempty(regexp(str, names_string_otherlang{iPref, 2}, ... 628 | 'start', 'emptymatch')) 629 | % It did not have any matches for the regex, so we will not use 630 | % this setting. We will assume its value is not available. 631 | continue; 632 | end 633 | % It matched the regex for acceptable values, so we will export it 634 | fprintf(fid, '%s=S%s\n', nm, str); 635 | % Remember the prefence so we can return it 636 | onames_langs = [onames_langs; nm]; 637 | cprefs_langs = [cprefs_langs; str]; 638 | end 639 | end 640 | 641 | % ------------------------ Tidy up ---------------------------------------- 642 | % fclose(fid); % Don't need to close as it will autoclose 643 | if nargout>0; varargout{1} = 1; end; 644 | 645 | fprintf('Exported color scheme to %s\n', fname); 646 | 647 | if nargout>1; 648 | varargout{2} = cat(1, ... 649 | names_boolean , ... 650 | names_integer , ... 651 | names_color_main{:} , ... 652 | onames_versioned , ... 653 | onames_langs ); 654 | varargout{3} = cat(1, ... 655 | prefs_boolean , ... 656 | prefs_integer , ... 657 | cprefs_main{:} , ... 658 | cprefs_versioned , ... 659 | cprefs_langs ); 660 | end 661 | 662 | end 663 | 664 | 665 | function [prefs, colors] = fetch_colors(names) 666 | % Initialise holding variable for settings in this panel 667 | prefs = cell(size(names)); 668 | colors = nan(size(names)); 669 | % Loop over every colour setting in the panel 670 | for iName = 1:numel(names) 671 | % Read the preference for this colour and get a Java color object 672 | prefs{iName} = com.mathworks.services.Prefs.getColorPref(... 673 | names{iName}); 674 | % Turn this into an integer colour value 675 | colors(iName) = prefs{iName}.getRGB; 676 | end 677 | end -------------------------------------------------------------------------------- /schemer_import.m: -------------------------------------------------------------------------------- 1 | %SCHEMER_IMPORT Import a MATLAB color scheme 2 | % SCHEMER_IMPORT() with no input will prompt the user to locate the 3 | % color theme source file via the GUI. 4 | % 5 | % SCHEMER_IMPORT(FILENAME) imports the color scheme options given in 6 | % the file FILENAME. 7 | % 8 | % SCHEMER_IMPORT(FILENAME, INCLUDEBOOLS) can control whether boolean 9 | % preferences are included in import (default: FALSE). If INCLUDEBOOLS 10 | % is set to true, boolean preference options such as whether to 11 | % highlight autofixable errors, or to show variables with shared scope in 12 | % a different colour will also be overridden, should they be set in the 13 | % input file. 14 | % 15 | % SCHEMER_IMPORT(INCLUDEBOOLS, FILENAME), with a boolean or numeric input 16 | % followed by a string input, will also work as above because the input 17 | % order is reversible. 18 | % 19 | % SCHEMER_IMPORT(INCLUDEBOOLS) with a single boolean input will open the 20 | % GUI to pick the file, and will load boolean preferences in accordance 21 | % with INCLUDEBOOLS. 22 | % 23 | % RET = SCHEMER_IMPORT(...) returns 1 on success, 0 on user 24 | % cancellation at input file selection screen, -1 on fopen error, and -2 25 | % on any other error. 26 | % 27 | % NOTE: 28 | % The file to import can either be a color scheme file as generated by 29 | % SCHEMER_EXPORT, or an entire MATLAB preferences file such as the file 30 | % you will find located at FULLFILE(PREFDIR,'matlab.prf'). This could be 31 | % a MATLAB preferences file taken from a different computer or previous 32 | % MATLAB installation. However, if you are importing from a matlab.prf 33 | % file instead of a color scheme .prf file you should be aware that any 34 | % colour preferences which have been left as the defaults on preference 35 | % panels which the user has not visited on the origin system of the 36 | % matlab.prf file will not be present in the file, and hence not updated 37 | % on import. 38 | % 39 | % The MATLAB preference options which will be overwritten by 40 | % SCHEMER_IMPORT are: 41 | % - All settings in the Color pane of Preferencs 42 | % - All colour settings in the Color > Programming Tools pane, but no 43 | % checkboxes 44 | % - From Editor/Debugger > Display pane, the following: 45 | % - Highlight current line (colour, but not whether to) 46 | % - Right-hand text limit (colour and thickness, but not on/off) 47 | % - From Editor/Debugger > Language, the syntax highlighting colours for 48 | % each language. 49 | % 50 | % Once the current colour preferences are overridden they cannot be 51 | % undone, so it is recommended that you export your current preferences 52 | % with SCHEMER_EXPORT before importing a new theme if you think you 53 | % may wish to revert. 54 | % 55 | % This is not necessary if you are using the default MATLAB color scheme 56 | % which ships with the installation, as SCHEMER comes with a copy of the 57 | % MATLAB default color scheme (default.prf). 58 | % 59 | % If you wish to revert to the default MATLAB color scheme, it is 60 | % recommended you import the file default.prf included in this 61 | % package. This will reset Editor/Debugger>Display colours, colours for 62 | % syntax highlighting in additional languages, as well as the colours set 63 | % in the Colors pane. You can also revert the colors by clicking 64 | % "Restore Default Colors" in the MATLAB preference panel interface, but 65 | % this will be less effective because there are several panels which set 66 | % syntax colours and not all of them have a restore button. 67 | % 68 | % For more details on how to get and set MATLAB preferences with 69 | % commands, see the following URL. 70 | % http://undocumentedmatlab.com/blog/changing-system-preferences-programmatically/ 71 | % 72 | % See also SCHEMER_EXPORT, PREFDIR. 73 | 74 | % Copyright (c) 2013-2016, Scott C. Lowe 75 | % All rights reserved. 76 | % 77 | % Redistribution and use in source and binary forms, with or without 78 | % modification, are permitted provided that the following conditions are 79 | % met: 80 | % * Redistributions of source code must retain the above copyright 81 | % notice, this list of conditions and the following disclaimer. 82 | % * Redistributions in binary form must reproduce the above copyright 83 | % notice, this list of conditions and the following disclaimer in 84 | % the documentation and/or other materials provided with the distribution 85 | % 86 | % THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 87 | % AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 88 | % IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 89 | % ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 90 | % LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 91 | % CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 92 | % SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 93 | % INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 94 | % CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 95 | % ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 96 | % POSSIBILITY OF SUCH DAMAGE. 97 | 98 | % Known issues: 99 | % 100 | % 1. Text colour of automatically highlighted variables does not change 101 | % colour immediately. This is an issue with matlab; if you change the main 102 | % text colour in the preferences pane, highlighted variables will still 103 | % have the old text colour until matlab is restarted. 104 | % 105 | % 2. Java exception is thrown when first trying to update the setting 106 | % Editor.VariableHighlighting.Color. This only happens the first 107 | % time SCHEMER_IMPORT is run, so the current fix is to catch the error 108 | % and then try again. However, it might be possible for other Java 109 | % exceptions get thrown under other mysterious circumstances, which could 110 | % cause the function to fail. 111 | 112 | function varargout = schemer_import(fname, inc_bools) 113 | 114 | % ------------------------ Parameters ------------------------------------- 115 | SCHEMER_VERSION = 'v1.4.0'; 116 | 117 | % ------------------------ Input handling --------------------------------- 118 | % ------------------------ Default inputs --------------------------------- 119 | if nargin<2 120 | inc_bools = false; % Default off, so only override extra options if intended 121 | end 122 | if nargin<1 123 | fname = []; % Ask user to select file 124 | end 125 | % Input switching 126 | if nargin>=1 && ~ischar(fname) && ~isempty(fname) 127 | if ~islogical(fname) && ~isnumeric(fname) 128 | error('Invalid input argument 1'); 129 | end 130 | if nargin==1 131 | % First input omitted 132 | inc_bools = fname; 133 | fname = []; 134 | elseif ischar(inc_bools) 135 | % Inputs switched 136 | tmp = fname; 137 | fname = inc_bools; 138 | inc_bools = tmp; 139 | clear tmp; 140 | else 141 | error('Invalid combination of inputs'); 142 | end 143 | end 144 | 145 | % ------------------------ Check for file --------------------------------- 146 | filefilt = ... 147 | {'*.prf' , 'MATLAB preference files (*.prf)' ; ... 148 | '*.prf;*.txt', 'Text and pref files (*.prf, *.txt)'; ... 149 | '*' , 'All Files' }; 150 | 151 | if ~isempty(fname) 152 | if ~exist(fname, 'file') 153 | error('Specified file does not exist'); 154 | end 155 | else 156 | % Dialog asking for input filename 157 | % Need to make this dialogue include .txt by default, at least 158 | [filename, pathname] = uigetfile(filefilt); 159 | % End if user cancels 160 | if isequal(filename, 0); 161 | if nargout>0; varargout{1} = 0; end; 162 | return; 163 | end 164 | fname = fullfile(pathname, filename); 165 | end 166 | 167 | % ------------------------ Catch block ------------------------------------ 168 | % Somewhat inexplicably, a Java exception is thrown the first time we try 169 | % to set 'Editor.VariableHighlighting.Color'. 170 | % But if we try again immediately, it can be set without any problems. 171 | % The issue is very consistent. 172 | % The solution is to try to set this colour along with all the others, 173 | % catch the exception when it occurs, and then attempt to set all the 174 | % preferences again. 175 | try 176 | [varargout{1:nargout}] = main(fname, inc_bools); 177 | catch ME 178 | if ~strcmp(ME.identifier, 'MATLAB:Java:GenericException'); 179 | rethrow(ME); 180 | end 181 | % disp('Threw and ignored a Java exception. Retrying.'); 182 | [varargout{1:nargout}] = main(fname, inc_bools); 183 | end 184 | 185 | end 186 | 187 | % ======================== Main code ====================================== 188 | function varargout = main(fname, inc_bools) 189 | 190 | % ------------------------ Parameters ------------------------------------- 191 | % Names of boolean preferences which should always be imported 192 | names_boolean = { ... 193 | 'ColorsUseSystem' ... % Color: Desktop: Use system colors 194 | }; 195 | % Names of boolean preferences which the user can choose whether to import 196 | names_boolextra = { ... 197 | 'ColorsUseMLintAutoFixBackground' ... % Color>PT: Analyser: autofix highlight 198 | 'Editor.VariableHighlighting.Automatic' ... % Color>PT: Var&fn: auto highlight 199 | 'Editor.NonlocalVariableHighlighting' ... % Color>PT: Var&fn: with shared scope 200 | 'EditorCodepadHighVisible' ... % Color>PT: CellDisp: highlight cells 201 | 'EditorCodeBlockDividers' ... % Color>PT: CellDisp: show lines between cells 202 | 'Editorhighlight-caret-row-boolean' ... % Editor>Display: Highlight current line 203 | 'EditorRightTextLineVisible' ... % Editor>Display: Show Right-hand text limit 204 | }; 205 | % Names of preferences for which the values are integers 206 | names_integer = { ... 207 | 'EditorRightTextLimitLineWidth' ... % Editor>Display: Right-hand text limit Width 208 | }; 209 | % Names of preferences for which the values are strings 210 | % column 1: name of preference 211 | % column 2: a regex which the string must match if it is to be exported 212 | % use '.' or '.+' to allow any non-empty string to be output 213 | % use '' or '.*' for anything, including empty strings 214 | % use '\S' for anything except empty or whitespace-only strings 215 | % use '^str1|str2|str3$' to allow only a finite set of strings 216 | names_string = { ... 217 | 'Editor.Language.Java.method' , ... % Java: Show methods 218 | '^(none|bold|italic)$' ; ... 219 | }; 220 | % Names of colour preferences, and their default value if not present in 221 | % the .prf file 222 | % column 1: name of preference 223 | % column 2: default value. 224 | % - Empty if no default, 225 | % - Integer if specific colour, 226 | % - String if inherited from another colour setting (which 227 | % should appear higher up in the list) 228 | % - Cell array of strings to take the average colour from 229 | % column 3: whether a restart is required if this value changes 230 | names_color = { ... 231 | 'ColorsText' , ... % Color: Desktop: main text colour 232 | '' , ... 233 | false ; ... 234 | 'ColorsBackground' , ... % Color: Desktop: main background 235 | '' , ... 236 | true ; ... 237 | 'Colors_M_Errors' , ... % Color: Syntax: errors 238 | -65536 , ... 239 | true ; ... 240 | 'Colors_M_Warnings' , ... % Color>PT: Analyser: warnings 241 | -27648 , ... 242 | true ; ... 243 | 'Colors_M_Keywords' , ... % Color: Syntax: keywords 244 | 'ColorsText' , ... 245 | false ; ... 246 | 'Colors_M_Comments' , ... % Color: Syntax: comments 247 | {'ColorsText','ColorsBackground'} , ... 248 | false ; ... 249 | 'Colors_M_Strings' , ... % Color: Syntax: strings 250 | 'ColorsText' , ... 251 | false ; ... 252 | 'Colors_M_UnterminatedStrings' , ... % Color: Syntax: unterminated strings 253 | 'Colors_M_Errors' , ... 254 | false ; ... 255 | 'Colors_M_SystemCommands' , ... % Color: Syntax: system commands 256 | 'Colors_M_Keywords' , ... 257 | false ; ... 258 | 'Colors_HTML_HTMLLinks' , ... % Color: Other: hyperlinks 259 | 'ColorsText' , ... 260 | false ; ... 261 | 'Color_CmdWinWarnings' , ... % Color: Other: Warning messages 262 | 'Colors_M_Warnings' , ... 263 | false ; ... 264 | 'Color_CmdWinErrors' , ... % Color: Other: Error messages 265 | 'Colors_M_Errors' , ... 266 | false ; ... 267 | 'ColorsMLintAutoFixBackground' , ... % Color>PT: Analyser: autofix 268 | 'ColorsBackground' , ... 269 | false ; ... 270 | 'Editor.VariableHighlighting.Color' , ... % Color>PT: Var&fn: highlight 271 | 'ColorsBackground' , ... 272 | true ; ... 273 | 'Editor.NonlocalVariableHighlighting.TextColor' , ... % Color>PT: Var&fn: with shared scope 274 | 'ColorsText' , ... 275 | false ; ... 276 | 'Editorhighlight-lines' , ... % Color>PT: CellDisp: highlight 277 | 'ColorsBackground' , ... 278 | false ; ... 279 | 'Editorhighlight-caret-row-boolean-color' , ... % Editor>Display: Highlight current line Color 280 | 'Editorhighlight-lines' , ... 281 | false ; ... 282 | 'EditorRightTextLimitLineColor' , ... % Editor>Display: Right-hand text limit line Color 283 | -5723992 , ... 284 | false ; ... 285 | 286 | 'Editor.Language.MuPAD.Color.keyword' , ... % MuPAD: Keywords 287 | 'Colors_M_Keywords' , ... 288 | false ; ... 289 | 'Editor.Language.MuPAD.Color.operator' , ... % MuPAD: Operators 290 | 'Colors_M_SystemCommands' , ... 291 | false ; ... 292 | 'Editor.Language.MuPAD.Color.block-comment' , ... % MuPAD: Comments 293 | 'Colors_M_Comments' , ... 294 | false ; ... 295 | 'Editor.Language.MuPAD.Color.option' , ... % MuPAD: Options 296 | 'Colors_M_UnterminatedStrings' , ... 297 | false ; ... 298 | 'Editor.Language.MuPAD.Color.string' , ... % MuPAD: Strings 299 | 'Colors_M_Strings' , ... 300 | false ; ... 301 | 'Editor.Language.MuPAD.Color.function' , ... % MuPAD: System Functions 302 | {'Colors_M_Keywords','ColorsBackground'} , ... 303 | false ; ... 304 | 'Editor.Language.MuPAD.Color.constant' , ... % MuPAD: Constants 305 | 'Editor.NonlocalVariableHighlighting.TextColor' , ... 306 | false ; ... 307 | 308 | 'Editor.Language.TLC.Color.Colors_M_SystemCommands' , ... % TLC: Commands 309 | 'Colors_M_Keywords' , ... 310 | false ; ... 311 | 'Editor.Language.TLC.Color.Colors_M_Keywords' , ... % TLC: Macros 312 | 'Colors_M_SystemCommands' , ... 313 | false ; ... 314 | 'Editor.Language.TLC.Color.Colors_M_Comments' , ... % TLC: Comments 315 | 'Colors_M_Comments' , ... 316 | false ; ... 317 | 'Editor.Language.TLC.Color.string-literal' , ... % TLC: C Strings 318 | 'Colors_M_Strings' , ... 319 | false ; ... 320 | 321 | 'Editor.Language.C.Color.keywords' , ... % C/C++: Keywords 322 | 'Colors_M_Keywords' , ... 323 | false ; ... 324 | 'Editor.Language.C.Color.line-comment' , ... % C/C++: Comments 325 | 'Colors_M_Comments' , ... 326 | false ; ... 327 | 'Editor.Language.C.Color.string-literal' , ... % C/C++: Strings 328 | 'Colors_M_Strings' , ... 329 | false ; ... 330 | 'Editor.Language.C.Color.preprocessor' , ... % C/C++: Preprocessor 331 | 'Colors_M_SystemCommands' , ... 332 | false ; ... 333 | 'Editor.Language.C.Color.char-literal' , ... % C/C++: Characters 334 | 'Colors_M_UnterminatedStrings' , ... 335 | false ; ... 336 | 'Editor.Language.C.Color.errors' , ... % C/C++: Bad characters 337 | 'Colors_M_Errors' , ... 338 | false ; ... 339 | 340 | 'Editor.Language.Java.Color.keywords' , ... % Java: Keywords 341 | 'Colors_M_Keywords' , ... 342 | false ; ... 343 | 'Editor.Language.Java.Color.line-comment' , ... % Java: Comments 344 | 'Colors_M_Comments' , ... 345 | false ; ... 346 | 'Editor.Language.Java.Color.string-literal' , ... % Java: Strings 347 | 'Colors_M_Strings' , ... 348 | false ; ... 349 | 'Editor.Language.Java.Color.char-literal' , ... % Java: Characters 350 | 'Colors_M_UnterminatedStrings' , ... 351 | false ; ... 352 | 353 | 'Editor.Language.VHDL.Color.Colors_M_Keywords' , ... % VHDL: Keywords 354 | 'Colors_M_Keywords' , ... 355 | false ; ... 356 | 'Editor.Language.VHDL.Color.operator' , ... % VHDL: Operators 357 | 'Colors_M_SystemCommands' , ... 358 | false ; ... 359 | 'Editor.Language.VHDL.Color.Colors_M_Comments' , ... % VHDL: Comments 360 | 'Colors_M_Comments' , ... 361 | false ; ... 362 | 'Editor.Language.VHDL.Color.string-literal' , ... % VHDL: Strings 363 | 'Colors_M_Strings' , ... 364 | false ; ... 365 | 366 | 'Editor.Language.Verilog.Color.Colors_M_Keywords' , ... % Verilog: Keywords 367 | 'Colors_M_Keywords' , ... 368 | false ; ... 369 | 'Editor.Language.Verilog.Color.operator' , ... % Verilog: Operators 370 | 'Colors_M_SystemCommands' , ... 371 | false ; ... 372 | 'Editor.Language.Verilog.Color.Colors_M_Comments' , ... % Verilog: Comments 373 | 'Colors_M_Comments' , ... 374 | false ; ... 375 | 'Editor.Language.Verilog.Color.string-literal' , ... % Verilog: Strings 376 | 'Colors_M_Strings' , ... 377 | false ; ... 378 | 379 | 'Editor.Language.XML.Color.error' , ... % XML: Error 380 | 'Colors_M_Errors' , ... 381 | false ; ... 382 | 'Editor.Language.XML.Color.tag' , ... % XML: Tag 383 | 'Colors_M_Keywords' , ... 384 | false ; ... 385 | 'Editor.Language.XML.Color.attribute' , ... % XML: Attribute name 386 | 'Colors_M_UnterminatedStrings' , ... 387 | false ; ... 388 | 'Editor.Language.XML.Color.operator' , ... % XML: Operator 389 | 'Colors_M_SystemCommands' , ... 390 | false ; ... 391 | 'Editor.Language.XML.Color.value' , ... % XML: Attribute value 392 | 'Colors_M_Strings' , ... 393 | false ; ... 394 | 'Editor.Language.XML.Color.comment' , ... % XML: Comment 395 | 'Colors_M_Comments' , ... 396 | false ; ... 397 | 'Editor.Language.XML.Color.doctype' , ... % XML: DOCTYPE declaration 398 | 'Colors_HTML_HTMLLinks' , ... 399 | false ; ... 400 | 'Editor.Language.XML.Color.ref' , ... % XML: Character 401 | 'Colors_M_UnterminatedStrings' , ... 402 | false ; ... 403 | 'Editor.Language.XML.Color.pi-content' , ... % XML: Processing instruction 404 | 'Colors_HTML_HTMLLinks' , ... 405 | false ; ... 406 | 'Editor.Language.XML.Color.cdata-section' , ... % XML: CDATA section 407 | 'Editor.NonlocalVariableHighlighting.TextColor' , ... 408 | false ; ... 409 | 410 | 'Editor.Language.VRML.Color.keyword' , ... % VRML: Keywords 411 | 'Editor.Language.XML.Color.doctype' , ... 412 | false ; ... 413 | 'Editor.Language.VRML.Color.node-keyword' , ... % VRML: Node types 414 | 'Editor.Language.XML.Color.tag' , ... 415 | false ; ... 416 | 'Editor.Language.VRML.Color.field-keyword' , ... % VRML: Fields 417 | 'Editor.Language.XML.Color.attribute' , ... 418 | false ; ... 419 | 'Editor.Language.VRML.Color.data-type-keyword' , ... % VRML: Data types 420 | 'Editor.Language.XML.Color.cdata-section' , ... 421 | false ; ... 422 | 'Editor.Language.VRML.Color.terminal-symbol' , ... % VRML: Terminal symbols 423 | 'Editor.Language.XML.Color.operator' , ... 424 | false ; ... 425 | 'Editor.Language.VRML.Color.comment' , ... % VRML: Comments 426 | 'Editor.Language.XML.Color.comment' , ... 427 | false ; ... 428 | 'Editor.Language.VRML.Color.string' , ... % VRML: Strings 429 | 'Editor.Language.XML.Color.value' , ... 430 | false ; ... 431 | 432 | 'Editor.Language.VRMLX3DV.Color.keyword' , ... % VRML/X3DV: Keywords 433 | 'Editor.Language.VRML.Color.keyword' , ... 434 | false ; ... 435 | 'Editor.Language.VRMLX3DV.Color.node-keyword' , ... % VRML/X3DV: Node types 436 | 'Editor.Language.VRML.Color.node-keyword' , ... 437 | false ; ... 438 | 'Editor.Language.VRMLX3DV.Color.field-keyword' , ... % VRML/X3DV: Fields 439 | 'Editor.Language.VRML.Color.field-keyword' , ... 440 | false ; ... 441 | 'Editor.Language.VRMLX3DV.Color.data-type-keyword' , ... % VRML/X3DV: Data types 442 | 'Editor.Language.VRML.Color.data-type-keyword' , ... 443 | false ; ... 444 | 'Editor.Language.VRMLX3DV.Color.terminal-symbol' , ... % VRML/X3DV: Terminal symbols 445 | 'Editor.Language.VRML.Color.terminal-symbol' , ... 446 | false ; ... 447 | 'Editor.Language.VRMLX3DV.Color.comment' , ... % VRML/X3DV: Comments 448 | 'Editor.Language.VRML.Color.comment' , ... 449 | false ; ... 450 | 'Editor.Language.VRMLX3DV.Color.string' , ... % VRML/X3DV: Strings 451 | 'Editor.Language.VRML.Color.string' , ... 452 | false ; ... 453 | }; 454 | 455 | verbose = 0; 456 | 457 | % ------------------------ Setup ------------------------------------------ 458 | if nargout==0 459 | varargout = {}; 460 | else 461 | varargout = {-2}; 462 | end 463 | if inc_bools 464 | names_boolean = [names_boolean names_boolextra]; 465 | end 466 | needs_restart = false; 467 | 468 | % ------------------------ Check file seems okay -------------------------- 469 | % Read in the contents of the entire file 470 | flestr = fileread(fname); 471 | % Search for occurances of main text colour 472 | txtprf = regexp(flestr, '\sColorsText=(?[^#\s]+)\s', 'names'); 473 | if isempty(txtprf) 474 | error('Text colour not present in colorscheme file:\n%s', fname); 475 | elseif length(txtprf) > 1 476 | error('Text colour defined multiple times in colorscheme file:\n%s', fname); 477 | end 478 | % Search for occurances of main background colour 479 | bkgprf = regexp(flestr, '\sColorsBackground=(?[^#\s]+)\s', 'names'); 480 | if isempty(bkgprf) 481 | error('Background colour not present in colorscheme file:\n%s', fname); 482 | elseif length(bkgprf) > 1 483 | error('Background colour defined multiple times in colorscheme file:\n%s', fname); 484 | end 485 | % Make sure the main text and background colours are not exactly the same 486 | if strcmp(txtprf.pref, bkgprf.pref) 487 | error('Main text and background colours are the same in this file:\n%s', fname); 488 | end 489 | 490 | % ------------------------ File stuff ------------------------------------- 491 | % Open for read access only 492 | fid = fopen(fname, 'r', 'n'); 493 | if isequal(fid, -1); 494 | if nargout>0; varargout{1} = -1; end; 495 | return; 496 | end 497 | % Add a cleanup object incase of failure 498 | finishup = onCleanup(@() fclose(fid)); 499 | 500 | % ------------------------ Read and Write --------------------------------- 501 | % Initialise tracker for unset colours 502 | isColorSet = false(size(names_color, 1), 1); 503 | % Loop over prf file 504 | while ~feof(fid) 505 | % Get one line of preferences/theme file 506 | l = fgetl(fid); 507 | 508 | % Ignore empty lines and lines which begin with # 509 | if length(l)<1 || strcmp('#', l(1)) 510 | if verbose; disp('Comment'); end; 511 | continue; 512 | end 513 | 514 | % Look for name pref pair, seperated by '=' 515 | % Must be at begining of string (hence ^ anchor) 516 | % Cannot contain comment marker (#) 517 | n = regexp(l, '^(?[^=#]+)=(?[^#]+)', 'names'); 518 | 519 | % If no match, continue and scan next line 520 | if isempty(n) 521 | if verbose; disp('No match'); end; 522 | continue; 523 | end 524 | 525 | % Trim whitespace from pref 526 | n.pref = strtrim(n.pref); 527 | 528 | if ismember(n.name, names_boolean) 529 | % Deal with boolean type 530 | switch lower(n.pref) 531 | case 'btrue' 532 | % Preference is true 533 | com.mathworks.services.Prefs.setBooleanPref(n.name, 1); 534 | if verbose; fprintf('Set bool true %s\n', n.name); end 535 | case 'bfalse' 536 | % Preference is false 537 | com.mathworks.services.Prefs.setBooleanPref(n.name, 0); 538 | if verbose; fprintf('Set bool false %s\n', n.name); end 539 | otherwise 540 | % Shouldn't be anything else 541 | warning('Bad boolean for %s: %s', n.name, n.pref); 542 | end 543 | 544 | elseif ismember(n.name, names_integer) 545 | % Deal with integer type 546 | if ~strcmpi('I', n.pref(1)) 547 | warning('Bad integer pref for %s: %s', n.name, n.pref); 548 | continue; 549 | end 550 | int = str2double(n.pref(2:end)); 551 | com.mathworks.services.Prefs.setIntegerPref(n.name, int); 552 | if verbose; fprintf('Set integer %d for %s\n', int, n.name); end 553 | 554 | elseif ismember(n.name,names_string(:, 1)) 555 | % Deal with string type 556 | if ~strcmpi('S', n.pref(1)) 557 | warning('Bad string pref for %s: %s', n.name, n.pref); 558 | continue; 559 | end 560 | str = n.pref(2:end); 561 | % Look up which of the preference settings this is 562 | [~, idx] = ismember(n.name, names_string(:, 1)); 563 | % Check that the setting allowed by the regex it must satisfy 564 | if isempty(regexp(str, names_string{idx, 2}, ... 565 | 'start', 'emptymatch')) 566 | % If not, we can't set the value to be this 567 | warning('Invalid string for %s: %s', n.name, str); 568 | continue; 569 | end 570 | com.mathworks.services.Prefs.setStringPref(n.name, str); 571 | if verbose; fprintf('Set string %s for %s\n', str, n.name); end 572 | 573 | elseif ismember(n.name, names_color(:, 1)) 574 | % Deal with colour type (final type to consider) 575 | if ~strcmpi('C', n.pref(1)) 576 | warning('Bad color for %s: %s', n.name, n.pref); 577 | continue; 578 | end 579 | [~, idx] = ismember(n.name, names_color(:, 1)); 580 | % Get the current setting for this parameter 581 | previousVal = ... 582 | com.mathworks.services.Prefs.getColorPref(names_color{idx, 1}); 583 | % Set the colour to the target value 584 | rgb = str2double(n.pref(2:end)); 585 | jc = java.awt.Color(rgb); 586 | com.mathworks.services.Prefs.setColorPref(n.name, jc); 587 | com.mathworks.services.ColorPrefs.notifyColorListeners(n.name); 588 | if verbose 589 | fprintf('Set color (%3.f, %3.f, %3.f) for %s\n', ... 590 | jc.getRed, jc.getGreen, jc.getBlue, n.name); 591 | end 592 | % Note that we have allocated this colour 593 | isColorSet(idx) = true; 594 | % Check if the colour has changed 595 | if names_color{idx, 3} && ~isequal(previousVal, jc) 596 | needs_restart = true; 597 | end 598 | 599 | else 600 | % Silently ignore irrelevant preferences 601 | % (This means you can load a whole matlab.prf file and anything not 602 | % listed above as relevant to the color scheme will be ignored.) 603 | 604 | end 605 | 606 | end 607 | 608 | % Check that at least one colour was actually set 609 | if ~any(isColorSet) 610 | error('Did not find any colour settings in file\n%s', fname); 611 | if nargout>0; varargout{1} = -2; end; 612 | return; 613 | end 614 | 615 | % For colours which have not been set by the color scheme, we set them from 616 | % a backup 617 | % Get a row vector of indices of all unset colours 618 | unsetColorIndices = find(~isColorSet)'; 619 | % Loop over unset colours 620 | for idx=unsetColorIndices 621 | % Get the backup setting for this colour parameter 622 | backupVal = names_color{idx, 2}; 623 | % Get the current setting for this parameter 624 | previousVal = ... 625 | com.mathworks.services.Prefs.getColorPref(names_color{idx, 1}); 626 | 627 | clear jc; % Clear variable 628 | 629 | % Switch based on the type of backup 630 | if isempty(backupVal) 631 | % No backup is set 632 | continue; 633 | 634 | elseif iscell(backupVal) 635 | % Backup is one of several methods of which involve refactoring one 636 | % or more other colours 637 | % Get an RGB value for the colour through whichever method 638 | if all(cellfun(@ischar, backupVal)) 639 | % Backup is a list of other names to sample and average 640 | % Initialise a holding matrix 641 | RGB = nan(numel(backupVal), 3); 642 | for i=1:numel(backupVal) 643 | % Load each of the other colours 644 | jc = com.mathworks.services.Prefs.getColorPref(backupVal{i}); 645 | % Put the R, G, B values into the holding matrix 646 | RGB(i, 1) = jc.getRed; 647 | RGB(i, 2) = jc.getGreen; 648 | RGB(i, 3) = jc.getBlue; 649 | end 650 | % Take the average of each RGB value from the other colours 651 | RGB = mean(RGB); 652 | 653 | elseif length(backupVal)==2 654 | % Backup is a name of a colour and a scale factor to apply 655 | jc = com.mathworks.services.Prefs.getColorPref(backupVal{1}); 656 | % Get the R, G, B values 657 | RGB = [jc.getRed, jc.getGreen, jc.getBlue]; 658 | % Rescale them 659 | RGB = RGB * backupVal{2}; 660 | 661 | else 662 | error('Bad backup cell for %s', names_color{idx, 1}); 663 | 664 | end 665 | % Turn the RGB value into a Java color object 666 | % Ensure RGB is integer and does not exceed 255 667 | RGB = min(255, round(RGB)); 668 | % Convert to a float 669 | RGB = RGB/255; 670 | % Make a Java color object for this colour 671 | jc = java.awt.Color(RGB(1), RGB(2), RGB(3)); 672 | 673 | elseif ischar(backupVal) 674 | % The backup colour is a reference to another colour 675 | % Look up the colour from the backup reference 676 | jc = com.mathworks.services.Prefs.getColorPref(backupVal); 677 | 678 | elseif isnumeric(backupVal) && numel(backupVal)==1 679 | % The backup colour is a specific colour 680 | % Make a java color object for this specific colour 681 | jc = java.awt.Color(backupVal); 682 | 683 | else 684 | error('Bad backup value for %s', names_color{idx, 1}); 685 | 686 | end 687 | % Assign the neglected colour to be this Java colour object from the 688 | % backup 689 | com.mathworks.services.Prefs.setColorPref(names_color{idx, 1}, jc); 690 | com.mathworks.services.ColorPrefs.notifyColorListeners(names_color{idx, 1}); 691 | 692 | % Check if the colour has changed 693 | if names_color{idx, 3} && ~isequal(previousVal, jc) 694 | needs_restart = true; 695 | end 696 | 697 | end 698 | 699 | % ------------------------ Tidy up ---------------------------------------- 700 | % fclose(fid); % Don't need to close as it will autoclose 701 | if nargout>0; varargout{1} = 1; end; 702 | 703 | if inc_bools 704 | fprintf('Imported color scheme WITH boolean options from\n%s\n', fname); 705 | else 706 | fprintf('Imported color scheme WITHOUT boolean options from\n%s\n', fname); 707 | end 708 | if needs_restart 709 | disp('Some changes require MATLAB to be restarted to be activated.'); 710 | end 711 | 712 | end 713 | -------------------------------------------------------------------------------- /schemes/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # 5 | # The above will handle all files NOT found below 6 | # 7 | 8 | ##--------------------------------------------------- 9 | # Common .gitattributes 10 | ##--------------------------------------------------- 11 | 12 | # Documents 13 | # ============ 14 | *.txt text 15 | *.md text 16 | 17 | # Graphics 18 | # ============ 19 | *.png binary 20 | *.jpg binary 21 | *.jpeg binary 22 | *.gif binary 23 | *.tif binary 24 | *.tiff binary 25 | *.ico binary 26 | *.svg text 27 | *.eps binary 28 | 29 | 30 | ##--------------------------------------------------- 31 | # Basic .gitattributes for a MATLAB repo 32 | ##--------------------------------------------------- 33 | 34 | # Source files 35 | # ============ 36 | *.m text 37 | *.prf text 38 | 39 | # Binary files 40 | # ============ 41 | *.p binary 42 | *.mex* binary 43 | *.fig binary 44 | *.mat binary 45 | *.mdl binary 46 | *.slx binary 47 | -------------------------------------------------------------------------------- /schemes/.gitignore: -------------------------------------------------------------------------------- 1 | # Editor autosave files 2 | *~ 3 | *.asv 4 | # Compiled MEX binaries (all platforms) 5 | *.mex* 6 | -------------------------------------------------------------------------------- /schemes/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | Contributing a colour scheme 2 | ============================ 3 | 4 | Glad to hear you've made a colour scheme to use with [MATLAB Schemer]! 5 | Thanks for sharing this with us. 6 | 7 | Please only add one colour scheme per pull request. 8 | If you have multiple colorschemes to add, make a pull request for each of them. 9 | 10 | The Schemer README includes some 11 | [advice on creating a colour scheme][scheme creation advice], which you might 12 | find useful. 13 | 14 | It is preferable to include a screenshot demonstrating an example of your new MATLAB theme. 15 | To make your screenshot: 16 | 17 | - Load your color scheme `schemer_import('yourscheme.prf', 1)` 18 | - Exit MATLAB `exit();` 19 | - Reopen MATLAB 20 | - Open the [matlab-schemer/develop/sample.m] file and take a screenshot with your favourite screenshot program. 21 | - If not done at capture time, crop the screenshot down to the right size with your [favourite image editor]. 22 | - Make sure the screenshot is saved in [matlab-schemes/screenshots] as `yourscheme.png`. 23 | 24 | If you are on Linux, you can follow the method below to create your screenshot, 25 | which is mostly automated and produces the same output every time. 26 | 27 | 28 | Reproducible screenshot workflow for Linux 29 | ------------------------------------------ 30 | 31 | Here is minimal-interaction workflow for Linux users, which will create the 32 | same screenshots every time. 33 | This has been tested on Ubuntu 15.10 with MATLAB 2016a, but should work on 34 | any *nix OS and any MATLAB version since R2012b (which introduced the 35 | toolstrip UI). 36 | 37 | The code blocks must be run from the system shell, not at the MATLAB command 38 | prompt. 39 | 40 | 1. **Setup** 41 | 42 | Define these variables appropriately. 43 | 44 | ```bash 45 | # Set this variable appropriately, without extension 46 | SCHEME_NAME='yourschemename' 47 | # Set the path to your copy of MATLAB Schemer 48 | PATH_TO_SCHEMER='../matlab-schemer/' 49 | ``` 50 | 51 | 2. **Load scheme** 52 | 53 | Run this code block to load the scheme, restart MATLAB, and edit 54 | `sample.m`. 55 | 56 | ```bash 57 | # Remove extension, if present 58 | SCHEME_NAME=${SCHEME_NAME%.prf} 59 | echo "Making screenshot for scheme $SCHEME_NAME"; 60 | # Load the template and restart matlab 61 | matlab -r "addpath(genpath('$PATH_TO_SCHEMER')); schemer_import('$SCHEME_NAME.prf',1); exit;"; 62 | # Edit the sample.m file 63 | matlab -r "edit(fullfile('$PATH_TO_SCHEMER','develop','sample.m'))" & 64 | # What next 65 | echo "Now undock sample.m, and highlight middle scaleFactor"; 66 | ``` 67 | 68 | 3. **Undock sample.m editor** 69 | 70 | Either 71 | - in MATLAB GUI, undock `sample.m` only 72 | 73 | Or 74 | - in MATLAB GUI, undock the Editor panel 75 | - move tabs to bottom, if more than one file is being editted 76 | 77 | Also, make sure the MATLAB toolstrip is visible on the undocked panel. 78 | If it is minimised, right-click on the toolstrip and restore it. 79 | 80 | 4. **Highlight** 81 | 82 | Highlight the middle instance of `scaleFactor` (on line 18). 83 | 84 | 5. **Resize window and take screenshot** 85 | 86 | Run this code block to resize the editor window and take a screenshot, 87 | cropped with ImageMagick. 88 | 89 | The crop location is correct for MATLAB 2016a. 90 | 91 | ```bash 92 | # Check for a window for the develop/sample.m file 93 | if wmctrl -l | grep -q develop/sample.m 94 | then 95 | WINDOW_NAME='develop/sample.m'; 96 | else 97 | # If it's not there, use the Editor window 98 | WINDOW_NAME='Editor'; 99 | fi 100 | if wmctrl -l | grep -qv "$WINDOW_NAME" 101 | then 102 | echo "Window $WINDOW_NAME is absent"; 103 | else 104 | # Resize the window 105 | wmctrl -r "$WINDOW_NAME" -e 0,100,100,700,650; 106 | # Try getting screenshot with Imagemagick, and cropping it down to the 107 | # just the relevant section 108 | wmctrl -a "$WINDOW_NAME"; sleep 0.1; import -window root -crop 700x379+100+249 +repage "${SCHEME_NAME}.png"; 109 | # Inspect the result 110 | xdg-open "${SCHEME_NAME}.png"; 111 | # Is it cropped correctly? 112 | echo "How does it look? If no good, try one of the other options to manually crop"; 113 | fi 114 | ``` 115 | 116 | 6. If screenshot cropped incorrectly, **manually crop screenshot** 117 | 118 | If the ImageMagick crop is not aligned correctly, 119 | - Either use gnome-screenshot for the whole window, and then crop in GIMP 120 | ```bash 121 | wmctrl -a "$WINDOW_NAME" \ 122 | && gnome-screenshot -w -f "$SCHEME_NAME.png" \ 123 | && gimp "$SCHEME_NAME.png"; 124 | ``` 125 | 126 | - Or use gnome-screenshot to select the area to use (which is likely to 127 | be less precise). 128 | ```bash 129 | wmctrl -a "$WINDOW_NAME" && gnome-screenshot -a -f "$SCHEME_NAME.png"; 130 | ``` 131 | 132 | 7. When you are happy, **move** the final copy into the screenshots folder 133 | 134 | ```bash 135 | mv "$SCHEME_NAME.png" screenshots/"$SCHEME_NAME.png"; 136 | ``` 137 | 138 | 139 | Incorporating into MATLAB Schemer 140 | --------------------------------- 141 | 142 | Once you've added the new scheme to this repository, it will be merged into 143 | [MATLAB Schemer] using [git-subtree]. 144 | If you are merging it into Schemer yourself, please consult this 145 | [step-by-step guide](https://github.com/scottclowe/matlab-schemer/blob/master/CONTRIBUTING.md#adding-a-new-colour-scheme). 146 | 147 | 148 | [MATLAB Schemer]: https://github.com/scottclowe/matlab-schemer 149 | [matlab-schemes/screenshots]: https://github.com/scottclowe/matlab-schemes/tree/master/screenshots 150 | [matlab-schemer/develop/sample.m]: https://github.com/scottclowe/matlab-schemer/blob/master/develop/sample.m 151 | [scheme creation advice]: https://github.com/scottclowe/matlab-schemer#creating-a-color-scheme-for-others-to-use 152 | [git-subtree]: https://github.com/git/git/blob/master/contrib/subtree/git-subtree.txt 153 | [favourite image editor]: https://www.gimp.org 154 | -------------------------------------------------------------------------------- /schemes/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2015, Scott Lowe 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | * Redistributions in binary form must reproduce the above copyright 10 | notice, this list of conditions and the following disclaimer in 11 | the documentation and/or other materials provided with the distribution 12 | 13 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 14 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 15 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 16 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 17 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 18 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 19 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 20 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 21 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 22 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 23 | POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /schemes/README.md: -------------------------------------------------------------------------------- 1 | MATLAB Schemes 2 | ============== 3 | 4 | A collection of color schemes for MATLAB. 5 | 6 | These color schemes can be enabled using the [MATLAB Schemer package]. 7 | 8 | 9 | Samples 10 | ------- 11 | 12 | ### Cobalt 13 | Based on the [GTK stylesheet], "Cobalt", by Will Farrington. 14 | 15 | ![Cobalt sample](screenshots/cobalt.png) 16 | 17 | ### Darkmate 18 | Based on the [GTK stylesheet], "Darkmate", 19 | by [Luigi Maselli](https://grigio.org/). 20 | 21 | ![Darkmate sample](screenshots/darkmate.png) 22 | 23 | ### Dark Steel 24 | By [@scottclowe](https://github.com/scottclowe), inspired by the Darkmate and 25 | Cobalt themes. 26 | 27 | ![Dark Steel sample](screenshots/darksteel.png) 28 | 29 | ### Matrix 30 | By [@scottclowe](https://github.com/scottclowe), using only colors present in 31 | the terminals shown in the movie, 32 | [*The Matrix*](http://www.imdb.com/title/tt0133093/). 33 | 34 | ![Matrix sample](screenshots/matrix.png) 35 | 36 | ### Monokai 37 | By [@dkearn](https://github.com/dkearn). Based on Sublime Text's Monokai theme. Change the font to Consolas to complete the look. 38 | 39 | ![Monokai sample](screenshots/monokai.png) 40 | 41 | ### Oblivion 42 | Based on the [Gedit theme, "Oblivion"](https://github.com/mig/gedit-themes/blob/master/oblivion.xml), 43 | by Paolo Borelli and GtkSourceView. 44 | 45 | ![Oblivion sample](screenshots/oblivion.png) 46 | 47 | ### Solarised Dark 48 | Based on the [Solarized][Solarized] (1.0.0beta2) palette, in dark mode, 49 | by [Ethan Schoonover]. 50 | 51 | ![Solarized Dark sample](screenshots/solarized-dark.png) 52 | 53 | ### Solarised Light 54 | Based on the [Solarized][Solarized] (1.0.0beta2) palette, in light mode, 55 | by [Ethan Schoonover]. 56 | 57 | ![Solarized Light sample](screenshots/solarized-light.png) 58 | 59 | ### Tango 60 | Based on the colour palette for the [Tango Desktop Project]. 61 | 62 | ![Tango sample](screenshots/tango.png) 63 | 64 | ### Vibrant 65 | Based on the [GTK stylesheet], "Vibrant", by Lateef Alabi-Oki. 66 | 67 | ![Vibrant sample](screenshots/vibrant.png) 68 | 69 | 70 | Default 71 | ------- 72 | 73 | And of course, you can always return to the original MATLAB color scheme 74 | provided by [MathWorks](https://www.mathworks.com/) using the `default.prf` 75 | color preferences file. 76 | 77 | ![Default](screenshots/default.png) 78 | 79 | 80 | [MATLAB Schemer package]: https://github.com/scottclowe/matlab-schemer 81 | [GTK stylesheet]: https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes 82 | [Solarized]: http://ethanschoonover.com/solarized 83 | [Ethan Schoonover]: http://ethanschoonover.com/ 84 | [Tango Desktop Project]: http://tango-project.org/ 85 | -------------------------------------------------------------------------------- /schemes/cobalt.prf: -------------------------------------------------------------------------------- 1 | # Cobalt - MATLAB color scheme 2 | # Created by Scott Lowe, 2015-07-05 3 | # Based on the GTK stylesheet "Cobalt", by Will Farrington. 4 | # https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes 5 | # To enable this color scheme in MATLAB use schemer_import, available at: 6 | # https://github.com/scottclowe/matlab-schemer 7 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 8 | ColorsUseSystem=Bfalse 9 | ColorsUseMLintAutoFixBackground=Btrue 10 | Editor.VariableHighlighting.Automatic=Btrue 11 | Editor.NonlocalVariableHighlighting=Btrue 12 | EditorCodepadHighVisible=Btrue 13 | EditorCodeBlockDividers=Btrue 14 | Editorhighlight-caret-row-boolean=Btrue 15 | EditorRightTextLineVisible=Btrue 16 | EditorRightTextLimitLineWidth=I1 17 | ColorsText=C-1 # white 18 | ColorsBackground=C-16770253 # dark_blue 19 | Colors_M_Keywords=C-25344 # bright_orange 20 | Colors_M_Comments=C-16742145 # sky_blue 21 | Colors_M_Strings=C-12920576 # spring_green 22 | Colors_M_UnterminatedStrings=C-4480 # faded_yellow 23 | Colors_M_SystemCommands=C-3355444 # light grey 24 | Colors_M_Errors=C-65468 # nail_polish_pink 25 | Colors_HTML_HTMLLinks=C-16751169 # light_blue 26 | Colors_M_Warnings=C-20396 # 27 | ColorsMLintAutoFixBackground=C-12303292 # 28 | Editor.VariableHighlighting.Color=C-16728180 # eye-drop 29 | Editor.NonlocalVariableHighlighting.TextColor=C-8323141 # teal_blue 30 | Editorhighlight-lines=C-15981252 # eye-drop 31 | Editorhighlight-caret-row-boolean-color=C-16762000 # medium_blue 32 | EditorRightTextLimitLineColor=C-14665909 # eye-drop 33 | # C/C++ 34 | Editor.Language.C.Color.preprocessor=C-8323141 # teal_blue 35 | # Java 36 | Editor.Language.Java.Color.keywords=C-8323141 # teal_blue 37 | # VHDL 38 | Editor.Language.VHDL.Color.operator=C-65468 # nail_polish_pink 39 | # Verilog 40 | Editor.Language.Verilog.Color.operator=C-65468 # nail_polish_pink 41 | # XML/HTML 42 | Editor.Language.XML.Color.tag=C-8323141 # teal_blue 43 | Editor.Language.XML.Color.doctype=C-3355444 # light grey 44 | Editor.Language.XML.Color.pi-content=C-3355444 # light grey 45 | Editor.Language.XML.Color.cdata-section=C-3355444 # light grey 46 | -------------------------------------------------------------------------------- /schemes/darkmate.prf: -------------------------------------------------------------------------------- 1 | # Darkmate - MATLAB color scheme 2 | # Created by Scott Lowe, 2015-07-05 3 | # Based on the GTK stylesheet "Darkmate", by Luigi Maselli. 4 | # https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes 5 | # To enable this color scheme in MATLAB use schemer_import, available at: 6 | # https://github.com/scottclowe/matlab-schemer 7 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 8 | ColorsUseSystem=Bfalse 9 | ColorsUseMLintAutoFixBackground=Btrue 10 | Editor.VariableHighlighting.Automatic=Btrue 11 | Editor.NonlocalVariableHighlighting=Btrue 12 | EditorCodepadHighVisible=Btrue 13 | EditorCodeBlockDividers=Btrue 14 | Editorhighlight-caret-row-boolean=Btrue 15 | EditorRightTextLineVisible=Btrue 16 | EditorRightTextLimitLineWidth=I4 # slightly wider 17 | ColorsText=C-1118482 # white 18 | ColorsBackground=C-14474461 # carbon 19 | Colors_M_Keywords=C-26368 # ambra 20 | Colors_M_Comments=C-10920873 # asfalto 21 | Colors_M_Strings=C-6881536 # lime 22 | Colors_M_UnterminatedStrings=C-202417 # yellow 23 | Colors_M_SystemCommands=C-16725605 # alga 24 | Colors_M_Errors=C-53398 # red 25 | Colors_HTML_HTMLLinks=C-6385153 # violet 26 | Colors_M_Warnings=C-26368 # ambra 27 | ColorsMLintAutoFixBackground=C-11184811 # 28 | Editor.VariableHighlighting.Color=C-4495617 # purple 29 | Editor.NonlocalVariableHighlighting.TextColor=C-16725760 # green 30 | Editorhighlight-lines=C-15132391 # 31 | Editorhighlight-caret-row-boolean-color=C-16777216 # black 32 | EditorRightTextLimitLineColor=C-13948117 # 33 | # XML/HTML 34 | Editor.Language.XML.Color.pi-content=C-6425200 35 | -------------------------------------------------------------------------------- /schemes/darksteel.prf: -------------------------------------------------------------------------------- 1 | # Dark Steel - MATLAB color scheme 2 | # Created by Scott Lowe 3 | # Generated with colortheme_export v1.0.0 4 | # Fri Aug 09 18:39:37 BST 2013 5 | # To enable this color scheme in MATLAB use schemer_import, available at: 6 | # https://github.com/scottclowe/matlab-schemer 7 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 8 | ColorsUseSystem=Bfalse 9 | ColorsUseMLintAutoFixBackground=Btrue 10 | Editor.VariableHighlighting.Automatic=Btrue 11 | Editor.NonlocalVariableHighlighting=Btrue 12 | EditorCodepadHighVisible=Btrue 13 | EditorCodeBlockDividers=Btrue 14 | Editorhighlight-caret-row-boolean=Btrue 15 | EditorRightTextLineVisible=Btrue 16 | EditorRightTextLimitLineWidth=I1 17 | ColorsText=C-1 18 | ColorsBackground=C-15066598 19 | Colors_M_Keywords=C-1208813 20 | Colors_M_Comments=C-14114579 21 | Colors_M_Strings=C-16724992 22 | Colors_M_UnterminatedStrings=C-4210944 23 | Colors_M_SystemCommands=C-7123493 24 | Colors_M_Errors=C-45747 25 | Colors_HTML_HTMLLinks=C-10592257 26 | Colors_M_Warnings=C-27648 27 | ColorsMLintAutoFixBackground=C-9223357 28 | Editor.VariableHighlighting.Color=C-11184786 29 | Editor.NonlocalVariableHighlighting.TextColor=C-16735351 30 | Editorhighlight-lines=C-14408662 31 | Editorhighlight-caret-row-boolean-color=C-12632257 32 | EditorRightTextLimitLineColor=C-5723992 33 | # TLC 34 | Editor.Language.TLC.Color.Colors_M_Keywords=C-16735351 35 | # C/C++ 36 | Editor.Language.C.Color.preprocessor=C-16735351 37 | # VHDL 38 | Editor.Language.VHDL.Color.operator=C-16735351 39 | # Verilog 40 | Editor.Language.Verilog.Color.operator=C-16735351 41 | # XML 42 | Editor.Language.XML.Color.operator=C-1710454 43 | Editor.Language.XML.Color.doctype=C-6578958 44 | Editor.Language.XML.Color.pi-content=C-9868801 45 | -------------------------------------------------------------------------------- /schemes/default.prf: -------------------------------------------------------------------------------- 1 | # Default MATLAB color scheme 2 | # This color scheme file restores the color scheme which ships with MATLAB. 3 | # To enable this color scheme in MATLAB use schemer_import, available at: 4 | # https://github.com/scottclowe/matlab-schemer 5 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 6 | ColorsUseSystem=Btrue 7 | ColorsUseMLintAutoFixBackground=Btrue 8 | Editor.VariableHighlighting.Automatic=Btrue 9 | Editor.NonlocalVariableHighlighting=Btrue 10 | EditorCodepadHighVisible=Btrue 11 | EditorCodeBlockDividers=Btrue 12 | Editorhighlight-caret-row-boolean=Bfalse 13 | EditorRightTextLineVisible=Btrue 14 | EditorRightTextLimitLineWidth=I1 15 | ColorsText=C-16777216 16 | ColorsBackground=C-1 17 | Colors_M_Keywords=C-16776961 18 | Colors_M_Comments=C-14513374 19 | Colors_M_Strings=C-6283024 20 | Colors_M_UnterminatedStrings=C-5111808 21 | Colors_M_SystemCommands=C-5075968 22 | Colors_M_Errors=C-65536 23 | Colors_HTML_HTMLLinks=C-16776961 24 | Color_CmdWinWarnings=C-39936 25 | Color_CmdWinErrors=C-1703936 26 | Colors_M_Warnings=C-27648 27 | ColorsMLintAutoFixBackground=C-1121868 28 | Editor.VariableHighlighting.Color=C-3479320 29 | Editor.NonlocalVariableHighlighting.TextColor=C-16735325 30 | Editorhighlight-lines=C-197412 31 | Editorhighlight-caret-row-boolean-color=C-2167080 32 | EditorRightTextLimitLineColor=C-3355444 33 | # MuPAD 34 | Editor.Language.MuPAD.Color.string=C-6283024 35 | Editor.Language.MuPAD.Color.constant=C-14638864 36 | Editor.Language.MuPAD.Color.keyword=C-16776961 37 | Editor.Language.MuPAD.Color.function=C-8355662 38 | Editor.Language.MuPAD.Color.block-comment=C-14513374 39 | Editor.Language.MuPAD.Color.option=C-5075968 40 | Editor.Language.MuPAD.Color.operator=C-5103616 41 | # TLC 42 | Editor.Language.TLC.Color.Colors_M_SystemCommands=C-16776961 43 | Editor.Language.TLC.Color.Colors_M_Keywords=C-5075968 44 | Editor.Language.TLC.Color.Colors_M_Comments=C-14513374 45 | Editor.Language.TLC.Color.string-literal=C-6283024 46 | # VRML 47 | Editor.Language.VRML.Color.comment=C-14513374 48 | Editor.Language.VRML.Color.node-keyword=C-16022329 49 | Editor.Language.VRML.Color.field-keyword=C-9145228 50 | Editor.Language.VRML.Color.terminal-symbol=C-2196224 51 | Editor.Language.VRML.Color.keyword=C-16776961 52 | Editor.Language.VRML.Color.data-type-keyword=C-6737152 53 | Editor.Language.VRML.Color.string=C-6283024 54 | # VRML/X3DV 55 | Editor.Language.VRMLX3DV.Color.keyword=C-16776961 56 | Editor.Language.VRMLX3DV.Color.node-keyword=C-16022329 57 | Editor.Language.VRMLX3DV.Color.field-keyword=C-9145228 58 | Editor.Language.VRMLX3DV.Color.data-type-keyword=C-6737152 59 | Editor.Language.VRMLX3DV.Color.terminal-symbol=C-2196224 60 | Editor.Language.VRMLX3DV.Color.comment=C-14513374 61 | Editor.Language.VRMLX3DV.Color.string=C-6283024 62 | # C/C++ 63 | Editor.Language.C.Color.keywords=C-16776961 64 | Editor.Language.C.Color.line-comment=C-14513374 65 | Editor.Language.C.Color.string-literal=C-6283024 66 | Editor.Language.C.Color.preprocessor=C-5075968 67 | Editor.Language.C.Color.char-literal=C-48897 68 | Editor.Language.C.Color.errors=C-65536 69 | # Java 70 | Editor.Language.Java.method=Sbold 71 | Editor.Language.Java.Color.keywords=C-16776961 72 | Editor.Language.Java.Color.line-comment=C-14513374 73 | Editor.Language.Java.Color.string-literal=C-6283024 74 | Editor.Language.Java.Color.char-literal=C-48897 75 | # VHDL 76 | Editor.Language.VHDL.Color.Colors_M_Keywords=C-16776961 77 | Editor.Language.VHDL.Color.operator=C-5075968 78 | Editor.Language.VHDL.Color.Colors_M_Comments=C-14513374 79 | Editor.Language.VHDL.Color.string-literal=C-6283024 80 | # Verilog 81 | Editor.Language.Verilog.Color.Colors_M_Comments=C-14513374 82 | Editor.Language.Verilog.Color.operator=C-5075968 83 | Editor.Language.Verilog.Color.Colors_M_Keywords=C-16776961 84 | Editor.Language.Verilog.Color.string-literal=C-6283024 85 | # XML 86 | Editor.Language.XML.Color.error=C-65536 87 | Editor.Language.XML.Color.tag=C-16776961 88 | Editor.Language.XML.Color.attribute=C-5111808 89 | Editor.Language.XML.Color.operator=C-5075968 90 | Editor.Language.XML.Color.value=C-6283024 91 | Editor.Language.XML.Color.comment=C-14513374 92 | Editor.Language.XML.Color.doctype=C-16777092 93 | Editor.Language.XML.Color.ref=C-5111808 94 | Editor.Language.XML.Color.pi-content=C-16777092 95 | Editor.Language.XML.Color.cdata-section=C-8625664 96 | -------------------------------------------------------------------------------- /schemes/matrix.prf: -------------------------------------------------------------------------------- 1 | # Matrix - MATLAB color scheme 2 | # Created by Scott Lowe, 2015-07-05. Modified 2015-04-08. 3 | # Based on the movie of the same name. 4 | # To enable this color scheme in MATLAB use schemer_import, available at: 5 | # https://github.com/scottclowe/matlab-schemer 6 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 7 | ColorsUseSystem=Bfalse 8 | ColorsUseMLintAutoFixBackground=Btrue 9 | Editor.VariableHighlighting.Automatic=Btrue 10 | Editor.NonlocalVariableHighlighting=Btrue 11 | EditorCodepadHighVisible=Btrue # with cell bg 12 | EditorCodeBlockDividers=Bfalse # without cell lines 13 | Editorhighlight-caret-row-boolean=Btrue 14 | EditorRightTextLineVisible=Btrue 15 | EditorRightTextLimitLineWidth=I1 16 | ColorsText=C-15810737 17 | ColorsBackground=C-16448762 18 | Colors_M_Keywords=C-8524550 19 | Colors_M_Comments=C-14199226 20 | Colors_M_Strings=C-15236555 21 | Colors_M_UnterminatedStrings=C-13769101 22 | Colors_M_SystemCommands=C-15122561 23 | Colors_M_Errors=C-2678475 24 | Colors_HTML_HTMLLinks=C-14525287 25 | Colors_M_Warnings=C-10475466 26 | ColorsMLintAutoFixBackground=C-6544075 27 | Editor.VariableHighlighting.Color=C-14855081 28 | Editor.NonlocalVariableHighlighting.TextColor=C-16354525 29 | Editorhighlight-lines=C-16117996 30 | Editorhighlight-caret-row-boolean-color=C-15919586 31 | EditorRightTextLimitLineColor=C-5723992 32 | -------------------------------------------------------------------------------- /schemes/monokai.prf: -------------------------------------------------------------------------------- 1 | # monokai - MATLAB color scheme 2 | # Generated with schemer_export v1.3.5, on MATLAB 8.1.0.604 (R2013a) 3 | # Mon Apr 25 15:03:32 BST 2016 4 | # To enable this color scheme in MATLAB use schemer_import, available at: 5 | # https://github.com/scottclowe/matlab-schemer 6 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 7 | ColorsUseSystem=Bfalse 8 | ColorsUseMLintAutoFixBackground=Btrue 9 | Editor.VariableHighlighting.Automatic=Btrue 10 | Editor.NonlocalVariableHighlighting=Btrue 11 | EditorCodepadHighVisible=Btrue 12 | EditorCodeBlockDividers=Btrue 13 | Editorhighlight-caret-row-boolean=Bfalse 14 | EditorRightTextLineVisible=Btrue 15 | EditorRightTextLimitLineWidth=I1 16 | ColorsText=C-460560 17 | ColorsBackground=C-14211038 18 | Colors_M_Keywords=C-448910 19 | Colors_M_Comments=C-9080482 20 | Colors_M_Strings=C-1647756 21 | Colors_M_UnterminatedStrings=C-65536 22 | Colors_M_SystemCommands=C-16711936 23 | Colors_M_Errors=C-65536 24 | Colors_HTML_HTMLLinks=C-16711681 25 | Colors_M_Warnings=C-27648 26 | ColorsMLintAutoFixBackground=C-11974594 27 | Editor.VariableHighlighting.Color=C-10066330 28 | Editor.NonlocalVariableHighlighting.TextColor=C-16729641 29 | Editorhighlight-lines=C-13421773 30 | Editorhighlight-caret-row-boolean-color=C-10066330 31 | EditorRightTextLimitLineColor=C-3355444 32 | Color_CmdWinWarnings=C-26368 33 | -------------------------------------------------------------------------------- /schemes/oblivion.prf: -------------------------------------------------------------------------------- 1 | # Oblivion - MATLAB color scheme 2 | # Created by Scott Lowe, 2015-07-05 3 | # Based on the Gedit theme "Oblivion", by Paolo Borelli. 4 | # https://github.com/mig/gedit-themes 5 | # To enable this color scheme in MATLAB use schemer_import, available at: 6 | # https://github.com/scottclowe/matlab-schemer 7 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 8 | ColorsUseSystem=Bfalse 9 | ColorsUseMLintAutoFixBackground=Btrue 10 | Editor.VariableHighlighting.Automatic=Btrue 11 | Editor.NonlocalVariableHighlighting=Btrue 12 | EditorCodepadHighVisible=Btrue 13 | EditorCodeBlockDividers=Btrue 14 | Editorhighlight-caret-row-boolean=Btrue 15 | EditorRightTextLineVisible=Btrue 16 | EditorRightTextLimitLineWidth=I1 17 | ColorsText=C-2893873 # aluminium2 18 | ColorsBackground=C-13749194 # aluminium6 19 | Colors_M_Keywords=C-1 # white 20 | Colors_M_Comments=C-7828859 # aluminium4 21 | Colors_M_Strings=C-1190912 # butter2 22 | Colors_M_UnterminatedStrings=C-3891200 # butter3 23 | Colors_M_SystemCommands=C-7675340 # chameleon1 24 | Colors_M_Errors=C-1103575 # scarlet1 25 | Colors_HTML_HTMLLinks=C-9265201 # skyblue1 26 | Colors_M_Warnings=C-217282 # orange1 27 | ColorsMLintAutoFixBackground=C-6029312 # scarlet3 28 | Editor.VariableHighlighting.Color=C-11625978 # chameleon3 29 | Editor.NonlocalVariableHighlighting.TextColor=C-9265201 # skyblue1 30 | Editorhighlight-lines=C-13288387 # 31 | Editorhighlight-caret-row-boolean-color=C-11184301 # aluminium5 32 | EditorRightTextLimitLineColor=C-11775661 # 33 | # C/C++ 34 | Editor.Language.C.Color.keywords=C-7675340 # chameleon1 35 | Editor.Language.C.Color.preprocessor=C-5406808 # plum1 36 | Editor.Language.C.Color.char-literal=C-9265201 # skyblue1 37 | # Java 38 | Editor.Language.Java.Color.keywords=C-7675340 # chameleon1 39 | Editor.Language.Java.Color.char-literal=C-9265201 # skyblue1 40 | # VHDL 41 | Editor.Language.VHDL.Color.Colors_M_Keywords=C-7675340 # chameleon1 42 | Editor.Language.VHDL.Color.operator=C-1 # white 43 | # Verilog 44 | Editor.Language.Verilog.Color.operator=C-1 # white 45 | Editor.Language.Verilog.Color.Colors_M_Keywords=C-7675340 # chameleon1 46 | # XML/HTML 47 | Editor.Language.XML.Color.tag=C-9265201 # skyblue1 48 | Editor.Language.XML.Color.attribute=C-7675340 # chameleon1 49 | Editor.Language.XML.Color.operator=C-1967753 # 50 | Editor.Language.XML.Color.doctype=C-5406808 # plum1 51 | Editor.Language.XML.Color.pi-content=C-5406808 # plum1 52 | Editor.Language.XML.Color.cdata-section=C-5406808 # plum1 53 | -------------------------------------------------------------------------------- /schemes/screenshots/cobalt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/cobalt.png -------------------------------------------------------------------------------- /schemes/screenshots/darkmate.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/darkmate.png -------------------------------------------------------------------------------- /schemes/screenshots/darksteel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/darksteel.png -------------------------------------------------------------------------------- /schemes/screenshots/default.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/default.png -------------------------------------------------------------------------------- /schemes/screenshots/matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/matrix.png -------------------------------------------------------------------------------- /schemes/screenshots/monokai.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/monokai.png -------------------------------------------------------------------------------- /schemes/screenshots/oblivion.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/oblivion.png -------------------------------------------------------------------------------- /schemes/screenshots/solarized-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/solarized-dark.png -------------------------------------------------------------------------------- /schemes/screenshots/solarized-light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/solarized-light.png -------------------------------------------------------------------------------- /schemes/screenshots/tango.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/tango.png -------------------------------------------------------------------------------- /schemes/screenshots/vibrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/scottclowe/matlab-schemer/4307569f9e7f32ff154383f0c3ca9e967094aadb/schemes/screenshots/vibrant.png -------------------------------------------------------------------------------- /schemes/solarized-dark.prf: -------------------------------------------------------------------------------- 1 | # Solarized Dark - MATLAB color scheme 2 | # Manually created on 2015-07-04 by Scott Lowe, based on the style guide of 3 | # http://ethanschoonover.com/solarized 4 | # To enable this color scheme in MATLAB use schemer_import, available at: 5 | # https://github.com/scottclowe/matlab-schemer 6 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 7 | ColorsUseSystem=Bfalse 8 | ColorsUseMLintAutoFixBackground=Btrue 9 | Editor.VariableHighlighting.Automatic=Btrue 10 | Editor.NonlocalVariableHighlighting=Btrue 11 | EditorCodepadHighVisible=Bfalse # no cell highlighting 12 | EditorCodeBlockDividers=Btrue # mark cells with line 13 | Editorhighlight-caret-row-boolean=Btrue 14 | EditorRightTextLineVisible=Btrue 15 | EditorRightTextLimitLineWidth=I1 16 | ColorsText=C-8153962 # base 0 17 | ColorsBackground=C-16766154 # base 03 18 | Colors_M_Keywords=C-3454186 # orange 19 | Colors_M_Comments=C-10981771 # base 01 20 | Colors_M_Strings=C-14251054 # blue 21 | Colors_M_UnterminatedStrings=C-13983336 # cyan 22 | Colors_M_SystemCommands=C-2935166 # magenta 23 | Colors_M_Errors=C-2346449 # red 24 | Colors_HTML_HTMLLinks=C-9670204 # violet 25 | Colors_M_Warnings=C-4880128 # yellow 26 | ColorsMLintAutoFixBackground=C-16304574 # base 02 27 | Editor.VariableHighlighting.Color=C-16304574 # base 02 28 | Editor.NonlocalVariableHighlighting.TextColor=C-8021760 # green 29 | Editorhighlight-lines=C-16766154 # base 03 30 | Editorhighlight-caret-row-boolean-color=C-16304574 # base 02 31 | EditorRightTextLimitLineColor=C-5723992 # matlab cell lines 32 | # MuPAD 33 | Editor.Language.MuPAD.Color.operator=C-8021760 # green 34 | Editor.Language.MuPAD.Color.function=C-4880128 # yellow 35 | Editor.Language.MuPAD.Color.constant=C-2935166 # magenta 36 | # TLC 37 | Editor.Language.TLC.Color.Colors_M_Keywords=C-8021760 # green 38 | # C/C++ 39 | Editor.Language.C.Color.preprocessor=C-8021760 # green 40 | Editor.Language.C.Color.char-literal=C-9670204 # violet 41 | # Java 42 | Editor.Language.Java.Color.char-literal=C-9670204 # violet 43 | # VHDL 44 | Editor.Language.VHDL.Color.operator=C-8021760 # green 45 | # Verilog 46 | Editor.Language.Verilog.Color.operator=C-8021760 # green 47 | # XML 48 | Editor.Language.XML.Color.tag=C-14251054 # blue 49 | Editor.Language.XML.Color.attribute=C-4880128 # yellow 50 | Editor.Language.XML.Color.operator=C-8021760 # green 51 | Editor.Language.XML.Color.value=C-13983336 # cyan 52 | Editor.Language.XML.Color.doctype=C-3454186 # orange 53 | Editor.Language.XML.Color.ref=C-9670204 # violet 54 | Editor.Language.XML.Color.pi-content=C-9670204 # violet 55 | Editor.Language.XML.Color.cdata-section=C-2935166 # magenta 56 | -------------------------------------------------------------------------------- /schemes/solarized-light.prf: -------------------------------------------------------------------------------- 1 | # Solarized Light - MATLAB color scheme 2 | # Manually created on 2015-07-04 by Scott Lowe, based on the style guide of 3 | # http://ethanschoonover.com/solarized 4 | # To enable this color scheme in MATLAB use schemer_import, available at: 5 | # https://github.com/scottclowe/matlab-schemer 6 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 7 | ColorsUseSystem=Bfalse 8 | ColorsUseMLintAutoFixBackground=Btrue 9 | Editor.VariableHighlighting.Automatic=Btrue 10 | Editor.NonlocalVariableHighlighting=Btrue 11 | EditorCodepadHighVisible=Bfalse # no cell highlighting 12 | EditorCodeBlockDividers=Btrue # mark cells with line 13 | Editorhighlight-caret-row-boolean=Btrue 14 | EditorRightTextLineVisible=Btrue 15 | EditorRightTextLimitLineWidth=I1 16 | ColorsText=C-10126461 # base 00 17 | ColorsBackground=C-133405 # base 3 18 | Colors_M_Keywords=C-3454186 # orange 19 | Colors_M_Comments=C-7102047 # base 1 20 | Colors_M_Strings=C-14251054 # blue 21 | Colors_M_UnterminatedStrings=C-13983336 # cyan 22 | Colors_M_SystemCommands=C-2935166 # magenta 23 | Colors_M_Errors=C-2346449 # red 24 | Colors_HTML_HTMLLinks=C-9670204 # violet 25 | Colors_M_Warnings=C-4880128 # yellow 26 | ColorsMLintAutoFixBackground=C-1120043 # base 2 27 | Editor.VariableHighlighting.Color=C-1120043 # base 2 28 | Editor.NonlocalVariableHighlighting.TextColor=C-8021760 # green 29 | Editorhighlight-lines=C-133405 # base 00 30 | Editorhighlight-caret-row-boolean-color=C-1120043 # base 2 31 | EditorRightTextLimitLineColor=C-5723992 # matlab cell lines 32 | # MuPAD 33 | Editor.Language.MuPAD.Color.operator=C-8021760 # green 34 | Editor.Language.MuPAD.Color.function=C-4880128 # yellow 35 | Editor.Language.MuPAD.Color.constant=C-2935166 # magenta 36 | # TLC 37 | Editor.Language.TLC.Color.Colors_M_Keywords=C-8021760 # green 38 | # C/C++ 39 | Editor.Language.C.Color.preprocessor=C-8021760 # green 40 | Editor.Language.C.Color.char-literal=C-9670204 # violet 41 | # Java 42 | Editor.Language.Java.Color.char-literal=C-9670204 # violet 43 | # VHDL 44 | Editor.Language.VHDL.Color.operator=C-8021760 # green 45 | # Verilog 46 | Editor.Language.Verilog.Color.operator=C-8021760 # green 47 | # XML 48 | Editor.Language.XML.Color.tag=C-14251054 # blue 49 | Editor.Language.XML.Color.attribute=C-4880128 # yellow 50 | Editor.Language.XML.Color.operator=C-8021760 # green 51 | Editor.Language.XML.Color.value=C-13983336 # cyan 52 | Editor.Language.XML.Color.doctype=C-3454186 # orange 53 | Editor.Language.XML.Color.ref=C-9670204 # violet 54 | Editor.Language.XML.Color.pi-content=C-9670204 # violet 55 | Editor.Language.XML.Color.cdata-section=C-2935166 # magenta 56 | -------------------------------------------------------------------------------- /schemes/tango.prf: -------------------------------------------------------------------------------- 1 | # Tango - MATLAB color scheme 2 | # Created by Scott Lowe, 2015-07-05, Modified 2016-04-08 3 | # Based on the colours specified for use in the Tango Project. 4 | # http://tango-project.org/ 5 | # To enable this color scheme in MATLAB use schemer_import, available at: 6 | # https://github.com/scottclowe/matlab-schemer 7 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 8 | # 9 | # Palette, taken from 10 | # https://en.wikipedia.org/wiki/Tango_Desktop_Project#Palette 11 | # | Light Medium Dark 12 | # --------------+------------------------------------ 13 | # Butter | -202417 -1190912 -3891200 14 | # Orange | -217282 -689920 -3253248 15 | # Chocolate | -1459858 -4096751 -7382782 16 | # Chameleon | -7675340 -9186794 -11625978 17 | # Sky Blue | -9265201 -13343324 -14660985 18 | # Plum | -5406808 -9088901 -10734234 19 | # Scarlet Red | -1103575 -3407872 -6029312 20 | # Aluminium (l) | -1118484 -2893873 -4538954 21 | # Aluminium (d) | -7828859 -11184301 -13749194 22 | ColorsUseSystem=Bfalse 23 | ColorsUseMLintAutoFixBackground=Btrue 24 | Editor.VariableHighlighting.Automatic=Btrue 25 | Editor.NonlocalVariableHighlighting=Btrue 26 | EditorCodepadHighVisible=Btrue 27 | EditorCodeBlockDividers=Btrue 28 | Editorhighlight-caret-row-boolean=Btrue 29 | EditorRightTextLineVisible=Btrue 30 | EditorRightTextLimitLineWidth=I1 31 | ColorsText=C-11184301 # aluminium-dark 32 | ColorsBackground=C-1 # white 33 | Colors_M_Keywords=C-6029312 # scarletred-dark 34 | Colors_M_Comments=C-9265201 # skyblue-light 35 | Colors_M_Strings=C-5406808 # plum-light 36 | Colors_M_UnterminatedStrings=C-13343324 # skyblue 37 | Colors_M_SystemCommands=C-4096751 # chocolate 38 | Colors_M_Errors=C-1103575 # scarletred-light 39 | Colors_HTML_HTMLLinks=C-13343324 # skyblue 40 | Colors_M_Warnings=C-217282 # orange-light 41 | ColorsMLintAutoFixBackground=C-4538954 # aluminium-light 42 | Editor.VariableHighlighting.Color=C-202417 # butter-light 43 | Editor.NonlocalVariableHighlighting.TextColor=C-11625978 # chameleon-dark 44 | Editorhighlight-lines=C-1118484 # aluminium-white 45 | Editorhighlight-caret-row-boolean-color=C-2893873 # aluminium-vlight 46 | EditorRightTextLimitLineColor=C-7828859 # aluminium 47 | # C/C++ 48 | Editor.Language.C.Color.keywords=C-11625978 49 | Editor.Language.C.Color.char-literal=C-3891200 50 | # Java 51 | Editor.Language.Java.Color.keywords=C-11625978 52 | Editor.Language.Java.Color.char-literal=C-3891200 53 | # VHDL 54 | Editor.Language.VHDL.Color.operator=C-11625978 55 | # Verilog 56 | Editor.Language.Verilog.Color.operator=C-11625978 57 | # XML/HTML 58 | Editor.Language.XML.Color.error=C-1103575 59 | Editor.Language.XML.Color.tag=C-6029312 60 | Editor.Language.XML.Color.attribute=C-11625978 61 | Editor.Language.XML.Color.operator=C-1190912 62 | Editor.Language.XML.Color.value=C-4096751 63 | Editor.Language.XML.Color.doctype=C-689920 64 | Editor.Language.XML.Color.ref=C-3891200 65 | Editor.Language.XML.Color.pi-content=C-13343324 66 | Editor.Language.XML.Color.cdata-section=C-5406808 67 | -------------------------------------------------------------------------------- /schemes/vibrant.prf: -------------------------------------------------------------------------------- 1 | # Vibrant - MATLAB color scheme 2 | # Created by Scott Lowe, 2015-07-12 3 | # Based on the GTK stylesheet "Vibrant", by Lateef Alabi-Oki. 4 | # https://wiki.gnome.org/Projects/GtkSourceView/StyleSchemes 5 | # To enable this color scheme in MATLAB use schemer_import, available at: 6 | # https://github.com/scottclowe/matlab-schemer 7 | # https://www.mathworks.com/matlabcentral/fileexchange/53862-matlab-schemer 8 | ColorsUseSystem=Bfalse 9 | ColorsUseMLintAutoFixBackground=Btrue 10 | Editor.VariableHighlighting.Automatic=Btrue 11 | Editor.NonlocalVariableHighlighting=Btrue 12 | EditorCodepadHighVisible=Btrue 13 | EditorCodeBlockDividers=Btrue 14 | Editorhighlight-caret-row-boolean=Btrue 15 | EditorRightTextLineVisible=Btrue 16 | EditorRightTextLimitLineWidth=I1 17 | ColorsText=C-11711155 # text_fg 18 | ColorsBackground=C-1 # white 19 | Colors_M_Keywords=C-6815487 # accent_deep_red 20 | Colors_M_Comments=C-183551 # accent_red 21 | Colors_M_Strings=C-16684599 # accent_blue_base 22 | Colors_M_UnterminatedStrings=C-16698473 # accent_blue_shadow 23 | Colors_M_SystemCommands=C-10092340 # accent_dark_violet 24 | Colors_M_Errors=C-2883584 # accent_red_base 25 | Colors_HTML_HTMLLinks=C-16766147 # ubuntu_toner 26 | Colors_M_Warnings=C-292096 # orange_base 27 | ColorsMLintAutoFixBackground=C-140901 # human_highlight 28 | Editor.VariableHighlighting.Color=C-256 # yellow 29 | Editor.NonlocalVariableHighlighting.TextColor=C-13395712 # accent_green_base 30 | Editorhighlight-lines=C-66341 # custom 31 | Editorhighlight-caret-row-boolean-color=C-131175 # accent_yellow_highlight 32 | EditorRightTextLimitLineColor=C-140901 # human_highlight 33 | --------------------------------------------------------------------------------