RGB Colors 24-bit Help
Posted: Mon Feb 23, 2009 5:34 am
HI. I have been playing with my VESA driver and everything seems to work fine except when I try to use some colors. I am in a mode using a palette of 24-bit colors and it seems I can only use certain colors, colors that share this pattern: 0xFFFFFF, 0x333333, 0xBBBBBB, etc...
When I use a color like: 0x9FB6CD
All I receive in return is this greyish pixel where the three colors R, G, and B are visible. I can see red, blue, and green points making up one pixel. The colors are not blending together, I suppose is the issue, but I do not know why. Do I need to set the DAC Control function's bits per primary color field after calling function 4f02 or should I be fine without doing that? That is the only thing I can think of.
I am using this function here to plot my pixels:
Any hints as to why my colors are lacking their color? thank you
When I use a color like: 0x9FB6CD
All I receive in return is this greyish pixel where the three colors R, G, and B are visible. I can see red, blue, and green points making up one pixel. The colors are not blending together, I suppose is the issue, but I do not know why. Do I need to set the DAC Control function's bits per primary color field after calling function 4f02 or should I be fine without doing that? That is the only thing I can think of.
I am using this function here to plot my pixels:
Code: Select all
void put_pixel(int x,int y, int color)
{
vbe_info_t vbe;
char *lfb = (char *)hal.lfb;
unsigned where=x*3+y*vbe.BytesPerScanLine;
lfb[where]=color&255; // BLUE
lfb[where+1]=(color>>8)&255; // GREEN
lfb[where+2]=(color>>16)&255; // RED
}