---
name: "ggiSetPalette"
section: "3ggi"
platform: "linux"
package: "libggi2-dev"
version: "1:2.0.1-2"
release: "Debian 3.0 (Woody)"
platforms: ["linux"]
url: "https://new.carta.tech/ggiSetPalette/3ggi"
---

# ggiSetPalette(3ggi)

Manipulate the palette of a visual

## NAME

ggiSetPalette, ggiGetPalette - Manipulate the palette of a visual

## SYNOPSIS

**#include \<ggi/ggi.h\>**

**int ggiGetPalette(ggi\_visual\_t** *vis***,**  **int** *s***,**  **int** *len***,**  **ggi\_color \****cmap***);**

**int ggiSetPalette(ggi\_visual\_t** *vis***,**  **int** *s***,**  **int** *len***,**  **ggi\_color \****cmap***);** .SH "DESCRIPTION"

LibGGI visuals in **GT\_PALETTE** mode maps all pixelvalues to the corresponding **ggi\_color** entry in the visual's palette.

**ggiSetPalette** sets a range of palette values, of length *len*, starting at index number *s*. The index can be **GGI\_PALETTE\_DONTCARE** to indicate to indicate that the palette can be installed anywhere in the CLUT. This allows optimised use in windowing environments (to minimize color flashing between windows) and should be used if possible.

**ggiGetPalette** copies the specified colors (starting from *s*, for *len* colors) from the visual's palette to the array pointed by *cmap*.

## RETURN VALUE

**ggiSetPalette** returns the number of the first entry changed. Negative values indicate error (codes).

**ggiGetPalette** returns 0 for OK, otherwise an error code. When called with len=0 this function will not automatically succeed, but the return code will indicate whether there is a readable CLUT.

## SEE ALSO

\[XRef to GGISETCOLORFULPALETTE\]
