colorSet()

A color scheme is a collection of colorDB files located in a subdirectory of proj_path/colorDB, for example, WinCC_OA_proj_path/colorDB/DayScheme/colors. Hence, the name of the schema is "DaySchema" - the name of the directory. The function colorSet() specifies a color in the specified colorDB file.

Synopsis

int colorSet(string fileName, string colorName, string colorDefinition);

Parameters

Parameter Description
fileName The colorDB file name. The specified color is defined in this colorDB file. The file path can be absolute or relative. If the file path is relative, the path proj_path/colorDB is used.
colorName The color name that is specified in the file, for example, "myBlue".
colorDefinition The definition of the color that is specified, for example, "{0, 0, 244}".

Return Value

In case of error -1. Otherwise 0.

Errors

Missing or wrong arguments.

Description

A color scheme is a collection of colorDB files located in a subdirectory of proj_path/colorDB, for example, WinCC_OA_proj_path/colorDB/DayScheme/colors. Hence, the name of the schema is "DaySchema" - the name of the directory. The user interface loads all colorDB files and additionally all colorDB files from the active color schema. Hence, you can overload colors by using a color schema. The function colorSet() specifies a color in the specified colorDB file.

Note that in order to use the function, open the UI in the -extend mode. Furthermore, the function cannot be used in a second UI simultaneously since the color database is locked for writing (the error message "Read only colorDB“ is shown).

Example

The function "colorSet" sets the color with the name "myBlue" in the file "std" in the directory <project_path>/colorDB/. The function "colorGet" returns the RGB definition of the color "myBlue" from the file "std".

main()
{
  string colDef;
  colorSet("std", "myBlue", "{0, 0, 244}");
  colorGet( "std", "myBlue", colDef);
  DebugN(colDef);
}

Assignment

Miscellaneous functions

Availability

UI