User`s guide

Compose and Code GUIs with Interactive Tools
of colors. The uisetcolor function opens a GUI that returns color values
you can plug into components when you create them or later, by using
set.
For example, the statement:
set(object_handle,'BackgroundColor',uis etcolor)
opens a color selector G U I for you to choose a color. When you click OK,it
returns an RGB color vector that
set assigns immediately. You get an error if
the object does n ot have a property with the specified name or if the specified
property does not accept RGB color values.
You can combine setting position and color into one line of code or one
function, for example:
btn1 = uicontrol('String', 'Button 1',...
'Position',getrect,...
'BackgroundColor',uisetcolor)
When you execute the statement, first getrect executes to let you set a
position using
rbbox. When you release the mouse button, the u isetcolor
GUI opens for you to specify a background color.
11-61