---
title: "setColorPickerColor"
canonical: "https://help.vicon.com/space/ShogunPost121/1253737444/setColorPickerColor"
format: markdown
---
# Description

Sets the color value of the color picker user control that is specified by `userControlId`.

The second argument is a three element integer array, holding the Red, Green, and Blue components of the color to set on the control. Each component can range in value from 0 to 255.

## Functional area

User Window

# Command syntax

## Syntax

> Macro (scroll-tablelayout)

|  |
| --- |
| `setColorPickerColor userControlID colorIntArray` |

### Arguments

> Macro (scroll-tablelayout)

| Name | Type | Required | Comments |
| --- | --- | --- | --- |
| `intArray` | int_array | yes | Three element integer array holding the RGB color value to set on the control. |
| `userControlId` | int | yes | ID of user control to operate on. |

### Flags

None

## Return value

void

> Macro (scroll-pagebreak)

## Examples

```plaintext
// Set the color value of a Color Picker User Control
int $windowId; 
int $controlId;
int $color[3];
 
// First create a User Window to place the Controls on
$windowId = `createWindow "MyWindow"`;
 
// Create the User Control on the Window.
$controlId = `createColorPicker $windowId`;
 
// Set the default color to red
$color[ 0 ] = 255;
$color[ 1 ] = 0;
$color[ 2 ] = 0;
setColorPickerColor $controlId $color;
```

# Additional information

## Related commands

- [createColorPicker](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737103)
- [getColorPickerColor](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253736960)
- [setColorPickerHandler](https://vicon-help.atlassian.net/wiki/spaces/ShogunPost121/pages/1253737965)