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,web

Example:
answer color

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

Example:
answer color with "#FF0033"

Example:
answer color with "AliceBlue"

Parameters:
startingColor (enum): A color reference consisting of one of the following:
-  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.

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

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

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: systemColorSelector (property), backgroundColor (property), colors (property), foregroundColor (property), it (keyword), answer (command), result (function), colorNames (function), dialog box (glossary), variable (glossary), command (glossary), return (glossary), function (control_st)

Tags: ui
