Graphics Function: Sets the current graphics color index.
Module: USE DFLIB
Syntax
Results:
The result is of type INTEGER(2). The result is the previous color index if successful; otherwise, -1.
The SETCOLOR function sets the current graphics color index, which is used by graphics functions such as ELLIPSE. The background color index is set with SETBKCOLOR. The color index of text over the background color is set with SETTEXTCOLOR. These non-RGB color functions use color indexes, not true color values, and limit the user to colors in the palette, at most 256. For access to all system colors, use SETCOLORRGB, SETBKCOLORRGB, and SETTEXTCOLORRGB.
Compatibility
STANDARD GRAPHICS QUICKWIN GRAPHICS LIB
See Also: SETCOLORRGB, GETCOLOR, REMAPPALETTERGB, SETBKCOLOR, SETTEXTCOLOR, SETPIXEL, SETPIXELS
Example
USE DFLIB
INTEGER(2) color, oldcolor
LOGICAL status
TYPE (windowconfig) wc
status = GETWINDOWCONFIG(wc)
color = wc%numcolors - 1
oldcolor = SETCOLOR(color)
END