Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!mailrus!accuvax.nwu.edu!tank!rtp1 From: rtp1@tank.uchicago.edu (raymond thomas pierrehumbert) Newsgroups: comp.sys.mac.programmer Subject: Making a new ColorTable Keywords: ColorTable Message-ID: <8094@tank.uchicago.edu> Date: 16 Mar 90 08:29:13 GMT Organization: University of Chicago Lines: 23 I need to make a new ColorTable to go with an offscreen PixMap (that is later going to be CopyBitted to the screen). I'm working in Think C 3.x. How do I do it? Making the ColorTable itself is not a problem. I can put in a declaration ColorTable **myCTab; and set (**myCTab).ctSeed, (**myCTab).ctSize, etc, but the problem comes with setting (**myCTab).ctTable , which is supposed to be a CSpecArray. I can make the CSpec array by defining ColorSpec *mycolors; or ColorSpec mycolors[256]; but when I try to do (**myCTab).ctTable = mycolors; the compiler gives me an "illegal pointer arithmetic" error. If I try to do any reasonable type cast, I get an "illegal cast" error. What am I doing wrong? The reason I need to set up a ColorTable is that I want to display a pixel buffer to the screen, where the pixel values correspond to the entry indices used in the SetEntryColor call to the Palette manager. Hence, I have to set the ctTable.value field appropriately to get the right colors. .