GetNearestColor

  COLORREF GetNearestColor(hdc, crColor)    
  HDC hdc; /* handle of device context */
  COLORREF crColor; /* color to be matched */

The GetNearestColor function returns a color value that identifies a color from the system palette which will be displayed when the given color value is used.

Parameters

hdc

Identifies the device context.

crColor

Specifies a color value that identifies a requested color.

Return Value

The return value identifies a color from the system palette that corresponds to the given color-value. Otherwise it is CLR_INVALID.

See Also

COLORREF