Re: Q: about RGB values of vga_setcolor() colors

Search this archive.

From: Jay Link (jlink@ilbbs.com)
Date: Thu 29 Nov 2001 - 06:54:44 IST


> Are there any functions to get rgb values of these 16 basic colors is my
> question, I guess. (or a way to decode gl_getpixelrgb() when using these?)

I hacked this a while ago, using vga_setcolor() and vga_drawpixel() to put
the 16 basic colors on the screen, and then gl_getpixelrgb() to read the
RGB values. Be sure to call gl_setrgbpalette() first.

Here are the values I came up with:

0  = 0, 0, 0         // black
1  = 0, 0, 170       // blue
2  = 0, 170, 0       // green
3  = 0, 170, 170     // cyan
4  = 170, 0, 0       // red
5  = 170, 0, 170     // magenta
6  = 170, 85, 0      // brown
7  = 170, 170, 170   // grey
8  = 85, 85, 85      // dark grey (light black)
9  = 85, 85, 255     // light blue
10 = 85, 255, 85     // light green
11 = 85, 255, 255    // light cyan
12 = 255, 85, 85     // light red
13 = 255, 85, 255    // light magenta
14 = 255, 255, 85    // yellow (light brown)
15 = 255, 255, 255   // white (light grey)



-J


------------------------------------------------------------------
Unsubscribe:  To:   listbot@svgalib.org
              Body: unsubscribe linux-svgalib


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:24 IST