Index:
[thread]
[date]
[subject]
[author]
From: becka@rz.uni-duesseldorf.de
To : ggi-develop@eskimo.com
Date: Fri, 21 May 1999 09:52:52 +0200 (MET DST)
Re: how to change colors in Libggi2d
> Thanks goes to the developer who fixed the LibGGI2d.
> I cannot seem to change the colors of the primatives in the
> demo. No matter how I set the values in the map struct:
*Grin* that's a funny effect you are seeing ...
> map.r=0xF000;
> map.g=0xF000;
> map.b=0xF000;
> grey=ggiMapColor(vis,&map);
> printf("grey=%d\n",grey);
Yes, the Code is o.k.
> Can anyone tell me if the palette stuff is working or am I just
> not grasping the concept of how to change colors.
> ie: if I change the 'map.r=0xF000' to map.r=0x0000 I would
> expect a change in the colors, yet the screen draws the
> primatives in all white.
You are using a palettized visual - right ? The fun point is
for(c=0;c<256;c++)
pal[c].r = pal[c].g = pal[c].b = c*256;
ggiSetPalette(vis,0,256,pal);
Got the point ? The whole palette is grey, so you can't get anything
but grey. If you have a non-palettized visual, you will probably get
the triangle in color, because:
ggi2dSetFillColor(vis, 150);
Which of course select any funny color that happens to have index 150.
You might want to try SetColorfulPalette instead of the explicit SetPalette.
CU, Andy
--
Andreas Beck | Email : <Andreas.Beck@ggi-project.org>
Index:
[thread]
[date]
[subject]
[author]