Name: answer color

Type: command

Syntax: answer color [with <startingColor>]

Summary:
Displays the operating system's standard color-selection <dialog box>.

Introduced: 1.1

OS: mac, windows, linux

Platforms: desktop

Example:
answer color

Example:
if theItem is "Custom Color..." then answer color

Example:
answer color with "#FF0033"

Example:
answer color with "AliceBlue"

Parameters:
startingColor:
A <color reference> in one of the following forms:

-  a standard color name
-  three comma-separated integers between zero and 255, specifying the
   level of each of red, green, and blue
-  an HTML-style color consisting of a hash mark (#) followed by three
   hexadecimal numbers, one for each of red, green, and blue.


It:
The color the user chooses is placed in the <it> <variable>.

The result:
If the user cancels the <dialog box|dialog>, the <it> <variable> is set
to empty, and the <result> <function> <return|returns> "Cancel".

Description:
Use the <answer color> <command> to select a custom color.

The <answer color> <command> displays a <dialog box> where the user can
select a color. (This <dialog box> is displayed by the operating system,
not by LiveCode.)

If you specify a <startingColor>, the <dialog box> displays that color by
default. 

The color is returned in the form of three comma-separated integers
between zero and 255, specifying the level of each of red, green, and
blue. This format can be used directly to set any color property.

Changes:
The option to specify a startingColor was introduced in version 1.1.1.
In previous versions, the dialog box displayed white by default.

References: answer (command), function (control structure),
result (function), colorNames (function), dialog box (glossary),
variable (glossary), command (glossary), return (glossary),
color reference (glossary), it (keyword), systemColorSelector (property),
backgroundColor (property), colors (property), foregroundColor (property)

Tags: ui

