answer color

Typecommand
DictionaryLCS
LibraryLiveCode Script
Syntax
answer color [with <startingColor>]
Summary

Displays the operating system's standard color-selection dialog box.

Introduced1.1
Changes

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

OSmac, windows, linux
Platformsdesktop
Parameters
NameTypeDescription
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.
Example
answer color
if theItem is "Custom Color..." then answer color
answer color with "#FF0033"
answer color with "AliceBlue"
Values
NameTypeDescription
It

The color the user chooses is placed in the it variable.

The result

If the user cancels the dialog, the it variable is set to empty, and the result function returns "Cancel".

RelatedKeyword: it
Property: systemColorSelector, backgroundColor, colors, foregroundColor
Command: answer
Function: result, colorNames
Control Structure: function
Glossary: dialog box, variable, command, return, color reference
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.

Tagsui