1+ function MatlabThemeChooser
2+ f = figure(' Menubar' ,' none' , ' NumberTitle' ,' off' , ...
3+ ' Name' ,' MATLAB Theme Editor' , ' Position' ,[810 352 275 578 ]);
4+ padding = {' Padding' ,5 , ' Spacing' ,5 };
5+ panelprops = {' BorderType' ,' line' , ' HighlightColor' ,[.8 .8 .8 ]};
6+ txtprops = {' Horizontal' ,' left' };
7+ butprops = {' Callback' ,' set(gcbo,'' BackgroundColor'' ,uisetcolor(get(gcbo,'' BackgroundColor'' )))' };
8+
9+ v0 = uix .VBox(' Parent' ,f , padding{: });
10+
11+ %%
12+ p1 = uipanel(' Parent' ,v0 , ' Title' ,' Desktop tool colors' , panelprops{: });
13+ h1 = uix .HBox(' Parent' ,p1 , padding{: });
14+ v1 = [uix .VBox(' Parent' ,h1 ), uix .VBox(' Parent' ,h1 )];
15+
16+ uicontrol(' Parent' ,v1(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Text' );
17+ uicontrol(' Parent' ,v1(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Background' );
18+ uicontrol(' Parent' ,v1(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' ColorsText' )
19+ uicontrol(' Parent' ,v1(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' ColorsBackground' )
20+
21+ %%
22+ p2 = uipanel(' Parent' ,v0 , ' Title' ,' MATLAB syntax highlighting colors' , panelprops{: });
23+ h2 = uix .HBox(' Parent' ,p2 , padding{: });
24+ v2 = [uix .VBox(' Parent' ,h2 ), uix .VBox(' Parent' ,h2 )];
25+
26+ uicontrol(' Parent' ,v2(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Keywords' );
27+ uicontrol(' Parent' ,v2(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Comments' );
28+ uicontrol(' Parent' ,v2(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Strings' );
29+ uicontrol(' Parent' ,v2(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Unterminated Strings' );
30+ uicontrol(' Parent' ,v2(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' System Commands' );
31+ uicontrol(' Parent' ,v2(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Syntax Errors' );
32+ uicontrol(' Parent' ,v2(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Colors_M_Keywords' );
33+ uicontrol(' Parent' ,v2(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Colors_M_Comments' );
34+ uicontrol(' Parent' ,v2(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Colors_M_Strings' );
35+ uicontrol(' Parent' ,v2(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Colors_M_UnterminatedStrings' );
36+ uicontrol(' Parent' ,v2(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Colors_M_SystemCommands' );
37+ uicontrol(' Parent' ,v2(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Colors_M_Errors' );
38+
39+ %%
40+ p3 = uipanel(' Parent' ,v0 , ' Title' ,' MATLAB Command Window colors' , panelprops{: });
41+ h3 = uix .HBox(' Parent' ,p3 , padding{: });
42+ v3 = [uix .VBox(' Parent' ,h3 ), uix .VBox(' Parent' ,h3 )];
43+
44+ uicontrol(' Parent' ,v3(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Error Text' );
45+ uicontrol(' Parent' ,v3(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Warning Text' );
46+ uicontrol(' Parent' ,v3(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Hyperlinks' );
47+ uicontrol(' Parent' ,v3(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Color_CmdWinErrors' );
48+ uicontrol(' Parent' ,v3(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Color_CmdWinWarnings' );
49+ uicontrol(' Parent' ,v3(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Colors_HTML_HTMLLinks' );
50+
51+ %%
52+ p4 = uipanel(' Parent' ,v0 , ' Title' ,' Code analyzer colors' , panelprops{: });
53+ h4 = uix .HBox(' Parent' ,p4 , padding{: });
54+ v4 = [uix .VBox(' Parent' ,h4 ), uix .VBox(' Parent' ,h4 )];
55+
56+ uicontrol(' Parent' ,v4(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Warnings' );
57+ uicontrol(' Parent' ,v4(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Autofix highlight' );
58+ uicontrol(' Parent' ,v4(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Colors_M_Warnings' );
59+ uicontrol(' Parent' ,v4(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' ColorsMLintAutoFixBackground' );
60+
61+ %%
62+ p5 = uipanel(' Parent' ,v0 , ' Title' ,' Variable and function colors' , panelprops{: });
63+ h5 = uix .HBox(' Parent' ,p5 , padding{: });
64+ v5 = [uix .VBox(' Parent' ,h5 ), uix .VBox(' Parent' ,h5 )];
65+
66+ uicontrol(' Parent' ,v5(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Automatically highlight' );
67+ uicontrol(' Parent' ,v5(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Variables with shared scope' );
68+ uicontrol(' Parent' ,v5(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Editor.VariableHighlighting.Color' );
69+ uicontrol(' Parent' ,v5(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Editor.NonlocalVariableHighlighting.TextColor' );
70+
71+ %%
72+ p6 = uipanel(' Parent' ,v0 , ' Title' ,' Section display colors' , panelprops{: });
73+ h6 = uix .HBox(' Parent' ,p6 , padding{: });
74+ v6 = [uix .VBox(' Parent' ,h6 ), uix .VBox(' Parent' ,h6 )];
75+
76+ uicontrol(' Parent' ,v6(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Highlight sections' );
77+ uicontrol(' Parent' ,v6(2 ), ' Style' ,' pushbutton' , butprops{: }, ' BackgroundColor' ,' k' ,' Tag' ,' Editorhighlight-lines' );
78+ %%
79+ p8 = uipanel(' Parent' ,v0 , ' Title' ,' Section display colors' , panelprops{: });
80+ h8 = uix .HBox(' Parent' ,p8 , padding{: });
81+ v8 = [uix .VBox(' Parent' ,h8 ), uix .VBox(' Parent' ,h8 )];
82+
83+ uicontrol(' Parent' ,v8(1 ), ' Style' ,' text' , txtprops{: }, ' String' ,' Font' );
84+ uicontrol(' Parent' ,v8(2 ), ' Style' ,' pushbutton' , ' String' ,' F' );
85+
86+ %%
87+ h7 = uix .HButtonBox(' Parent' ,v0 );
88+ uicontrol(' Parent' ,h7 , ' Style' ,' pushbutton' , butprops{: }, ' String' ,' Load...' ,...
89+ ' Callback' ,@loadCallback );
90+ uicontrol(' Parent' ,h7 , ' Style' ,' pushbutton' , butprops{: }, ' String' ,' Save...' ,...
91+ ' Callback' ,@saveCallback );
92+ uicontrol(' Parent' ,h7 , ' Style' ,' pushbutton' , butprops{: }, ' String' ,' Restore' ,...
93+ ' Callback' ,@restoreCallback );
94+ uicontrol(' Parent' ,h7 , ' Style' ,' pushbutton' , butprops{: }, ' String' ,' Apply' ,...
95+ ' Callback' ,@applyCallback );
96+
97+ %%
98+ set([h1 ,h2 ,h3 ,h4 ,h5 ,h6 ,h8 ], ' Widths' , [-1 30 ]);
99+ set(v0 , ' Heights' , ([2 6 3 2 2 1 1 0 ]+1.2 )*20 )
100+ end
101+
102+ % TODO: move or transfer the following callbacks to separate files:
103+ function loadCallback(source ,callbackdata ) % #ok
104+ disp(' "Load" has been clicked!' );
105+ end
106+
107+ function saveCallback(source ,callbackdata ) % #ok
108+ disp(' "Save" has been clicked!' );
109+ end
110+
111+ function restoreCallback(source ,callbackdata ) % #ok
112+ disp(' "Restore" has been clicked!' );
113+ end
114+
115+ function applyCallback(source ,callbackdata ) % #ok
116+ disp(' "Apply" has been clicked!' );
117+ end
0 commit comments