Programmatic use

If the color value of the Color Control is not to be linked directly to a symbol, it can be accessed programmatically instead. To set a color in the control, use the setColorValue function, either via JavaScript code or via the Actions and conditions dialog:

Programmatic use 1:
TcHmi.Controls.get("Background").setColorValue([0, 0, 255])

To query the color of the control, use the ReadOnly attribute ColorValue:

Programmatic use 2:

In JavaScript, the attribute must be retrieved using the getColorValue method:

const color = TcHmi.Controls.get("Background").getColorValue()