TIvoryDraw::Palette

Palette controls Ivory Draw's color mapping.

__property bool Active;

Description

Ivory Draw uses 640x480 256-color video mode, where 8 bits represent the color of a pixel. The palette defines the RGB (red, green, and blue) components of all the 256 colors you can use at the same time. When you need to specify a color, you refer to a color in the palette. The color 0 refers to the first color in the palette, and 255 refers to the last color. The color of a pixel can be between 0 and 255. You can change the colors by changing the palette, but you cannot use more than 256 colors at the same time.

Note that there are times when you need to specify a color of type TColor. In this case, you need to specify the red, green, and blue components of the color, like in a standard Windows application. But in IvoryDraw, if the color you specified is not in the current palette, then Windows will use the color from the palette that is nearest to the specified color. For example, if you specify clBlue, but in your palette there's only light blue, then Windows'll use the light blue color, instead of the clBlue.

Also note that the palette changes immediately on the screen if you're changing the Palette property. Therefore you should always change the palette before calling BackgroundSurface->Paint. Otherwise, your colors may be messed up.

If you're debugging your DirectX application, and using a hi-color Windows mode, you can't use a palette. Therefore Ivory Draw doesn't throw an exception if there is a palette error when you're in debug mode (ExclusiveMode = false).

Back to TIvoryDraw