GetNearestColor

2.x

  COLORREF GetNearestColor(hdc, clrref)    
  HDC hdc; /* handle of device context */
  COLORREF clrref; /* color to match, */  

The GetNearestColor function retrieves the solid color that best matches a specified logical color; the given device must be able to represent this solid color.

Parameters

hdc

Identifies the device context.

clrref

Specifies the color to be matched.

Return Value

The return value specifies an RGB (red, green, blue) color value that defines the solid color closest to the clrref value that the device can represent.

See Also

GetNearestPaletteIndex