Is there a list giving RGB values for different predefined colors?

10 views (last 30 days)
There should be a list relating different colors (such as green, red, etc.) to their RGB values which I can reference directly from my code.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 21 Feb 2012
The COLORSPEC documentation gives a list of predefined colors and their RGB equivalents. This can be found at:
<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/colorspec.html>
For a visual on more color options which do not have predefined names in MATLAB, open the Colormap Editor by typing
colormapeditor
at the MATLAB prompt. Hovering your mouse pointer over the displayed colorbar will display corresponding RGB values.
To access the RGB values from the command line, you can look at the RGB values of the currently selected colormap by typing
colormap
at the MATLAB prompt. This will return an m-by-3 matrix of real numbers between 0.0 and 1.0. Each row is an RGB vector that defines one color. For more information on the different colormaps available, visit the colormap documentation at:
<http://www.mathworks.com/access/helpdesk/help/techdoc/ref/colormap.html>

More Answers (0)

Categories

Find more on Colormaps in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!