
Color Palette
12-25
The colorPalette function accepts property value pairs as input arguments.
Only the custom property
Parent is supported. This property specifies the
handle of the parent figure or panel that contains the color palette. If the call
to
colorPalette does not specify a parent, it uses the current figure, gcf.
Unrecognized property names or invalid values are ignored.
colorPalette returns a function handle that the host GUI can call to get the
currently selected color. The host GUI can use the returned function handle at
any time before the color palette is destroyed. For more information, see
“Sharing Data Between Two GUIs” on page 12-30 for implementation details.
“Icon Editor” on page 12-33 is an example of a host GUI that uses the
colorPalette.
Techniques Used in the Example
This example illustrates the following techniques:
• Retrieving output from the GUI when it returns.
• Supporting custom input property/value pairs with data validation.
• Sharing data between two GUIs
See “Icon Editor” on page 12-33 for examples of these and other programming
techniques.
Note This example uses nested functions. For information about using
nested functions, see Nested Functions in the MATLAB documentation.
View the Completed GUI M-File
If you are reading this in the MATLAB Help browser, you can click the
following link to display the MATLAB Editor with a complete listing of the code
that is discussed in the following sections.
Kommentare zu diesen Handbüchern