To change the current foreground color, use GpiSetColor. As input, the application supplies either the index to the required color in the current logical color table or the RGB value of the color, depending on the mode of the table. Color indexes higher than those supplied in the default color table must be loaded explicitly before they can be used.
It is possible to specify one of the system colors (for example, SYSCLR_ACTIVEBORDER) as the current foreground (or background) color of a primitive. The color appears as defined in the system color table, and the logical color table is not used.
The specified color becomes the current color, and the foreground of any primitive drawn subsequently is drawn in that color. The current foreground color for a particular primitive type is set by calling GpiSetAttrs. For example, if an application sets the current foreground color to CLR_RED by calling GpiSetColor, and sets the current foreground color for marker primitives to CLR_CYAN by calling GpiSetAttrs, all subsequent markers are cyan, and all other primitives are red.
To change the current primitive background color, call GpiSetBackColor. To ensure that this color is different from the background color of the output area (so that the entire primitive background is visible), the current window background color must not be the same as the current primitive background color. Also, select an appropriate background mix attribute.
GpiQueryBackColor returns the current background color setting for a character primitive. To learn the current foreground color setting, use GpiQueryColor. GpiQueryAttrs can be used to determine the current foreground and background color values for a single primitive type.