>In what way would the blitter or window driver code have
>have to know anything about the implementation of the UI
>controls if the UI elements were designated w/ a fixed
>index instead of a variable one?
Oh - so you're suggesting that we could have reserved part of the palette
entries for UI colors, and thus you could use those entries when drawing
the bitmap? Well, yes, that could work, but it didn't happen, so yes
hypothetically but pragmatically that wasn't what happened, and we don't
change history here :-)
However, perhaps here's a simpler suggestion. Use some of the unused
palette entries at the end of the range (they're all black by default in a
release rom). So you draw your bitmap using those colors, then on the
device you'd loop through the desired UI colors, setting those reserved
indexes to the RGB values for the UI object, and then draw the bitmap and
you're done. Pretty simple... the only hard thing is drawing your bitmap
without being able to see what you're doing since Constructor doesn't have
UI to redefine the palette :-)
In short, when your app is running you're in control of the palette, so you
can have it be as you suggested.
So to be clear: draw your bitmap with three indexes in the end of the
palette range, call them indexes X, Y and Z. (Or even use colors that are
defined but aren't used, like bad shades of pink or mauve.) On the device,
probably at your app startup, do code like this:
UIColorGetTableEntryRGB (UIFormFill, &rgb);
WinPalette (winPaletteSet, X, 1, &rgb);
UIColorGetTableEntryRGB (UIObjectForeground, &rgb);
WinPalette (winPaletteSet, Y, 1, &rgb);
// now munge rgb somehow here for your dimmed UI
...
WinPalette (winPaletteSet, Z, 1, &rgb);
Note that "dimming" might be complicated. Standard would be black on
white, so dim the black to gray. But what about someone running with white
on black by default? Perhaps you can figure out some good algorithm to find
a color "between" the two visually.
So I think this actually does turn out to be easy, since you're in charge
of the palette.
-David Fedor
Palm Developer Support
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palm.com/devzone/mailinglists.html