---
name: "PS_setcolor"
section: "3"
platform: "linux"
package: "pslib-dev"
version: "0.4.8-1+b1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/PS_setcolor"
---

# PS\_setcolor(3)

Sets current color

## NAME

PS\_setcolor — Sets current color

## SYNOPSIS

\#include \<pslib.h\>

void PS\_setcolor(PSDoc \*psdoc, const char \*type, const char \*colorspace, float c1, float c2, float c3, float c4)

## DESCRIPTION

Sets the color for drawing, filling, or both. The colorspace should  be one of 'gray', 'spot', 'rgb, 'cmyk', or 'pattern'. Depending on the  colorspace either  only the first, the first two, the first three all or remaining  parameters will be  used. If **colorspace** is 'pattern' then  **c1** must contain the pattern id as returned  by **[PS\_begin\_pattern(3)](/PS_begin_pattern/3.md)**. If  **colorspace** is 'spot' then the  **c1** must contain the spot color id as returned by  **[PS\_makespotcolor(3)](/PS_makespotcolor/3.md)** and the  **c2** must contain the tint value for the color.

The parameter **type** can be 'fillstroke', 'fill',  or 'stroke'.

## BUGS

The second parameter is currently not in any case evaluated.  The color is  always set for filling and drawing just as if 'both' where passed.  If you want to set the color to define a spot color from it, you  will have to pass 'both' or 'fill', because  **[PS\_makespotcolor(3)](/PS_makespotcolor/3.md)** utilizes the current fill  color.

## SEE ALSO

[PS\_begin\_pattern(3)](/PS_begin_pattern/3.md)

## AUTHOR

This manual page was written by Uwe Steinmann uwe@steinmann.cx.
