---
name: "glColorSubTable"
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/glColorSubTable"
---

# glColorSubTable(3x)

respecify a portion of a color table

## NAME

**glColorSubTable** - respecify a portion of a color table

## C SPECIFICATION

void **glColorSubTable**( GLenum *target*,

```
	GLsizei start,
	GLsizei count,
	GLenum format,
	GLenum type,
	const GLvoid *data )
```

## PARAMETERS

- *target*

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

- *start*

  The starting index of the portion of the color table to be replaced.

- *count*

  The number of table entries to replace.

- *format*

  The  of the pixel data in *data*. The allowable 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 *data*. The allowable values are **GL\_UNSIGNED\_BYTE**, **GL\_BYTE**, **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**.

- *data*

  Pointer to a one-dimensional array of pixel data that is processed to replace the specified region of the color table.

## DESCRIPTION

**glColorSubTable** is used to respecify a contiguous portion of a color table previously defined using **glColorTable**.  The pixels referenced by *data* replace the portion of the existing table from indices *start* to $"start"~+~"count"~-~1$, inclusive.  This region may not include any entries outside the range of the color table as it was originally specified. It is not an error to specify a subtexture with width of 0, but such a specification has no effect.

## NOTES

**glColorSubTable** 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\_VALUE** is generated if $"start"~+~"count"~\>~width$.

**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 **glColorSubTable** is executed between the execution of **glBegin** and the corresponding execution of **glEnd**.

## ASSOCIATED GETS

**glGetColorTable**, **glGetColorTableParameter**

## SEE ALSO

**glColorSubTable(3G)**, **glColorTableParameter(3G)**, **glCopyColorTable(3G)**, **glCopyColorSubTable(3G)**, **glGetColorTable(3G)**
