# include "Ximage.h"

/************** GetColor *************/
unsigned long 
GetColor (display, name, colormap, default_color)
Display  *display;
char      name[];
Colormap  colormap;
unsigned long default_color;
{

  unsigned long color;
  XColor rgbcolor, hardwarecolor;
  int status;

  color = default_color;
  status = XLookupColor (display, colormap, name, &rgbcolor, &hardwarecolor);
  if (status) {
    status = XAllocColor (display, colormap, &hardwarecolor);
    if (status) {
      color = hardwarecolor.pixel;
    }
  }
  return (color);
}
