Path: utzoo!attcan!uunet!husc6!bloom-beacon!EXPO.LCS.MIT.EDU!rws From: rws@EXPO.LCS.MIT.EDU Newsgroups: comp.windows.x Subject: Re: Using Colors in the X environment Message-ID: <8907022033.AA05964@expire.lcs.mit.edu> Date: 2 Jul 89 20:33:01 GMT References: <8906212236.AA27410@sun.com> Sender: daemon@bloom-beacon.MIT.EDU Organization: The Internet Lines: 27 Application draws three partially overlapping polygons (red, green, blue) with an 'OR' operator. Want the overlapping regions to exhibit the correct color (eg: color==white, where the 3 polygons overlap) for this 'OR' operation, that is the requirement is for particular pixels to represent particular rgb values (upto 64 such "OR-predictable" values may be required in this particular case). Donna Converse has given you one scheme for this, if direct server support of read-only allocation is required. XAllocColorCells will do what you want, if you're willing to give up on the read-only constraint. You want npixels set to one, and nplanes set to however many independent OR bits you need. For your application, you should be able to specify contig as False. As nplanes approaches the depth of the window, of course, the request is likely to fail, and you may have to create your own colormap. In other parts of the application, don't care which pixel represents the desired color values (for menus and such), but preferably want to use shared pixel allocation to minimize color-cell consumption. There's no server support for this if you use AllocColorCells, you'd have to do it yourself by maintaining a mapping on the client side. What you might be fishing for is either a mechanism to turn a read-write cell into a read-only one, or a request like AllocColorCells that takes the RGB values and returns read-only cells.