Path: utzoo!attcan!uunet!lll-winken!ames!oliveb!apple!bloom-beacon!EXPO.LCS.MIT.EDU!converse From: converse@EXPO.LCS.MIT.EDU (Donna Converse) Newsgroups: comp.windows.x Subject: Re: Can't get color... Why? Message-ID: <8903301545.AA05055@expo.lcs.mit.edu> Date: 30 Mar 89 15:45:00 GMT References: <1730001@otter.hpl.hp.com> Sender: daemon@bloom-beacon.MIT.EDU Organization: X Consortium, MIT Laboratory for Computer Science Lines: 37 > I can have more than 3 different colors in two different windows, but > i can't have more than 3 different colors in a particular window (with > X10 or with X11). Does anyone know why? The ability to see colors in a window depends on 2 things: + The size of your colormap, and whether the colormap is writeable by client programs such as xchess. Use xdpyinfo to find out the size of your display's colormap and the visual types of the screen; then read about visuals in the Xlib doc. Know the characteristics of your display's visual types. + The client program's treatment of color. The program has two ways to allocate colors in the colormap: as writable cells or as read-only cells. If a client allocates a writable cell, no other client program can share that cell during the lifetime of the originally allocating client. If you have a colormap of size 16, client programs may quickly find that no more colors can be allocated. Other than issues of sharing colormap entries, there is no reason why a single window cannot display every color of the colormap simultaneously. > Moreover, when I run xchess (with X10 or with X11), it says that "it >can't get color..." and diplays a black and white window. That's >not the only graphic program that can't get color, and they sometime >alter the color of my other windows. Why? If it can't get color, it is doing the next best thing, which is black and white. No client can assume availability of color. As for altering the color of other windows, this can be caused by a client creating a colormap of it's own, and causing it to be installed, or, perhaps a client program is referencing an element of the colormap without having allocated it in any way; then another client program allocates that element of the colormap and changes the color definition of the cell.