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

# GetNearestPaletteIndex(3w)

## NAME

**GetNearestPaletteIndex** (GDI32.@)

## SYNOPSIS

UINT GetNearestPaletteIndex\
  (\
   HPALETTE *hpalette*,\
   COLORREF *color*\
  )

## PARAMS

*hpalette* **\[In\]**  Handle of logical *color* palette.

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

## DESCRIPTION

Gets palette index for *color*.

## NOTES

Should index be initialized to **CLR\_INVALID** instead of **0**?.

## RETURNS

**Success:** Index of entry in logical palette

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

## IMPLEMENTATION

Declared in **"wingdi.h"**.

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

Debug channel **"palette"**.
