---
name: "GetNearestColor"
section: "3w"
platform: "linux"
package: "libwine-dev"
version: "1.4.1-4"
release: "Debian 7 (Wheezy)"
platforms: ["linux"]
url: "https://new.carta.tech/GetNearestColor"
---

# GetNearestColor(3w)

## NAME

**GetNearestColor** (GDI32.@)

## SYNOPSIS

COLORREF GetNearestColor\
  (\
   HDC      *hdc*,\
   COLORREF *color*\
  )

## PARAMS

*hdc* **\[In\]**  Handle of device context.

*color* **\[In\]**  Color to be matched.

## DESCRIPTION

Gets a system *color* to match.

## RETURNS

**Success:** Color from system palette that corresponds to given *color*

**Failure:** **CLR\_INVALID**

## IMPLEMENTATION

Declared in **"gdi\_private.h"**.

Implemented in **"dlls/gdi32/palette.c"**.

Debug channel **"palette"**.
