Closed as not planned
Closed as not planned
Description
When attempting to draw pixels on the screen using the provided pixel_put function, pixels intended to be white are instead rendered as cyan. This discrepancy suggests a potential problem with how the red channel is being handled during the rendering process.
static void pixel_put(mlx_image_t *image, int x, int y, int color)
{
int i;
unsigned char *pixel;
if ((unsigned)x < (*image).width && (unsigned)y < (*image).height)
{
pixel = (*image).pixels + (y * (*image).width + x) * sizeof(int);
i = sizeof(int) * 6;
while (i >= 0)
{
*pixel++ = (color >> i) & 0xFF;
i -= sizeof(int) * 2;
}
}
}
``
The pixel_put function is responsible for placing a pixel of a specified color at the given coordinates on an image. It operates by manipulating the pixel's color values, byte by byte, to set the appropriate RGB components.
This issue has been observed across multiple platforms, including Arch Linux and macOS Catalina.