Documentation

uisetcolor

Open color selection dialog box

Syntax

c = uisetcolor
c = uisetcolor([r g b])
c = uisetcolor(h)
c = uisetcolor(...,'dialogTitle')

Description

c = uisetcolor displays a modal color selection dialog appropriate to the platform, and returns the color selected by the user. The dialog box is initialized to white.

c = uisetcolor([r g b]) displays a dialog box initialized to the specified color, and returns the color selected by the user. r, g, and b must be values between 0 and 1.

c = uisetcolor(h) displays a dialog box initialized to the color of the object specified by handle h, returns the color selected by the user, and applies it to the object. h must be the handle to an object containing a color property.

c = uisetcolor(...,'dialogTitle') displays a dialog box with the specified title.

If the user presses Cancel from the dialog box, or if any error occurs, the output value is set to the input RGB triple, if provided; otherwise, it is set to 0.

More About

collapse all

Modal Dialog

A window that blocks interaction with other windows until the user closes the blocking window. For more information, see the figure WindowStyle property description.

Introduced before R2006a

Was this topic helpful?