Function GraSetColor() Foundation
Determines default colors for all graphic functions.
GraSetColor( [<oPS>], ;
[<nForeground>], [<nBackground>] ) --> aOldColor
The function GraSetColor() returns an array containing the currently set foreground and background colors { nForegroundColor, nBackgroundColor }. If new colors are specified, the function returns an array containing the previous colors.
The function GraSetColor() determines the colors for all graphic primitives. In contrast to the function SetColor(), a numeric value is specified for the foreground and/or background with GraSetColor(). SetColor() defines colors for the VIO- or hybrid mode. For output using the graphic function in the hybrid or GUI mode, the color must be set using GraSetColor(). The function SetColor() has no effect on graphic functions.
The following table lists #define constants used to set the foreground and/or background colors:
Constant | Color |
---|---|
GRA_CLR_WHITE | White |
GRA_CLR_BLACK | Black |
GRA_CLR_BLUE | Blue |
GRA_CLR_RED | Red |
GRA_CLR_PINK | Pink |
GRA_CLR_GREEN | Green |
GRA_CLR_CYAN | Cyan |
GRA_CLR_YELLOW | Yellow |
GRA_CLR_DARKGRAY | Dark gray |
GRA_CLR_DARKBLUE | Dark blue |
GRA_CLR_DARKRED | Dark red |
GRA_CLR_DARKPINK | Dark pink |
GRA_CLR_DARKGREEN | Dark green |
GRA_CLR_DARKCYAN | Dark cyan |
GRA_CLR_BROWN | Dark brown |
GRA_CLR_PALEGRAY | Pale gray |
GRA_CLR_BACKGROUND | Background color of the presentation space |
GRA_CLR_NEUTRAL | Contrast color to GRA_CLR_BACKGROUND |
GraSetColor() defines the colors for the display of all graphic primitives. Any colors defined for specific graphic primitives before the call to GraSetColor() are removed.
The foreground color is the color used when drawing lines with graphic primitives. The background color is only visible when the color mix attribute has been changed for the background color (when it has a value other than GRA_BGMIX_LEAVEALONE).
If areas are filled with a pattern, the lines of the fill pattern are output in the foreground color and the space in between is in the background color. For characters, the character cell (GRA_AS_BOX) is output in the background color and the character itself in the foreground color. The exception is outline fonts where a character is drawn only as an outline. The areas within a character using such fonts are displayed in the background color.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.