Name
ColorRequest -- prompt the user to select a color (V5.0)
Synopsis
ret = ColorRequest(title$[, color])
Function
This command pops up color requester prompting the user to select a color from a palette of predefined colors. Additionally, the user can also mix a custom color. The first argument specifies the title of the color requester's dialog window. The second argument is optional and can be used to specify a color that is initially selected. If you do not specify the optional argument, a random color will be preselected.

The color selected by the user will be returned in RGB format. If the user cancels the request, -1 will be returned.

Please note that this command requires reqtools.library to be installed on AmigaOS and compatibles.

Starting with Hollywood 6.0 you can pass an empty string ("") in the first parameter. In that case, the requester will use the title specified in the @APPTITLE preprocessor command.

Inputs
title$
title for the requester
color
optional: color that shall be initially selected (in RGB format)
Results
ret
the user's selection or -1 if the user cancelled the requester
Example
r = ColorRequest("Select a color")
If r = -1
  Print("Requester cancelled!")
Else
  SetFillStyle(#FILLCOLOR)
  Box(0, 0, 640, 480, r)
EndIf
Ask the user for a color and then draws a filled rectangle using the selected color.

Show TOC