Import / export color themes for MATLAB editor

Is there a (possibly undocumented ?) Way to import / export color themes for the MATLAB editor?

As an example, I would like to import the Zenburn color scheme into MATLAB.

+8
matlab color-scheme
source share
2 answers

Color settings are saved in matlab.prf file. You can find its location, but by running the command:

prefdir 

There are a number of lines starting with the word Colors, for example:

 ColorsBackground=C-16506839 ColorsMLintAutoFixBackground=C-3454186 ColorsText=C-8153962 ColorsUseMLintAutoFixBackground=Btrue ColorsUseSystem=Bfalse Colors_HTML_HTMLLinks=C-7102047 Colors_M_Comments=C-10981771 Colors_M_Errors=C-2346449 Colors_M_Keywords=C-8021760 Colors_M_Strings=C-13983336 Colors_M_SystemCommands=C-7613747 Colors_M_UnterminatedStrings=C-2935166 Colors_M_Warnings=C-27648 

You can save these lines as your "theme" and then share them with others. They just need to replace the “Colors” lines with yours.

I would recommend opening the matlab.prf file in some kind of text editor and then sorting the lines to make it easier to select only the lines of interest.

+9
source share

I was so annoyed by the inability to import and export the color scheme / theme in MATLAB when I tried to move my own custom theme between the MATLAB installations, I went and made a package that does just that.

The end result, called MATLAB Schemer , is pretty complete. In addition to the basic colors described in the publication by Alexandre Chabot, he will also import and export editor colors, the status of switchable parameters, such as line restriction and cell mode, as well as syntax highlighting colors in other languages ​​supported by MATLAB (C, C ++, Java , Xml, html, some simulink stuff). In addition, if a theme is imported only for MATLAB, it will be generalized to apply the theme in other languages.

It is available on MATLAB FileExchange and on GitHub .

I implemented several color schemes myself, but did not implement the Senburn scheme. Since this post is already a few years ago, I suppose you have long solved the problem of setting MATLAB to use colors from the Zenburn theme. If so, you can create a Zenburn theme by exporting the color settings you have just by running schemer_export() in the MATLAB terminal. You can also share it by adding it to the color scheme repository.

I hope this will be useful (if not for you than for someone else).

+9
source share

All Articles