# ShadingPattern

#### new ShadingPattern(type, coords, colors, gStateopt, matrixopt)

Source:
  - jspdf.js, line 1496

A pattern describing a shading pattern.

Only available in "advanced" API mode.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`type` | String |  | One of "axial" or "radial"
`coords` | Array.<Number> |  | Either [x1, y1, x2, y2] for "axial" type describing the two interpolation points or [x1, y1, r, x2, y2, r2] for "radial" describing inner and the outer circle.
`colors` | Array.<Object> |  | An array of objects with the fields "offset" and "color". "offset" describes the offset in parameter space [0, 1]. "color" is an array of length 3 describing RGB values in [0, 255].
`gState` | GState | <optional> | An additional graphics state that gets applied to the pattern (optional).
`matrix` | Matrix | <optional> | A matrix that describes the transformation between the pattern coordinate system and the use coordinate system (optional).

### Extends

- API.Pattern