Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

My colors always come out wrong. And how can I make a greyscale palette with 256 different shades?

0
Posted

My colors always come out wrong. And how can I make a greyscale palette with 256 different shades?

0

The VGA hardware only uses 6 bits for each color component, which means the red, green, and blue values in the palette structure range from 0 to 63, not all the way up to 255. That gives you a potential 2^18 = 262144 different colors, or 64 shades of grey. If you need more than this you could try using VESA function 0x4F08 to select an 8 bit wide DAC, but Allegro doesn’t support this directly and I don’t know how reliable it will be across different hardware.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.