Xref: utzoo comp.sys.mac:34597 comp.sys.mac.programmer:7493 Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!apple!cjp From: cjp@Apple.COM (Chris Plummer) Newsgroups: comp.sys.mac,comp.sys.mac.programmer Subject: Re: Mac II Palettes Message-ID: <33060@apple.Apple.COM> Date: 12 Jul 89 01:37:44 GMT References: <635@sys.uea.ac.uk> Organization: Apple Computer Inc, Cupertino, CA Lines: 20 In article <635@sys.uea.ac.uk> swc@uea-sys.UUCP () writes: > >The RGB colour entries in Mac II's palettes are supposed to be 0 - 65535 >but when converted to the conventional range 0 .. 1 by: > > newcol.red := col.red/65535 etc > >where newcol.red, green and blue are reals, it starts inserting negative >numbers (possibly -32767 to 32767 or something similar). > >Can anybody think of a suitable assignment for going from the integers >to the reals (and vice versa) apart from adding and subtracting 32767 etc. According to IM V-136, the RGBColor record consists of 3 INTEGERs and INTEGERs are signed (-32768..32767) so it looks like you'll need to add 32768 to the color values or treat them as unsigned integers (maybe declare a type called UNSIGNEDINT : 0..65535 and then use this as a type cast. Hope this helps. --Chris Plummer