'Fill' / 'Color' Dynamics
The 'Fill'/'Color' dynamics change the fill, fill when down, line or font color property of the object. Depending on the variable type linked to the dynamic, the color changes based on:
- the two variable states FALSE and TRUE with associated fill types and line colors (in case of a Boolean variable or an expression that evaluates to a Boolean result)
or - a list of threshold values with associated fill types and line colors (in case of a numeric variable or an expression that evaluates to a numeric value). The color associated to a threshold is applied when the value of the variable is in the respective value range.
Note
The 'Fill' dynamic is disabled for an object, if the object has a 'Blink' dynamic assigned. (See below how to enable blinking for the object's color.) |
Example 1: color depends on Boolean variable
Example 2: color depends on numeric variable
To change a color, click the color button and select a color from the color selection drop-down list. Double-clicking the color cell opens the 'Color Configuration' dialog providing the ability to configure a new color or select an existing color.
To add a threshold to the threshold table, click the button below the table. To enter a threshold value, click the 'Threshold' cell and type the value or select it using the arrow buttons. To delete a threshold, select it and click the
button.
Interpolation
In case of a linked numeric variable, the displayed colors can be interpolated by marking the 'Interpolate' checkbox. If checked, the displayed color is linearly interpolated between the specified colors when the variable value is between two threshold values.
For example, the settings shown in the figure below (here 'Interpolate' is activated) produces the following fill colors depending on the current variable value:
Variable value | Fill color ('Interpolate' activated) | Fill color ('Interpolate' deactivated) |
---|---|---|
value <= 0 | Red | Red |
0 < value < 50 | Color is linearly interpolated between red and green. | Red |
value = 50 | Green | Green |
50 < value < 100 | Color is linearly interpolated between green and blue. | Green |
value >= 100 | Blue | Blue |
Blink rate
With the 'Blink rate' parameter you can enable the blinking of the object's fill/font color. With enabled blinking, the color of the object blinks from the current visible color defined on the HMI page to the set color if the condition of the variable is fulfilled (in case of a Boolean variable) or the variable value is in the set value range (in case of a numeric variable or an expression that evaluates to a numeric value).
To enable blinking of the object's color:
- Select the desired blink interval from the 'Blink rate' selection list (default setting is 'None').
If the 'Blink rate' is set to anything other than 'None', a 'Blink' checkbox is added for each condition (in case of a Boolean variable or an expression that evaluates to a Boolean result) or threshold (in case of a numeric variable or an expression that evaluates to a numeric value). - Select the checkboxes for the conditions/thresholds for which you want enable blinking.In the example above, the button blinks from grey (current background color) to green at the medium blink rate when the value of the variable 'RealVar' is in the range 1 <= value < 2 and from grey to blue when the value is between 3 <= value < 4.