color depth and colored text in xterms

Alexander Gottwald Alexander.Gottwald@informatik.tu-chemnitz.de
Sun Apr 1 00:00:00 GMT 2001


Hello Robert,

you wrote:
> 1)  The colors seem to be okay in 8-bit color.  Can someone tell me 
> why colors work okay in 8-bit, but not in "deeper" screens?
> 
In 8 bit color depth, a palette is used. This means all 256 colors
are alocated in the XServer. Whenever an application requests a color
(eg. #ffff00, which is yellow), the XServer returns an index for the palette
which points to a color close to the requested. All later painting uses
only this index.
in 16 bit mode, the pixel value is calculated from the color values for red,
green and blue. I believe the pixel value is constructed by using the most
significant 6bit from the blue value and 5bit from the green and red value.
This pixel value is then written to memory of the videocard. The DAC of the
Videocard converts this value back to analoque signals for the CRT. But the
back conversion will use 5bit for blue and green and 6 bit for red. I'm sure
this difference causes the problem in 16 and 32 bit. 
24 bit mode should be optimal since the conversion is quite simple here. 

I think, i should take a look at the sources, to find out what really
happens in the XServer.

cu
    ago

-- 
Alexander.Gottwald@informatik.tu-chemnitz.de
http://www.gotti.org
+49 3725 3498080



More information about the Cygwin-xfree mailing list