rem: *dr = (((int)*dr * nalpha) + (r * alpha))/256; *dg = (((int)*dg * nalpha) + (g * alpha))/256; *db = (((int)*db * nalpha) + (b * alpha))/256;
add: *dr = (((int)*dr * nalpha) + r)/256; *dg = (((int)*dg * nalpha) + g)/256; *db = (((int)*db * nalpha) + b)/256;
context: RClearImage(RImage *image, RColor *color){    int bytes;        bytes = image->width*image->height;    if (color->alpha==255) {	memset(image->data[0], color->red, bytes);	memset(image->data[1], color->green, bytes);	memset(image->data[2], color->blue, bytes);	if (image->data[3])	  memset(image->data[3], 0xff, bytes);    } else {	register int i;	unsigned char *dr, *dg, *db;	int alpha, nalpha, r, g, b;	dr = image->data[0];	dg = image->data[1];	db = image->data[2];    	r = color->red;	g = color->green;	b = color->blue;	alpha = color->alpha;	nalpha = 255 - alpha;	for (i=0; i<bytes; i++) {	    *dr = (((int)*dr * nalpha) + (r * alpha))/256;	    *dg = (((int)*dg * nalpha) + (g * alpha))/256;	    *db = (((int)*db * nalpha) + (b * alpha))/256;	    dr++;    dg++;    db++;	}    }    return True;}