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

Search this archive.

From: gaw zay (gauze@rifug.org)
Date: Thu 29 Nov 2001 - 19:38:41 IST


On Thu, 29 Nov 2001, Ryan Rubley wrote:

> vga palette registers are 6bit (0-63)
> just <<2 or *4 the results if you need to

I'm not sure if this will work, if r,g,b set by gl_getpixelrgb
didn't seem to set the r to anything but 0?

so it r g b are         xxxxxxxx xxxxxxxx xxxxxxxx
and 6 bits would fit in       xx xxxxxxxx xxxxxxxx

but the r bits are never set, ever it seemed.
even if I shifted the last 2 bits off 'b' and pushed into small side of
'g' and shifted the 2 bits of overflow into 'r' and 'padded' the top of
'r' it still doesn't look right to me. so you end up with

00xxxxxx 00xxxxxx 00xxxxxx
    ^^^^       ##

# = shifted from 'b'
^ = shifted from 'g'

 <<6 obviously will not make 'b' what you want, either.

or am I just making a bunch of stuff up? :-)

if the vga palette registers are returned by another function please
educate me!

brian

------------Rhode Island Free Unix Group----------
http://www.rifug.org
mailto:gauze@rifug.org


------------------------------------------------------------------
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