colorGet()

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 colorGet() returns a blink or an RGB definition of a color from a desired colorDB file.

Synopsis

int colorGet(string fileName, string colorName, string &colorDefinition);

Parameters

Parameter Description
fileName The colorDB file whose blink or RGB definition is returned. The file path can be absolute or relative. If the file path is relative, the path proj_path/colorDB is used.
colorName The color whose blink or RGB definition is returned, for example, "myBlue".
colorDefiniton The returned blink or RGB definition, 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 colorGet() returns the blink and RGB definition of a color from a desired 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

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