{
LIBRESOC_FROM_HANDLE(libresoc_image, image, image_h);
- float r = pColor->float32[0];
- float g = pColor->float32[1];
- float b = pColor->float32[2];
- float temp = 100.00 * ((r * 0.3 ) + (g * 0.3) + (b * 0.3));
- for (int i=0; i < image->size; ++i) {
- image->bytes[i] = temp;
+ uint32_t r = pColor->uint32[0];
+ uint32_t g = pColor->uint32[1];
+ uint32_t b = pColor->uint32[2];
+ uint32_t a = pColor->uint32[3];
+ for (int i=0; i < image->size / 4; ) {
+ image->bytes[i] = r;
+ i += 1;
+ image->bytes[i] = g;
+ i += 1;
+ image->bytes[i] = b;
+ i += 1;
+ image->bytes[i] = a;
+ i += 1;
}
}