Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Microsoft C 6.0 - <b>_settextcolor() set the text color</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _settextcolor()         Set the text color

 #include   <graph.h>

 short far _settextcolor( pixel );
  short pixel;      Desired pixel value

    _settextcolor() sets the current text output color to the pixel value
    specified by pixel. The default text color is the same as the maximum
    pixel value. Pixel values from 0 to 15 will select the following
    colors for text:

    No.   Color                No.   Color
    ---   ---------------      ---   ---------------
     0    Black                 8    Dark gray
     1    Blue                  9    Light blue
     2    Green                10    Light green
     3    Cyan                 11    Light cyan
     4    Red                  12    Light red
     5    Magenta              13    Light magenta
     6    Brown                14    Yellow
     7    White                15    Bright white

    Pixel values from 16 to 31 correspond to the colors above,
    respectively, except they blink.

       Returns:     _settextcolor() returns the value of the previous
                    text color.

         Notes:     Text colors are not restricted to the current
                    palette, unlike the current color and current
                    background color.

   Portability:     MS-DOS only, true MDPA, CGA, EGA, MCGA, or VGA video
                    compatibles

 -------------------------------- Example ---------------------------------

    This program saves the current color, changes it, displays text, then
    restores the original color.

           #include <graph.h>

           main()
           {
              short oldcolor;

              oldcolor = _gettextcolor();
              _outtext( "This is the original color" );
              _settextcolor( oldcolor - 1 );
              _outtext( "This is the new color" );
              _settextcolor( oldcolor );
           }


See Also: _gettextcolor() _setcolor() _setbkcolor() _remappalette()

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