Mail Archives: djgpp/1997/06/13/04:32:52
Hi,
>I would like to use 256 grayscale colors with djgpp.
Hi,
>e.g.
>set_gfx_mode(GFX_ET4000,640,480,0,0);
>for(c=0;c<256;c++){
> pallete[c].r=c;
> pallete[c].g=c;
> pallete[c].b=c;
>}
This is 'cause the .r .g .b number can only be from 0 to 63. To get a
greyscale, do this:
for(x=0;x<256;x+=64)
for(c=0;c<63;c++)
{
palette[c].r = c+x;
palette[c].g = c+x;
palette[c].b = c+x;
}
What these loops do is make the colours go from 0-63, and then
from 64-127, and then 128-191, and then 191-254. This the only way I can
think of, 'cause I've not done this yet. If this doesn't work, opp!
Hope this helps / works! ;)
Bye!
****************************************************
* Gautam N. Lad *
*--------------------------------------------------*
* *
* E-Mail : gautam AT interlog DOT com *
* Website : http://www.interlog.com/~gautam *
* *
* OS/2, DOS/Windows, Graphics Gallery, Software, *
* Links, Rayzor Editor/2, POV-Ray, TexturEyes, *
* POV-PAK and lots lots lots more!!!!!!! *
****************************************************
- Raw text -