1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-23 06:38:05 +01:00

Fixed incorrect color retrieval

This commit is contained in:
dan
2001-02-21 04:39:04 +00:00
parent d5ebb27e2d
commit ae52b2a437

View File

@@ -49,7 +49,7 @@ RGetPixel(RImage *image, int x, int y, RColor *color)
if (image->format == RRGBAFormat) {
ofs = (y*image->width + x) * 4;
color->red = image->data[ofs];
color->red = image->data[ofs++];
color->green = image->data[ofs++];
color->blue = image->data[ofs++];
color->alpha = image->data[ofs];
@@ -57,7 +57,7 @@ RGetPixel(RImage *image, int x, int y, RColor *color)
ofs = (y*image->width + x) * 3;
color->red = image->data[ofs++];
color->green = image->data[ofs++];
color->blue = image->data[ofs++];
color->blue = image->data[ofs];
/* If the image does not have alpha channel, we consider alpha 255 */
color->alpha = 255;
}