When creating mimic parameters it is often desirable to add a default value. This default value is just a 'value', not an expression.
When creating a "ViewXColour" parameter, you cannot enter 'RGB( 0, 0, 255)' for example as this would normally be an expression. This will be evaluated as a string value of 'RGB( 0, 0, 255)' which would then return a Type Mismatch if used in a color animation. You should specify the color as a number e.g. 16711680 (0xFF0000) for blue.
To determine the decimal value of a color takes a few steps but is fairly simple.
- The first step is to find the RGB values of the color you require. These values can be obtained from the advanced color palette within ClearSCADA. In the example below, the RGB values are 51, 208 and 47.
- Once you have the RGB values, convert them to hex and reverse append them. (Converting these numbers can be done using the Windows Calculator).
- Now convert the number from hex to decimal.
- This is the value that should be entered for the parameters default value.
For example, we will convert a green color into its decimal format for the color parameter.
The RGB color number for the green chosen is (128,255,128). The hex conversion for 128 is 80 and for 255 is FF. Reverse appending the numbers gives us 80FF80. Converted to decimal, this gives our color parameter default value of 8454016.
If you want to 'build' a color for ClearSCADA, which can also be used with SQL, then you can use this method.
For example to create the colour with these three numbers:
Red = 10
Green = 20
Blue = 30
Your application needs to use the expression/number like this:
(10 + 20*256 + 30*256*256)
So just substitute 10,20,30 with your Red, Green and Blue decimal values.