COLORREF PALETTEINDEX(wPaletteIndex) | |||||
WORD wPaletteIndex; | /* index to palette entry | */ |
The PALETTEINDEX macro accepts an index to a logical-color palette entry and returns a value consisting of 1 in the high-order byte and the palette-entry index in the low-order byte. This is called a palette-entry specifier. An application using a color palette can pass this specifier instead of an explicit RGB value to functions that expect a color. This allows the function to use the color in the specified palette entry.
wPaletteIndex
Specifies an index to the palette entry containing the color to be used for a graphics operation.
The return value is a logical-palette index specifier. When using a logical palette, an application can use this specifier in place of an explicit RGB value for graphics-device interface (GDI) functions that require a color.
The PALETTEINDEX macro is defined in WINDOWS.H as follows:
#define PALETTEINDEX(i) ((COLORREF)(0x01000000L | (DWORD)(WORD)(i)))