Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Importing/Exporting color themes for the MATLAB editor

Is there a way (maybe undocumented?) of importing/exporting color themes for the MATLAB editor?

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

like image 756
Amelio Vazquez-Reina Avatar asked Aug 09 '11 20:08

Amelio Vazquez-Reina


People also ask

What is Matlab schemer?

MATLAB Schemer makes it easy to change the color scheme (a.k.a. theme) of the MATLAB display and GUI. You can use Schemer to import a predefined color scheme, transfer your color settings between installations, or create your own color scheme.

Is there a dark mode Matlab?

As of release R2022a you can select a dark or light theme in MATLAB Online.


1 Answers

The color settings are saved in the matlab.prf file. You can find its location by running the command:

prefdir

There are a number of lines that start 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 those lines as your "theme" and then share them with others. They just have to replace the Colors* lines with yours.

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

like image 178
Alexandre Chabot Avatar answered Sep 30 '22 20:09

Alexandre Chabot