---
name: "dtk_setcolor_shape"
section: "3"
platform: "linux"
package: "libdrawtk-dev"
version: "2.0-2.1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/dtk_setcolor_shape"
---

# dtk\_setcolor\_shape(3)

Set the color of a shape

## NAME

dtk\_setcolor\_shape - Set the color of a shape

## SYNOPSIS

**#include \<drawtk.h\>**

**void dtk\_setcolor\_shape(const dtk\_hshape** *shp***, const float\* color, unsigned int mask);**\

## DESCRIPTION

**dtk\_setcolor\_shape**() set the color *color* of a shape identified by the pointer *shp*. *color* should point to a 4 float array containing a normalized RGBA value (i.e. each component is between 0.0 and 1.0). If *shp* is a composite shape, *color* is applied to all the shapes in the list. Notice that *color* is applied uniformly to the whole shape. Bits in *mask* correspond to the color channels that will *NOT* be set.

If *mask* is equal to 0 all the RGBA color channels will be set. Predefined values of mask:

- \*

  DTK\_IGNR: ignore red color channel

- \*

  DTK\_IGNG: ignore green color channel

- \*

  DTK\_IGNB: ignore blue color channel

- \*

  DTK\_IGNA: ignore alpha channel

- \*

  DTK\_IGNRGB: ignore red, green and blue color channels

## RETURN VALUE

None.

## SEE ALSO

[**dtk\_create\_shape**(3)](/dtk_create_shape/3.md), [**dtk\_create\_composite\_shape**(3)](/dtk_create_composite_shape/3.md)
