[comp.sys.mac.programmer] COLOR PALETTES

jmidili@hub.cs.jmu.edu (jeff midili) (11/11/90)

I am trying to display a 32 level grey PICT file.  Now I assume to
do this a need to create a 32 level grey palette (stop me if I'm
wrong) with resedit, and then assign that palette to the window
that will be displaying this picture.  How do i go about creating
a 32 level grey palette with resedit?  Are there any good books
written for the color macs that discribe palettes, cluts, pixelmaps
etc, etc??

thanks

  jeff midili
   jmidili@hub.cs.jmu.edu

jenlan@eos.arc.nasa.gov (Jennifer S Lanham) (05/20/91)

In article <14374.282B3424@fidogate.FIDONET.ORG> Sheldon.Keala@f444.n161.z1.FIDONET.ORG (Sheldon Keala) writes:
>I am beginning to experiment with custom palettes.  My problem is this: how 
>do I reset everything when my program exits so that the desktop looks right? 
>I presently reload the default QD color table and reset the palette, but that 
>is clearly not enough.  Thanks, S. Keala.
>
 I have used palettes quite often and have not had a problem with simply
exiting my program...the Color and Palette Managers clean everything up once
my palette entries are released. Definitely never had to reset the color
table, and my palette was disposed of, so no resetting was necessary.

I thought that was the idea behind palettes: the Mac keeps track of color
priorities ( e.g. give front window priority), it "knows" when your 
application quits and reprioritizes the color allocations. 

Are you doing things behind the color or palette manager's back? If it 
doesn't "know" the environment has changed, it won't update. 

Finally, I could be flaunting my ignorance here, so can some one clear
this up?  Will color QD take care of re-allocation, when one follows the
rules for using color and palettes?

Thanx 
Jennifer Lanham

*****legally I am required to say "I AM NOT A NASA EMPLOYEE-I DO NOT
REPRESENT NASA"********

rla20@duts.ccc.amdahl.com (Roger Allen) (05/22/91)

In article <14374.282B3424@fidogate.FIDONET.ORG> Sheldon.Keala writes:
>I am beginning to experiment with custom palettes.  My problem is this: how 
>do I reset everything when my program exits so that the desktop looks right? 
>I presently reload the default QD color table and reset the palette, but that 
>is clearly not enough.  Thanks, S. Keala.
>
What has worked for me is to reset the current window's palette to the
system palette.  Then, do a PaintBehind(yourFrontWindow).  The
PaintBehind call gets the events all the way down to the desktop and
it redraws properly.

I hope more programs do this in the future.  Nothing is more annoying
than exiting a program that fools with the color manager and having
the desktop & every other window messed up.

BTW, you should also do this when Multifinder swaps you out!

Hope this helps,
Roger.
--
> Roger Allen                    |  :~) "I always lie"                   <
> Amdahl Computer Development    |                                       <
> rla20@duts.ccc.amdahl.com      |  ;~( "I'm lying now"                  <