### Changing a String's Text Color

Using the RGB Function

The Reporting expression language lets you use a RGB function to define an RGB (Red Green Blue) color value and apply it to a string of characters in expression text. This function takes four parameters, a string parameter, followed by comma separated RGB parameters, like this:

=RGB(string,R,G,B)

If you type this function in the Cell Expression box (or cell) of the GridControlObject, click OK, and then click outside of the object, PC-DMIS evaluates the expression and gives the text the specified color value.

Cell Expression box showing the RGB expression

For example, if you type this expression into a cell,

=RGB("Blue Text",0,0,255) + RGB(" Black Text",0,0,0) + RGB(" Yellow Text",255,255,0)

then the words would look like this in a template editor:

Using the Color Function

The Color function takes two parameters. The first, a color parameter, is actually a number that represents one of the principle Edit window colors. The second, is the string value to which PC-DMIS applies the color.

=COLOR(1, "My Text")

The first parameter is a value of 1 to 4 and passes the Edit window color that associated with the following:

1 passes the Marked Color

2 passes the Unmarked Color

3 passes the Step Mode Color

4 passes the Error Color

These colors are defined in the Edit window's Color Editor dialog box. See "Defining Edit Window Colors" in "Setting Your Preferences" for information.