Mask color, specified as a character vector, cell array of character vectors,
vector, or M-by-3 matrix of RGB values.
An RGB triplet is a three-element row vector whose elements specify the
intensities of the red, green, and blue components of the color. The intensities must
be in the range [0,1]
, for example, [0.4 0.6
0.7]
. When using a data type of uint8
, which is defined
within the range of [0,255]
, conversions are necessary to ensure
that the expected range is met. For example, to specify the previous vector, you must
convert it by using uint8(255*[0.4 0.6 0.7])
.
You can specify a different color for each mask or one color for all masks. To
specify one color for all masks, set MaskColor
to a color string
or an [R
G
B] vector.
Specification | Format | Example |
---|
Specify one color for all shapes (or markers) | Short color name or color name | "r"
"red"
|
RGB triplet | [1 0 0]
|
Specify a color for each shape (or marker) | Vector of color names | ["red","yellow","blue"]
|
Three-column matrix of RGB triplets | [1 0 0
0 1 1
1 0 1
1 1 1] |
Supported colors are listed in the table.
Color Name | Short Name | RGB Triplet | Appearance |
---|
"red" | "r" | [1 0 0] | |
"green" | "g" | [0 1 0] | |
"blue" | "b" | [0 0 1] | |
"cyan" | "c" | [0 1 1] | |
"magenta" | "m" | [1 0 1] | |
"yellow" | "y" | [1 1 0] | |
"black" | "k" | [0 0 0] | |
"white" | "w" | [1 1 1] | |
Color values must be specified in the range of the data type support that you use
to specify them. For example, if you specify an input of double
datatype, then values must be in the range [0,1]
. If you specify an
input of uint8
datatype, then values must be in the range
[0 255]
. For example, [0,0,1]
and
uint8([0,0,255])
are two formats for the same color blue.
Data Types: logical
| uint8
| uint16
| int16
| double
| single