colorSetAlias()

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 colorSetAlias() specifies an alias for a color in a colorDB file.

Synopsis

int colorSetAlias(string fileName, string alias, string colorName);

Parameters

Parameter Description
fileName The colorDB file that contains the color for which the alias is specified. The file path can be absolute or relative. If the file path is relative, the path proj_path/colorDB is used.
alias The alias that is specified for a color.
colorName The name of the color for which an alias is specified.

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 colorSetAlias() defines an alias for a color.

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

Creates an alias "alias1" in the color database (schema) "myColorDB". The "alias1" points to the color "myBlue".

main()
{
   int j;
   j = colorSetAlias("myColorDB", "alias1", "myBlue");
   int i;
   string colAlias;
   i=colorGetAlias("myColorDB", "alias1", colAlias);
   DebugN("colorGetAlias:",i );
   DebugN(colAlias);
}

Assignment

Miscellaneous functions

Availability

UI