UINT GetNearestPaletteIndex(hpal, crColor) | |||||
HPALETTE hpal; | /* handle of logical color-palette | */ | |||
COLORREF crColor; | /* color to be matched | */ |
The GetNearestPaletteIndex function retrieves the index for the entry in the given logical palette that most closely matches a given color value.
hpal
Identifies a logical palette.
crColor
Specifies a color to be matched.
The return value is the index of an entry in a logical palette if the function is successful. Otherwise it is CLR_INVALID.
If the given logical palette contains entries with the PC_EXPLICIT flag set, the return value is undefined.
COLORREF