rem: W_Screen	*scr = WMWidgetScreen(panel->win); RColor		**colors = NULL; RHSVColor	hsvcolor; RImage		*sliderImg; WMPixmap	*sliderPxmp; int			i;  hsvcolor = panel->hsvcolor;  colors = malloc(sizeof(RColor*)*(8)); for (i=0; i<7; i++) { hsvcolor.hue = (360*i)/6; colors[i] = malloc(sizeof(RColor)); RHSVtoRGB(&hsvcolor, colors[i]); } colors[7] = NULL;  sliderImg = RRenderMultiGradient(141, 16, colors, RGRD_HORIZONTAL); sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0); RDestroyImage(sliderImg); if (hsvcolor.value < 128) W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, WMSystemFontOfSize(scr, 12), 2, 0, 100, WALeft, W_GC(scr->white), False, "Hue", strlen("Hue")); else W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, WMSystemFontOfSize(scr, 12), 2, 0, 100, WALeft, W_GC(scr->black), False, "Hue", strlen("Hue"));  WMSetSliderImage(panel->hsbHueS, sliderPxmp); WMReleasePixmap(sliderPxmp);  for (i=0; i<7; i++) { if (colors[i]) free(colors[i]); } if (colors) free(colors);
add: W_Screen    *scr = WMWidgetScreen(panel->win); RColor        **colors = NULL; RHSVColor    hsvcolor; RImage        *sliderImg; WMPixmap    *sliderPxmp; int            i;  hsvcolor = panel->hsvcolor;  colors = malloc(sizeof(RColor*)*(8)); for (i=0; i<7; i++) { hsvcolor.hue = (360*i)/6; colors[i] = malloc(sizeof(RColor)); RHSVtoRGB(&hsvcolor, colors[i]); } colors[7] = NULL;  sliderImg = RRenderMultiGradient(141, 16, colors, RGRD_HORIZONTAL); sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0); RDestroyImage(sliderImg); if (hsvcolor.value < 128) W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scr->white), False, "Hue", strlen("Hue")); else W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, panel->font12, 2, 0, 100, WALeft, W_GC(scr->black), False, "Hue", strlen("Hue"));  WMSetSliderImage(panel->hsbHueS, sliderPxmp); WMReleasePixmap(sliderPxmp);  for (i=0; i<7; i++) { if (colors[i]) free(colors[i]); } if (colors) free(colors);
context: hsbUpdateHueGradient(W_ColorPanel *panel){	W_Screen	*scr = WMWidgetScreen(panel->win);	RColor		**colors = NULL;	RHSVColor	hsvcolor;	RImage		*sliderImg;	WMPixmap	*sliderPxmp;	int			i;		hsvcolor = panel->hsvcolor;		colors = malloc(sizeof(RColor*)*(8));	for (i=0; i<7; i++) {		hsvcolor.hue = (360*i)/6;		colors[i] = malloc(sizeof(RColor));		RHSVtoRGB(&hsvcolor, colors[i]);	}	colors[7] = NULL;		sliderImg = RRenderMultiGradient(141, 16, colors, RGRD_HORIZONTAL);	sliderPxmp = WMCreatePixmapFromRImage(scr, sliderImg, 0);	RDestroyImage(sliderImg);	if (hsvcolor.value < 128)		W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, WMSystemFontOfSize(scr, 12), 2, 0, 100, WALeft, W_GC(scr->white), False, "Hue", strlen("Hue"));	else		W_PaintText(W_VIEW(panel->hsbHueS), sliderPxmp->pixmap, WMSystemFontOfSize(scr, 12), 2, 0, 100, WALeft, W_GC(scr->black), False, "Hue", strlen("Hue"));	WMSetSliderImage(panel->hsbHueS, sliderPxmp);	WMReleasePixmap(sliderPxmp);	for (i=0; i<7; i++) {		if (colors[i])			free(colors[i]);	}	if (colors)		free(colors);}