rem: int		width, height, x, y; RColor			color = *((RColor *)WMGetListItem(lPtr, index)->clientData); WMScreen		*scr = WMWidgetScreen(lPtr); Display			*dpy = WMScreenDisplay(scr); RImage			*image; WMPixmap		*pixmap; int				i, j;
add: int        width, height, x, y; RColor            color = *((RColor *)WMGetListItem(lPtr, index)->clientData); WMScreen        *scr = WMWidgetScreen(lPtr); Display            *dpy = WMScreenDisplay(scr); RImage            *image; WMPixmap        *pixmap; int                i, j; W_ColorPanel    *panel = WMGetHangedData(lPtr); WMColor            *white = WMWhiteColor(scr); WMColor            *black = WMBlackColor(scr);  width = rect->size.width; height = rect->size.height; x = rect->pos.x; y = rect->pos.y;  if (state & WLDSSelected) XFillRectangle(dpy, d, WMColorGC(white), x, y, width, height); else XClearArea(dpy, d, x, y, width, height, False);  image = RCreateImage(15, 15, False); for (i=0; i < 15 ; i++) { for (j=0; j < 15; j++) { image->data[0][j*15+i] = color.red; image->data[1][j*15+i] = color.green; image->data[2][j*15+i] = color.blue; } }  pixmap = WMCreatePixmapFromRImage(scr, image, 0); RDestroyImage(image); WMDrawPixmap(pixmap, d, x, y); WMReleasePixmap(pixmap); WMDrawString(scr, d, WMColorGC(black), panel->font12, x+18, y, text, strlen(text));
context: colorListPaintItem(WMList *lPtr, int index, Drawable d, char *text, int state, WMRect *rect){	int		width, height, x, y;	RColor			color = *((RColor *)WMGetListItem(lPtr, index)->clientData);	WMScreen		*scr = WMWidgetScreen(lPtr);	Display			*dpy = WMScreenDisplay(scr);	RImage			*image;	WMPixmap		*pixmap;	int				i, j;	width = rect->size.width;	height = rect->size.height;	x = rect->pos.x;	y = rect->pos.y;		if (state & WLDSSelected)		XFillRectangle(dpy, d, WMColorGC(WMWhiteColor(scr)), x, y, width, height);	else		XClearArea(dpy, d, x, y, width, height, False);		image = RCreateImage(15, 15, False);	for (i=0; i < 15 ; i++) {		for (j=0; j < 15; j++) {			image->data[0][j*15+i] = color.red;			image->data[1][j*15+i] = color.green;			image->data[2][j*15+i] = color.blue;		}	}		pixmap = WMCreatePixmapFromRImage(scr, image, 0);	RDestroyImage(image);	WMDrawPixmap(pixmap, d, x, y);	WMReleasePixmap(pixmap);	WMDrawString(scr, d, WMColorGC(WMBlackColor(scr)), globalFont, x+18, y, text, strlen(text));}