#include "GraphP.h"


/* Programmed by Dan Bennett                                        */
/* Property of Kent State University                                */

unsigned long MakeColor(wid,name)
GraphWidget   wid;
char          *name;
{
    XColor   exact,close;
    Display  *disp;
    Screen   *scrn;
    int      scrnnum;

    disp = XtDisplay(wid);
    scrnnum = XDefaultScreen(disp);
    scrn = XScreenOfDisplay(disp,scrnnum);

    if (XLookupColor(disp,wid->core.colormap,name,&exact,&close) == 1) {
        if(XAllocColor(disp,wid->core.colormap,&exact))
            return(exact.pixel);
        else
            return(wid->graph.foreground);
        }
    else
        return(wid->graph.foreground);
}
