What’s Your Color Scheme?
Brett‘s Pick this week is MATLAB Schemer, by Scott Lowe.
Easy manipulation of your MATLAB color scheme!
I’m curious: what color scheme do you use when you write code in MATLAB? Do you stick with the default, or have you customized the colors in your editor? And are those of you who use Linux more likely to use light text on a dark background than are those of use who work in Windows?
MATLAB is customizable!
Did you know that you can easily change the colors of your text in MATLAB? In the Preferences dropdown from the Home tab, you can specify the colors of text, background, keywords, strings, comments, errors, hyperlinks, warnings, etc. Check out: Preferences->Colors to see what I mean:
If you want to change the defaults for any reason–to mitigate eye strain, to help with color-blindness issues, or just to create a more pleasing environment, you can do that! (And if you like the defaults, you can keep them, too!)
I confess: I have been using MATLAB for so long that the default color scheme seems “right” to me, with one exception. Since I often share my screen with others, I find that the default pale yellow for section highlighting doesn’t work well for me, and I have changed mine in my preferences to be a light cyan; I think it’s easier to see.
That said, the ease with which I can change my color schemes using Scott’s “Schemer” code has me rethinking my preferences…. or at least, considering alternatives. To start, I Googled “preferences for coding color schemes,” and found lots of discussions about the topic. Many people indicated that they liked the “monokai” scheme. So I simply executed the command:
and launched a file selector. Browsing to Scott’s directory of pre-saved schemes, I selected “monokai.prf,” and voila! my text changed to white on a black bacground; strings changed to a pale yellow, highlights changed to blue,…. you get the point!
Scott provided “monokai” and about 10 other color schemes.
If you’ve spent any time customizing your own, please remember to save them:
before you change things!
This is very useful, though; I get to kick the tires before I buy the car, and I can easily return the car after I’ve bought it if I decide that I don’t like it!
Very nice work, Scott! (It’s evident that many others agree; Schemer has been downloaded 35,000 times [as of this writing]–including nearly 1400 downloadsthis month–and has 213 ratings averaging 5 stars [out of 5]!) Outstanding!
As always, I welcome your thoughts and comments.
Published with MATLAB® R2019a
To leave a comment, please click here to sign in to your MathWorks Account or create a new one.