Search.../

color

Sets or gets an element's color.

Description

Retrieve or update the displayed color in the panel element's color picker section. The color property supports basic named colors, RGB, and hexadecimal code formats.

Note: Changing an element's color in code triggers an onColorChange() event.

Type:

stringRead & Write

Was this helpful?

Get an element's color value

Copy Code
1let color = $w("#myElement").color; // "#008000"
Set an element's color value (RGB)

Copy Code
1$w("#myElemet").color = "rgb(0,128,0)";
Set an element's color value (Standard named colors)

Copy Code
1$w("#myElemet").color = "aqua";