uisetcolor

Open standard dialog box for setting object's color specification (ColorSpec)

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

expand all

Modal Dialog

A window that prevents the user from interacting with other windows before responding. For more information, see the figure WindowStyle property description.

Was this topic helpful?