get_nearest_palette_index


unsigned get_nearest_palette_index(handle palette,
                                   color color_query)

This function obtains the index of the palette entry most closely matching a specified color.

Parameters

handle palette

The handle of the palette.

color color_query

The color to be matched.

Return

unsigned

The index of the most closely matching color or error_returns::color if an error occurred.

Notes

palette support for a device may be ascertained using:

If the palette contains entries with the flag palette_property::Reserved set, the value returned is undefined.