## Presentation Device Driver Reference for OS/2

[prev][next][parent][TOC]

### Palette Manager Functions

The hardware (HW) palette, or device physical palette, is divided into two parts:

Device default colors, which are the entries used by nonpalette manager DCs
Palette Manager palette colors

At startup, the HW palette is assigned the device default colors because there are no Palette Manager DCs at this time. When Palette Manager palettes are created and subsequently selected and realized, their palette colors must be allocated slots in the HW palette. Therefore, the proportion of the HW palette allocated to the default colors is reduced to produce free slots, which then can be allocated to the Palette Manager palettes. If the number of Palette Manager slots is reduced, the number of slots allocated to the default colors is increased to improve the appearance of the non-Palette Manager DCs.

Non-Palette Manager DCs can only use the default colors found in the device HW palette. There are five possible sizes of device default colors: 256-, 128-, 64-, 32-, and 16-entries. The 256-entry default palette is the same as the standard 8514 8bpp palette. The 16-entry default palette is the same as VGA palette. For OD_MEMORY DCs, the 256-entry device default palette is always used. For OD_DIRECT DCs, the device HW palette can be changed to permit allocation of HW palette slots to Palette Manager DCs.

Within the HW palette, the device default colors are always positioned symmetrically in two halves at the top and bottom of the HW palette. The slots in the center are used for Palette Manager slots. Therefore, when mixing the device default colors, the result is always another device default color. The colors within the device default palette are arranged so that the inverse mixes always give the expected results.