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

Description

My colors always come out wrong. And how can I make a greyscale palette with 256 different shades?
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.