Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!malgudi!sunc.osc.edu!jeff From: jeff@osc.edu (Jeff Faust) Newsgroups: comp.windows.x Subject: Special Colormap Allocation Keywords: colormap dither XAllocCOlor Message-ID: <1393@oscsunb.osc.edu> Date: 15 Feb 91 17:15:13 GMT Organization: Ohio Supercomputer Center, Columbus, OH, USA Lines: 23 I have a graphics application which needs to allocate many colors in the colormap in order to do quality shading. Specifically, 245 colors are used for a special dithering algoritithm, 8 colors are used for user interface colors, and the other 3 are leftover (assuming 256 colors). I use a pretty good scheme now, but users still complain about the colormap shifting when moving between applications. I could greatly reduce the colormap shifting if I could examine carefully the default colormap and try to match colors already allocated there to similiar colors in my dithering colormap. In otherwords if there is a red in the default colormap with a pixel value of 4, I would place a red in my colormap at the pixel value of 4 as well. Unfortunately, X11 seems to overlook this desire and it seems impossible (in a portable fashion) to determine which colors are already allocated in the default colormap. XAllocColor() and XAllocColors() come close but there is now way to detect unallocated colors from alloced colors. I don't want my code to bother to match what are garbage values in the colormap. Does anyone have any ideas about how to improve this situation? Thanks: Jeff Faust jeff@totem.osgp.osc.edu