SETCOLOR (W*32, W*64)

Graphics Function: Sets the current graphics color index.

Module: USE IFQWIN

Syntax

result = SETCOLOR (color)

color
(Input) INTEGER(2). Color index to set the current graphics color to.

Results

The result type is 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, Building Applications: Color Mixing, Building Applications: Setting Figure Properties, Building Applications: Using Color, Building Applications: VGA Color Palette

Example

 USE IFQWIN
 INTEGER(2) color, oldcolor
 LOGICAL status
 TYPE (windowconfig) wc

 status = GETWINDOWCONFIG(wc)
 color = wc%numcolors - 1
 oldcolor = SETCOLOR(color)
 END