FANDOM


Displays the operating system's standard color-selection dialog box, in order to select a color. (This dialog box is displayed by the operating system, not by LiveCode.)

Syntax:

answer color [with startingColor]

OS supported: mac,windows,linux

Examples:

answer color
answer color with "#FF0033"
answer color with "AliceBlue"


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

startingColor is 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 user choice is in the result or it variable.

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

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.

See also:systemColorSelector (property), backgroundColor (property), colors (property), foregroundColor (property), answer (command), colorNames (function)