Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <graph.h>
    short _FAR _setcolor( short pixval );

Description:
    The _setcolor function sets the pixel value for the current color to be
    that indicated by the pixval argument.  The current color is only used
    by the functions that produce graphics output; text output with
     _outtext uses the current text color (see the  _settextcolor function).
     The default color value is one less than the maximum number of colors
    in the current video mode.

Returns:
    The _setcolor function returns the previous value of the current color.

Example:
    #include <conio.h>
    #include <graph.h>

    main()
    {
        int col, old_col;

        _setvideomode( _VRES16COLOR );
        old_col = _getcolor();
        for( col = 0; col < 16; ++col ) {
            _setcolor( col );
            _rectangle( _GFILLINTERIOR, 100, 100, 540, 380 );
            getch();
        }
        _setcolor( old_col );
        _setvideomode( _DEFAULTMODE );
    }

Classification:
    PC Graphics

Systems:
    DOS, QNX

See Also:
    _getcolor, _settextcolor

See Also: _getcolor _settextcolor

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson