---
name: "PS_shading"
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_shading"
---

# PS\_shading(3)

Create shading

## NAME

PS\_shading — Create shading

## SYNOPSIS

\#include \<pslib.h\>

int PS\_shading(PSDoc \*psdoc, const char \*shtype, float x0, float y0, float x1, float y1, float c1, float c2, float c3, float c4, const char \*optlist)

## DESCRIPTION

This function creates a shading which can be used by  **[PS\_shfill(3)](/PS_shfill/3.md)** or  **[PS\_shading\_pattern(3)](/PS_shading_pattern/3.md)**. The type of shading  can be either \`radial' or \`axial'. Each shading starts with  the current fill color and ends with the given color values  passed in the parameters **c1** to  **c4** (see **[PS\_setcolor(3)](/PS_setcolor/3.md)** 		 for their meaning). The coordinates **x0**,  **y0**, **x1**,  **y1** are the start and end point of the shading.  If the shading is of type \`radial' the option list must also contain  the parameters r0 and r1 with the radius of the start and end  circle.

The color of the shading can be in any color space except for  \`pattern'.

## RETURN VALUE

Returns the identifier of the shading or zero in case of an error.  The identifier is a positiv number.

## SEE ALSO

[PS\_shfill(3)](/PS_shfill/3.md), [PS\_shading\_pattern(3)](/PS_shading_pattern/3.md)

## AUTHOR

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