[comp.windows.x] Quick way to get pixel from name

evmaster@sdrc.UUCP (System Interface Library) (05/11/89)

I need a quick way to get the pixel number of a named color.
Essentially, I need a version of XLookupColor that will fill
in the pixel field of the XColor structure upon return and
use some value like -1 if the named color isn't in the specified
color map. Is there a quick way to do this or will I have to 
traverse the colormap by hand (slow) ? I'm wanting to set the XtNbackground
field of an HP Widget. I know the name of the color I want but I need
the pixel value.

Thanks in advance.

rws@EXPO.LCS.MIT.EDU (05/11/89)

    I need a quick way to get the pixel number of a named color.

At the Xlib level, use XAllocNamedColor.  Within Xt, you can use String to
Pixel resource conversion.