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>_gettextcolor() get current text color</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 _gettextcolor()         Get current text color

 #include   <graph.h>

 short far _gettextcolor( void );

    _gettextcolor() gets the pixel value of the current text output
    color. The default text color is the same as the maximum pixel value.

       Returns:     _gettextcolor() returns the value of the current text
                    color. Pixel values from 0 to 15 represent 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.

         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: _settextcolor() _getcolor() _getbkcolor() _remappalette()

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