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:
TcHmi.Controls.get("Background").setColorValue([0, 0, 255])
To query the color of the control, use the ReadOnly attribute ColorValue
:
In JavaScript, the attribute must be retrieved using the getColorValue
method:
const color = TcHmi.Controls.get("Background").getColorValue()