Change Color Scheme for App Designer Editor

I prefer to edit code with a high-contrast color scheme since looking at a white screen for a long time makes my retinas burn. It is easy enough to change the coloring preferences for MATLAB through Home\Preferences\Colors. However, the editing enviroment for App Designer seems to be somewhat independant from theses settings. While the text color changes appropriately, the background color seems to be locked as white. There also doesn't seem to be any preferences specific to App Designer either. Having Windows set to a high-contrast theme doesn't do the trick either.
Is there a way to adjust the background color for the App Designer editing enviroment (Code View), or am I just stuck with white?

5 Commenti

I haven't looked into the preference settings regarding app designer but it's fairly easy to set the colors from with you the startupFcn() of your app. For example, this line below sets the app background as gray (where myGUIFigure is the main handle to your app).
Note that you'll have to change the color of all panels, and other objects since this line only changes the app background.
If this is something you needed to do for several apps, it would be straightforward to write an app theme function that takes an app handle as an input and then searches for all possible app components, changing their colors according to a theme. This would be called from the startupFcn().
app.myGUIFigure.Color = [.5 .5 .5];
Adam,
Changing the color of the app windows themselves is a good idea and I may end up doing that. However, I was asking about the editing enviroment itself, rather than the resulting app's window. I'm trying to find a way to set the background of the Code View be be black. I can see where the confusion came from, I'll update my original question.
I checked them out, but surprisingly there are no color setting for the Code View in the App Designer preferences. It like it was intented to be controlled by the color preferences, but it just isn't connected properly.
Adam Danz
Adam Danz il 23 Set 2019
Modificato: Adam Danz il 20 Ott 2020
If you have a functional example of a property not behaving according to documentation, report it to tech support
If you find a solution, it would be helpful to lots of people if you share that as an answer below.

Accedi per commentare.

 Risposta accettata

Scott
Scott il 23 Mar 2021
Install 2021a.
In general, I'd say they solved 99% of what I was looking for in this issue. App Designer now uses the color scheme I have set in the editor for code that is not auto generated by App Designer. I suppose the only issue I now have is I need to highlight the auto generated code to read it:
All things considered, this is a MAJOR improvement!
I should note that I use matlab schemer to set my color scheme.

4 Commenti

if you look under preferences for AppDesigner( R2021a), you will find that you can also set the background for the read only code, so it is possible to make the background uniformly one color. I only just discovered this by accident. No doubt the matlab methods to do this are exposed programatically somewhere.
Thanks! That worked quite well. I didn't realize that was in the preferences (and FYI to everyone else, it's in the preferences of the primary MATLAB window).
This is what I needed to make schemer and app designer happy.
I was looking to see how to make this read-only background color change programatically, but I'm
not seeing the correct setting under
s = settings; s.matlab.colors
Which is a bummer, but since I don't change schemes very often it'll be fine for me.
The 'Read-only background' color can be changed in Preferences, at least as of R2021a.
Preferences > MATLAB > App Designer
See MATLAB documentation "Manage Code in App Designer Code View" subsection "Personalize Code View Appearance" for more details.

Accedi per commentare.

Più risposte (1)

Christopher Walsh
Christopher Walsh il 24 Set 2019
I ended up sending a report to tech support. At this moment, the color of text and the background color in the App Designer Code Veiw cannot be changed.

6 Commenti

And, one year and two versions later, situation is the same. Though to implement it costs 5-10 lines of code.
Yes, this is really annoying. And the most stupid thing is, that all other colors are changed along with the preferences of the normal editor... why? just why?
A really wish the App Designer code editor would just follow the color scheme for the normal Matlab editor. I can't read it with all of the font colors intended for a black background.
Agreed. I code in the regular (non-app designer) window in a light text on dark background (thanks to Scott Lowe), but there's no such animal for app designer. It's even worse now that I have that setup for the other editor, b/c now the highlights in app designer (on the white background) are even more difficult to read:
I can't tell you how much better that screen shot looks than in real life.
while this_solution_does_not_exist
fprintf('Please add support for this Mathworks! :)')
if this_solution_does_not_exist == false
celebrate('beer');
break;
end
end
Anyone found a workaround for this yet?
The 'Read-only background' color can be changed in Preferences, at least as of R2021a.
Preferences > MATLAB > App Designer
See MATLAB documentation "Manage Code in App Designer Code View" subsection "Personalize Code View Appearance" for more details.

Accedi per commentare.

Categorie

Prodotti

Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by