generates RGB code from color name
Syntax
RGB = swplot.color(cName)
RGB = swplot.color(cName,index)
Description
RGB = swplot.color(cName)
reads the color RGB values from the
color.dat file corresponding to the given color name cName
. The
color name can be either a single character (see colorspec) or
any HTML color name
that is stored in the color.dat file.
RGB = swplot.color(cName,index)
if index
is true, RGB code
corresponding to the cName
color index is read.
Examples
Read the RGB code corresponding to light gray:
RGB = swplot.color('LightGray')
Output
RGB =
211
211
211
Input Arguments
cName
- String of a color name. For multiple colors, use a cell of strings.
index
- If
true
, instead of the color name,cName
means the index of the color in the color.dat file. index 1 corresponds to the 9th entry (the first 8 entry are standard Matlab color names), default value isfalse
.
Output Arguments
RGB
- RGB color codes in a matrix with dimensions of , where every value is an integer between 0 and 255.