Index: [thread] [date] [subject] [author]
  From: Club Neon <clubneon@hereintown.net>
  To  : ggi-develop@eskimo.com
  Date: Sun, 4 Jul 1999 03:29:49 -0400

Re: Got to be a faster way.

> How about with this:
>
> /* generate_332_palette:
>  *  Used when loading a truecolor image into an 8 bit bitmap, to generate
>  *  a 3.3.2 RGB palette.
>  */
> void generate_332_palette(ggi_color *pal)
> {
>    #define PAL_SIZE 256
>    ggi_sint c;
>
>    for (c=0; c < PAL_SIZE; c++) {
>       pal[c].r = ((c>>5)&7) * 0xffff/7;
>       pal[c].g = ((c>>2)&7) * 0xffff/7;
>       pal[c].b = (c&3) * 0xffff/3;
>    }
>
>    pal[0].r = 0xffff;
>    pal[0].g = 0;
>    pal[0].b = 0xffff;
>
>    pal[254].r = pal[254].g = pal[254].b = 0;
>    #undef PAL_SIZE
> } // generate_332_palette
>
>
> Any comments?

How about a question?  Why is pal[0] magenta, and pal[254] black?  Am I
missing something?

I was thinking that pal[0] would be black, and I guess pal[254] would be
almost white, slightly yellow tinted.

Index: [thread] [date] [subject] [author]