Date: Mon, 06 Jan 1997 20:04:09 -0500 From: Daniel Griscom <griscom@suitable.com> Subject: Possible info for Director Web TipsI've been doing research on custom 8-bit palettes for Director that work on both the Mac and Windows, and I'd like to get comments on what I've discovered and deduced. I've had to do some extrapolation and guessing at times; please let me know if I've missed/misstated something, or if there are some details that could be stated better.
If this message is too long, send me email instead of posting; don't waste everyone's time saying that I've wasted everyone's time.
All other color positions may be played with at will; your projects will have the correct colors on the Mac. If the colors the system wants aren't available then it will default to a black-and-white appearance; the system won't mess with Director's colors. One note: if "Animate in Background" is turned on and you bring another app to the front, the application's colors may be messed up by Director insisting on its set of colors.
If you look at the "System - Win" palette in Director 5 (Mac or Win), you'll find that the opposite of what I said is true: the low 10 colors are bright, with number 0 being white, and the high 10 colors are dim, with number 255 being black. Plus, colors 8, 9, 246 and 247 are marked as "reserved", and so aren't used when images are mapped to that palette. The actual colors are (in decimal RGB):
Index Red Green Blue 0 255 255 255 1 0 255 255 2 255 0 255 3 0 0 255 4 255 255 0 5 0 255 0 6 255 0 0 7 128 128 128 8 160 160 164The same set of colors can be found in DeBabelizer 1.6.5 for the Mac in the "Windows Paintbrush 256" palette, except that the order is reversed, the "236 other colors" are all black, and all the "128"s in Director's colors 249 through 254 become "191"s in DeBab's colors 1 through 6. One message in Direct-L noted that "some of the static interface colors are darker in Win95 than in Win3.1", so perhaps DeBabelizer's color palette is based on Win3.1's palette.9 255 251 240 ... 236 other colors ... 246 166 202 240 247 192 220 192 248 192 192 192 249 0 128 128 250 128 0 128 251 0 0 128 252 128 128 0 253 0 128 0 254 128 0 0 255 0 0 0
The reason for Director having the opposite color order from Windows is that, before displaying an image, DFW reverses both the color order in the requested palette and the color order in displayed images. In other words, the color with index X in a custom palette is actually written into the display palette at index (255 - X), and each pixel in each displayed image is subtracted from 255 before displaying (sounds complex, but I'm sure it takes few CPU cycles). Also, when importing images, PC format images (such as .BMP) have their palettes and pixels reversed before being added to the cast, preparing them to be reversed again for display. All this tapdancing means that a single set of images and palettes can work on both platforms.
Note that all the colors in this list "make sense" (are all combinations of 0 and one of 128, 192 or 255) except colors 8, 9, 246 and 247, which are the "reserved" colors in Director's palette. I believe that if a Windows user creates a custom user interface "appearance" with custom colors, then Windows may change these four color slots in order to show the custom colors. If this is true then these four colors are hazardous (using them on a machine with custom appearance colors would have bad results). I don't know if the other 16 colors are liable to being changed (does anyone know?)
You can actually play with all 254 colors in Windows (except black and white) as long as you NEVER have any system component (e.g. dialog, alert, another application, or QuickTime controller) visible. If you've changed the reserved 20 colors and a system component appears then Windows will egregiously change palette colors to match its needs (breaking colors in your project; once this happens colors will stay broken until you do some magic such as "pause/resume").
Whew.
So, what does all this mean?