Applies To:
  • CitectSCADA
  • VijeoCitect

Summary:
 When using some functions which enable you to specify colour preferences in the argument as an INT value, how can you actually get an integer colour code representation?

Specifying a hexadecimal number in the argument will produce a compile error. Neither can we just simply add the colour range available for RGB (red, green, blue) which spans from 0-255.

Taking CSV_Nav_File as an example, it requires the argument as follows:

CSV_Nav_File(sTitle,sFile,iMode,sFontName,iFontSize,iFontColour, iBackColour,iWordWrap);

In order to specify the font colour and background colour, we must get an INTEGER colour coded representation so that Citect understands which colour a user specified.

How can we get the integer colour coded representation?


Solution:
We can use MakeCitectColour() cicode function to get the colour coded representation.

MakeCitectColour(nRed,nGreen,nBlue);

You will then need to provide the RGB value (0-255) to get your colour preference and the cicode function will produce the INT colour coded representation for any functions that need it as an argument.

Keywords:
 colour, rgb, hexadecimal, colour code, representation, CSV_Nav_File, CSV, citect colour

Attachments