# MATLAB Spoken Here

## Feeling colorful?

Some days my eyes are tired and other days I am just bored with a white background and black text. On these days I go and set my MATLAB Desktop background and foreground colors to something different. I usually like the soothing colors of a light blue background with black text.

To change the colors of the desktop, go to the File menu -> Preferences. Select “Colors” in the preferences tree:

Unselect the checkbox “Use system colors” and then set the Text color and Background color to your favorite colors and hit the OK button:

If you are feeling adventurous or like you need something brighter you can set it to have a yellow background and hot pink text [1]:

1 – Note that I do not really recommend this color combination.

### 18 Responses to “Feeling colorful?”

1. Michel Slivitzky replied on :

How about changing background colors for the Editor ?

2. Kristin replied on :

Changing the colors affects all the desktop components including the Editor. If you look in the pics above, I have the Editor docked in the desktop. If you mean changing the color for just the Editor, that is not currently an option.

3. Katie replied on :

It would be great if you could set the different components to different colors…that way if you move them around you can spot them super quick…..

4. Kristin replied on :

Thanks Katie. We will consider that for a future release.

5. Jon Oppelaar replied on :

is there a way to change the color of the highlighted cells?

6. Ken replied on :

Hi Jon,

You can change the color of the highlighted cell by doing the following:

1) Go to File -> Preferences -> Editor/Debugger -> Display
2) In the ‘Cell display options’ section, select the desired color in the color picker next to the ‘Highlight cells’ checkbox.

-Ken

7. Dipayan Maiti replied on :

Hi,
How can I change the text colors using a matlab function? I want to change the text color in the command prompt. I will be using disp or fprintf to output my text to the standard output (say command window).
-Thanks,
-D

8. Mike replied on :

Dipayan,

There is no MATLAB function to change the text color. In addition, if you use the Preferences to change the font colors, you will change it for all instances for that text, i.e. you can’t control the color for just a piece of text.

9. Dipayan Maiti replied on :

Mike. Thanks a lot!

10. Jennifer replied on :

How do you change the color of selection highlight? I like to work with a black background and white text and on a linux machine, anytime I select text (in the editor or command window), the selected area is shown in black — so I can’t see what has been selected. In windows, changing the OS desktop themes and restarting matlab will control the selection color, but no such luck on linux.

11. Mike replied on :

Jennifer,

We don’t have a mechanism for changing the text selection color on Linux. However the default should be white text with a blue background for the selection.

12. Nate replied on :

Is it possible to change the matlab interface border colors (currently everything is gray)? I like all my backgrounds black with bright text and the borders are the one thing that still can’t dim at all.

Also, a nice touch would be to allow background watermarks/pictures for the editor or command line.

Thanks

13. Yair Altman replied on :

Dipayan – My cprintf utility was today uploaded to the File Exchange ( http://www.mathworks.com/matlabcentral/fileexchange/24093 ) and does exactly what you requested: the ability to specify the text color (and/or underline) of formatted text displayed in the Command Window.

Note that this submission relies on undocumented functionality, so for a supported and more robust solution we’ll need to wait for TMW’s desktop team to provide an official solution in some future release.

14. Pete replied on :

This is amazing!

15. Dipayan Maiti replied on :

Yair: This might be late but thanks a lot!

16. AF replied on :

Is there a way to make the Matlab Editor color numbers (like 1.2) a different color than variables? Sometimes I have to use Matlab Editor (no Vim/Emacs available), and it’s hard to differentiate 1 vs l, although | is shown in a different color and is thus never ambiguous.

17. Sandro replied on :

> is there a way to change the color of the highlighted cells?

There is no “Cell display options section” in Matlab 2012a. Has it been removed?

18. Sandro replied on :

Found it under: Files -> Preferences -> Colors -> Programming tools.

 Name (required) E-mail (required, will not be published) Website (optional) Spam protection (required): What is 5 + 7 ?

Wrap code fragments inside <pre> tags, like this:

<pre class="code">
a = magic(3);
sum(a)
</pre>


If you have a "<" character in your code, either follow it with a space or replace it with "&lt;" (including the semicolon).

News from the intersection of MATLAB, Community, and the web.

These postings are the author's and don't necessarily represent the opinions of MathWorks.