Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!dsacg1!dsacg2!nor1675
From: nor1675@dsacg2.UUCP (Michael Figg)
Newsgroups: comp.sys.amiga
Subject: Re: Novice Intuition Graphics Questions
Summary: GetRGB4,LoadRGB4
Keywords: Colormap, Fades
Message-ID: <217@dsacg2.UUCP>
Date: 5 Jul 88 11:32:51 GMT
References: <216@dsacg2.UUCP>
Organization: Defense Logistics Agency Systems Automation Center, Columbus, OH
Lines: 57
In article <216@dsacg2.UUCP>, nor1675@dsacg2.UUCP (Michael Figg) writes:
> What is the preffered way to save workbench/colortable settings before
> changing them in a program. Is there an easy way to save 1 or 2 pen values
> (entries) and restore them before termination. It looks like GetRGB4 and
> SetRGB4 have conflicting formats. Does the whole colormap need to be saved
> and is always 64bytes? (It is 64 isn't it?)
>
As Peter says, I probably shouldn't play around with the WB colors but I am
and for no reasonable purpose either. This is what I've tried.
USHORT colorsave[4];
void main()
{
. /* Open Libraries and Window */
.
for( i=0; i<4; i++)
{
colorsave[i] = (USHORT)(*(vp->ColorMap->ColorTable[i]));
printf("%d = %x\n",i,colorsave[i]);
}
(void)demo(); /* play around with colors and other
things*/
Wait(1<UserPort->mp_SigBit);
LoadRGB4(vp,colorsave,4);
(void)CloseWindow(wnd);
}
this gave me a black screen when I closed window and zero values in the
colorsave table(which I assume gave me the black screen).
I also tried
colorsave[i] = GetRGB4(vp->ColorMap,i);
instead of
colorsave[i] = (USHORT)(*(vp->ColorMap->ColorTable[i]));
This did give me some values in the printf for the first two entries but
zero for the second two. It also gave me a lime green background and gray-
blue text and borders where I had started with a slate gray background and
white letters and borders. To me it looks like both of these approaches
should do the same thing but neither is doing it. As soon as I figure this
out then I will stop playing with the WB colors, I promise. :-)
Thanks,
--
"Better graphics with crayons" Michael Figg
DLA Systems Automation Center
Columbus, Oh.
(614)-238-9036