colorRemove()

A color scheme is a collection of colorDB files located in a subdirectory of proj_path/colorDB, for example, proj_path/colorDB/DayScheme/colors. Hence, the name of the schema is "DayScheme" - the name of the directory. The function "colorRemove" deletes a color or alias definition from a colorDB file.

Synopsis

int colorRemove(string fileName, string colorName);

Parameters

Parameters Meaning
fileName The colorDB file that contains the color to be deleted. The file path can be absolute or relative. If the file path is relative, the path proj_path/colorDB is used.
colorName Name of the color or alias that is deleted.

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 "colorRemove" deletes a color or alias definition from a 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/scheme1. The function "colorGet" returns the RGB definition of the color "myBlue" from the file "std".

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

Deletes the color "myBlue" from the colorDB file ("std").

main()
{
  int i;
  i = colorRemove("scheme1/std", "myBlue");
}

Assignment

Miscellaneous functions

Availability

UI