setColor

Set color used to draw ROI object

setColor is not recommended. Use one of the ROI classes instead, described in ROI Creation Overview.

Syntax

setColor(h,color)

Description

example

setColor(h,color) sets the color used to draw the ROI object h.

Examples

collapse all

Display an image. Draw a polygon on the image, specifying the location of five vertices.

imshow('gantrycrane.png')
h = impoly(gca,[188,30; 189,142; 93,141; 13,41; 14,29]);

Set the color of the polygon to yellow.

setColor(h,'yellow');

Input Arguments

collapse all

ROI object, specified as an imellipse, imfreehand, imline, impoint, impoly, or imrect object.

RGB color value, specified as a 3-element numeric vector, or the long or short name of a predefined color, such as 'white' or 'w'. See ColorSpec for a list of predefined colors.

Introduced in R2008a