The default palette
For applications with minimal color requirements, a default palette is provided that contains 16 colors. The following table gives the pixel-value-to-color mapping of the default palette.
Table 22. Pixel-value-to-color mapping for the default palette
| | | |
0 | black | 1 | dark red |
2 | dark green | 3 | dark yellow |
4 | dark blue | 5 | dark magenta |
6 | dark cyan | 7 | light gray |
8 | gray | 9 | red |
10 | green | 11 | yellow |
12 | blue | 13 | magenta |
14 | cyan | 15 | white |
All windows have the default palette selected unless the application has selected a different palette. Use of the default palette has some key advantages:
• It minimizes color resource allocation, leaving more colors available to other applications that require them.
• It minimizes the amount of redrawing that needs to be done when windows change ordering and when color resource allocations are made by other applications.
Some platforms, such as Windows, provide an operating system default palette containing some or all of these colors. On these platforms, the colors in the Common Graphics default palette use the same color intensities as the corresponding colors in the operating system default palette in order to minimize color resource allocation.
Tip:
The default palette is retrieved by evaluating CgIndexedPalette default.
Last modified date: 05/12/2020