<div class="meta" robots="noindex">

</div>

Method

# SelectColor

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

<div class="warning">

<div class="title">

Warning

</div>

This item was deprecated in version 2019r2. Please use `Color.SelectedFromDialog<color.selectedfromdialog>` as a replacement.

</div>

## Description

Displays the system Color Picker, allowing the user to choose a color.

## Usage

result = **SelectColor**(`ByRef</api/language/byref>` *col*, *prompt*)

| Part   | Type                               | Description                                                                                                 |
|--------|------------------------------------|-------------------------------------------------------------------------------------------------------------|
| result | `Boolean</api/data_types/boolean>` | Returns `True</api/language/true>` if the user clicks OK; `False</api/language/false>` if the user cancels. |
| col    | `Color</api/data_types/color>`     | `Color</api/data_types/color>` passed to **SelectColor** and the color the user selects.                    |
| prompt | `String</api/data_types/string>`   | Prompt to be displayed in the Color Picker. **Shown only on Linux.**                                        |

## Notes

You control the default choice of color displayed by the Color Picker by passing a value of col to <span class="title-ref">SelectColor</span>. If col is not assigned a value, black is used as the default color. The color that the user chooses is returned in col. If the user clicks Cancel without making a choice, result is set to `False</api/language/false>`; otherwise it is set to `True</api/language/true>`.

## Sample code

The following example allows the user to select a color that will be used as the fillcolor in a `Rectangle</api/deprecated/rectangle>` control.

``` xojo
Dim c  As Color
Dim b As Boolean
c = CMY(0.35, 0.9, 0.6) ' choose the default color shown in color picker
b = SelectColor(c, "Select a Color")
Rectangle1.FillColor = c
```

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

If you don't want to test the boolean returned by <span class="title-ref">SelectColor</span>, you can call it using `Call</api/language/call>`.

``` xojo
Call SelectColor(c, "Select a Color")
```

## Compatibility

All project types on all supported operating systems.

## See also

`Color</api/data_types/color>` data type; `Color.CMY<color.cmy>`, `Color.RGB<color.rgb>`, `Color.HSV<color.hsv>` functions; `&c</api/language/literals/c>` literal.
