Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Borland C++ 2.x ( with Turbo C ) - <b>setrgbpalette() set colors for ibm-8514 and vga 255 color mode</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 setrgbpalette()         Set Colors for IBM-8514 and VGA 255 Color Mode

 #include   <graphics.h>

 void far setrgbpalette(colornum, red, green, blue);
 int colornum;          Color number to set (0-255)
 int red;               Red value
 int green;             Green value
 int blue;              Blue value

        This function sets palette entry colornum to the values in red,
        green, and blue (only the lower six bits are used). This function
        also works for the VGA in 255-color mode.

    Returns:    Nothing.

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

    The following statements change color 1 in the VGA palette to strong
    red.

     #include <graphics.h>
     #include <stdlib.h>

     int main(void)
     {
        int gdriver = VGA, gmode = VGAHI;

        initgraph(&gdriver, &gmode, "");

        setrgbpalette(1, 63, 0, 0);

        getch();
        closegraph();
        return 0;
     }

See Also: setpalette()

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