---
name: "glGetColorTable"
section: "3x"
platform: "linux"
package: "xlibmesa-gl-dev"
version: "4.3.0.dfsg.1-14sarge7"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/glGetColorTable"
---

# glGetColorTable(3x)

retrieve contents of a color lookup table

## NAME

**glGetColorTable** - retrieve contents of a color lookup table

## C SPECIFICATION

void **glGetColorTable**( GLenum *target*,

```
	GLenum format,
	GLenum type,
	GLvoid *table )
```

## PARAMETERS

- *target*

  Must be **GL\_COLOR\_TABLE**, **GL\_POST\_CONVOLUTION\_COLOR\_TABLE**, or **GL\_POST\_COLOR\_MATRIX\_COLOR\_TABLE**.

- *format*

  The  of the pixel data in *table*. The possible values are **GL\_RED**, **GL\_GREEN**, **GL\_BLUE**, **GL\_ALPHA**, **GL\_LUMINANCE**, **GL\_LUMINANCE\_ALPHA**, **GL\_RGB**, **GL\_BGR**, **GL\_RGBA**, and **GL\_BGRA**.

- *type*

  The type of the pixel data in *table*. Symbolic constants **GL\_UNSIGNED\_BYTE**, **GL\_BYTE**, **GL\_BITMAP**, **GL\_UNSIGNED\_SHORT**, **GL\_SHORT**, **GL\_UNSIGNED\_INT**, **GL\_INT**, **GL\_FLOAT**, **GL\_UNSIGNED\_BYTE\_3\_3\_2**, **GL\_UNSIGNED\_BYTE\_2\_3\_3\_REV**, **GL\_UNSIGNED\_SHORT\_5\_6\_5**, **GL\_UNSIGNED\_SHORT\_5\_6\_5\_REV**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4\_REV**, **GL\_UNSIGNED\_SHORT\_5\_5\_5\_1**, **GL\_UNSIGNED\_SHORT\_1\_5\_5\_5\_REV**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8\_REV**, **GL\_UNSIGNED\_INT\_10\_10\_10\_2**, and **GL\_UNSIGNED\_INT\_2\_10\_10\_10\_REV** are accepted.

- *table*

  Pointer to a one-dimensional array of pixel data containing the contents of the color table.

## DESCRIPTION

**glGetColorTable** returns in *table* the contents of the color table specified  by *target*. No pixel transfer operations are performed, but pixel  storage modes that are applicable to **glReadPixels** are performed.

Color components that are requested in the specified *format*, but which are not included in the internal\
  of the color lookup table, are returned as zero.  The assignments of internal color components to the components requested by *format* are

| | |
| --- | --- |
| **Internal Component** | **Resulting Component** |
| red | red |
| green | green |
| blue | blue |
| alpha | alpha |
| luminance | red |
| intensity | red |

## NOTES

**glGetColorTable** is present only if **GL\_ARB\_imaging** is returned when **glGetString** is called with an argument of **GL\_EXTENSIONS**.

## ERRORS

**GL\_INVALID\_ENUM** is generated if *target* is not one of the allowable values.

**GL\_INVALID\_ENUM** is generated if *format* is not one of the allowable values.

**GL\_INVALID\_ENUM** is generated if *type* is not one of the allowable values.

**GL\_INVALID\_OPERATION** is generated if *type* is one of **GL\_UNSIGNED\_BYTE\_3\_3\_2**, **GL\_UNSIGNED\_BYTE\_2\_3\_3\_REV**, **GL\_UNSIGNED\_SHORT\_5\_6\_5**, or **GL\_UNSIGNED\_SHORT\_5\_6\_5\_REV** and *format* is not **GL\_RGB**.

**GL\_INVALID\_OPERATION** is generated if *type* is one of **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4**, **GL\_UNSIGNED\_SHORT\_4\_4\_4\_4\_REV**, **GL\_UNSIGNED\_SHORT\_5\_5\_5\_1**, **GL\_UNSIGNED\_SHORT\_1\_5\_5\_5\_REV**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8**, **GL\_UNSIGNED\_INT\_8\_8\_8\_8\_REV**, **GL\_UNSIGNED\_INT\_10\_10\_10\_2**, or **GL\_UNSIGNED\_INT\_2\_10\_10\_10\_REV** and *format* is neither **GL\_RGBA** nor **GL\_BGRA**.

**GL\_INVALID\_OPERATION** is generated if **glGetColorTable** is executed between the execution of **glBegin** and the corresponding execution of **glEnd**.

## SEE ALSO

**glColorTable(3G)**, **glColorTableParameter(3G)**, **glGetColorTableParameter(3G)**
