rem: int 	rmask, gmask, bmask; int 	rshift, gshift, bshift;
add: XColor	*xcolor = NULL;  if (!(xcolor = wmalloc(sizeof(XColor)) )) { wwarning(NO_MEMORY_ERR); color.red = 0; color.green = 0; color.blue = 0; return color; }  xcolor->pixel = value; XQueryColor(scr->display, scr->rcontext->cmap, xcolor);
context: ulongToRColor(WMScreen *scr, XImage *image, unsigned long value){    RColor	color;    int 	rmask, gmask, bmask;    int 	rshift, gshift, bshift;    if (scr->rcontext->depth == image->depth) {	rmask = scr->rcontext->visual->red_mask;	gmask = scr->rcontext->visual->green_mask;	bmask = scr->rcontext->visual->blue_mask;    } else {	rmask = image->red_mask;	gmask = image->green_mask;	bmask = image->blue_mask;    }    rshift = get_shifts(rmask) -8;	/* -8 because otherwise the byte */    gshift = get_shifts(gmask) -8;	/* containing the color would be */    bshift = get_shifts(bmask) -8;	/* shifted over the edge.	 */    color.red   = (rshift > 0) ? (value & rmask) >> rshift : 	(value & rmask) << -rshift;    color.green   = (gshift > 0) ? (value & gmask) >> gshift : 	(value & gmask) << -gshift;    color.blue   = (bshift > 0) ? (value & bmask) >> bshift : 	(value & bmask) << -bshift;    return color;}