Color string

Differentiates between static and dynamic colors. Static colors do not change the color, whereas dynamic colors constitute a flashing pattern. Of course static colors can still be changed. Rapid periodic color changes are best realized with dynamic colors, however, which do not require any object Redraw.

Color names

Colors and flashing patterns can be assigned names in the color selector of the GEDI module. These can be used in Control scripts as color strings in place of the forms described in the following sections.

Example

"Red" can, for example, be used instead of "{255,0,0}".

Static color string

Syntax

"{R,G,B}"

A static color is defined by its RGB value (Red, Green, Blue). The intensity of each separate color component is specified by a number between 0 and 255: "0" means no intensity, "255" full intensity. Furthermore you can also use the "old" notation:

Syntax

"[R,G,B]"

The intensity of each separate color component is specified by a number between 0 and 100: "0" means no intensity, "100" full intensity.

Example

"{255,0,0}"// Red
"{0,255,0}" // Green
"{0,0,255}" // Blue
"{0,0,0}" // Black
"{255,255,255}" // White
"[100,40,20]" // Orange

Transparency

You can also specify an alpha value (transparency) for a color in WinCC OA. The alpha value is defined as follows:

{r,g,b[,alpha]}

Define an alpha (transparency) value between 0..255 (0=transparent, 255=opaque).

The following example sets the color "ETM" (0,153,153) and the alpha value 123.

main()
{
  setValue("ELLIPSE1","backCol","{0,153,153,123}");
}

Dynamic color string

The dynamic color string defines a flashing pattern. WinCC OA supports up to six flashing colors per pattern. The flash rate can be set for each flashing color in intervals of eighths of a second between zero and one second. The full sequence of RGB and time data is enclosed in angle brackets (greater than and less than signs). The syntax is made up of six or less static color strings and the flash periods.

Syntax

 "<[R1,G1,B1],T1,[R2,G2,B2],T2,[R3,G3,B3],T3,[R4,G4,B4],T4,[R5,G5,B5],T5,[R6,G6,B6],T6>"

Example

Red-green flashing at 1/4 second intervals for the foreground color of the object named "Object1":

main()
{
  setValue("Object1", "foreCol", "<[100,0,0],2,[0,100,0],2,[0,0,0], 0,[0,0,0],0,[0,0,0],0,[0,0,0],0>");
}

White-black-grey flashing at intervals of 3/8, 1/8 and 1/8 of a second for the background color of the object named "Object1":

main()
{
  setValue("Object1","backCol","<{255,255,255},3,{0,0,0},1,{192,192,192},1,{0,0,0},0,{0,0,0},0,{0,0,0},0>");
}

In addition the syntax for dynamic colors allows to only specify the used blink sequences, for example,"<_ETM,4,{153,51,148},4>" where only the first 2 sequences are used.

main()
{
  setValue("ELLIPSE1","backCol","<_ETM,4,{153,51,148},4>");
}