This is the mail archive of the
cygwin-xfree@cygwin.com
mailing list for the Cygwin XFree86 project.
Re: color depth and colored text in xterms
- To: Robert Jacobson <teridon at erols dot com>
- Subject: Re: color depth and colored text in xterms
- From: Alexander Gottwald <Alexander dot Gottwald at informatik dot tu-chemnitz dot de>
- Date: Tue, 20 Mar 2001 22:55:18 +0100 (MET)
- Cc: cygwin-xfree at sourceware dot cygnus dot com
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