Xref: utzoo comp.windows.x:24489 comp.windows.x.motif:98 Path: utzoo!mnetor!tmsoft!torsqnt!news-server.csri.toronto.edu!cs.utexas.edu!usc!samsung!xylogics!bu.edu!snorkelwacker!paperboy!yee From: yee@osf.org (Michael K. Yee) Newsgroups: comp.windows.x,comp.windows.x.motif Subject: Re: Colormaps Message-ID: Date: 16 Jul 90 18:23:32 GMT References: <1990Jul13.183517.23734@media.uucp> Sender: news@OSF.ORG Organization: Open Software Foundation Lines: 68 In-reply-to: arthur@media.uucp's message of 13 Jul 90 18:35:17 GMT In article <1990Jul13.183517.23734@media.uucp> arthur@media.uucp (Art Poley) writes: > I am trying to implement a 256 element PseudoColor colormap under X/motif > for image processing applications. The palette will initially be linear > and via pseudocolor, contrast, and other imaging operations may be dynamically > altered. Using the calls XCreateColormap, XAllocColorCells, and XStoreColor > I have been able to create a linear mapping. I then use XSetWindowColormap > to associate this mapping to the toplevel application shell. Unfortunately, > the colors used by the window manager have been lost. > > Does anyone know how to preserve the colors used by the motif window manager > within my 256 element colormap? Basically, I would like to create a (256 - N) > element colormap. Where N would be the number of colors needed to preserve > the 3D-look, menus, etc. used by the mwm. Due to the dynamic nature of the > imaging colormap, sharing of colormaps does not seem like a good approach. > I'd really just assume that N out of my 256 are reserved for the window manager. > Hopefully N won't be to large (16 or less?). > What you are asking to do will not be easy. So, I'll answer the question you didn't ask. And that question is "How do I get the Motif window manager to allocate only TWO colors (i.e. foreground and background) for imaging applications)? The answer is set the following resources and restart Mwm. If you replace "black" and "white" with the colors you are using as your foreground and background colors, you should have 254 colors at your disposal. !! MWM 1.0 - MONOCHROME setup Mwm*cleanText: True Mwm*activeBackground: white Mwm*activeForeground: black Mwm*background: white Mwm*foreground: black Mwm*client*activeBackgroundPixmap: 50_foreground Mwm*client*activeTopShadowPixmap: foreground Mwm*client*activeBottomShadowPixmap: background Mwm*client*backgroundPixmap: 75_foreground Mwm*client*topShadowPixmap: foreground Mwm*client*bottomShadowPixmap: background Mwm*feedback*backgroundPixmap: 50_foreground Mwm*menu*backgroundPixmap: foreground Mwm*icon*activeBackgroundPixmap: 50_foreground Mwm*icon*activeBottomShadowPixmap: foreground Mwm*icon*backgroundPixmap: 75_foreground > If anyone has any suggestions, references, etc., I'd really appreciate it. > > Thanks! > > Art > -- Happy windowing, =Mike -- = Michael K. Yee =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- = OPEN Software Foundation -- 11 Cambridge Center -- Cambridge, MA 02142 = Phone: 617-621-8831 Email: yee@osf.org, uunet!osf.org!yee = "I can't give you brains, but I can give you a diploma." -- The Wizard of OZ