Mail Archives: djgpp/1999/10/20/03:49:17
Heya
What immediately comes to mind is using a palette sort of truecolor like... ie.
Instead of for example the hicolor 5-5-5 palette, within 8 bits you use a 3-3-2
palette which means 3 bits of red, 3 for green, 2 for blue...
Short program:
PALETTE result;
int main ()
{
int r, g, b, index;
index = 0;
for (b = 0; b < 4; b ++)
for (g = 0; g < 8; g ++)
for (r = 0; r < 8; r ++)
{
result [index] .r = r * 8;
result [index] .g = g * 8;
result [index] .b = b * 16;
}
return 0;
}
I haven't tested this (just made it really really really quickly) so I can't
guarantee it's correct, but it seems to work fine in my mind... Of course, it
won't do anything but you should get the jist...
You could probably extend this to use HLS or CYM or whatever suits you at the
time... Converting your old graphics to this palette is another question... I'd
probably end up using PSP for that...
- frEk
> I want to create a game in Mode-X with Allegro, and now my problem is the
> following:
> Which Palette should I use? How can I make it, that every important color is
> in the palette, and that there are colors in the palette, which enable me to
> make smooth color-changes (for instance when I need the colors to draw a
> picture where a orange gradually turns to a grey or something...)? Can I
> download a good 8-Bit palette somewhere, or has anyone got any tips for how
> to make it?
- Raw text -