Documentation Center

  • Trials
  • Product Updates

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.

    Note   A modal dialog box prevents the user from interacting with other windows before responding. For more information, see WindowStyle in the MATLAB® Figure Properties.

See Also

Was this topic helpful?