CreateGradientFunction(IReadOnlyList) Method

Definition

Namespace Broadside
Assembly Broadside.dll

Creates a function of one input over 0 to 1 that blends between gradient stops.

public PdfFunction CreateGradientFunction(IReadOnlyList<PdfGradientStop> stops)

Parameters

stops
IReadOnlyList<PdfGradientStop>

The stops: at least two, offsets from 0 to 1 in non-decreasing order, colours all in one colour space (not Pattern or Indexed) of this document.

Returns

PdfFunction
The function, a new indirect dictionary: an exponential function (Type 2, exponent 1) when the stops make one blend, else a stitching function (Type 3) of one exponential function per blend, its Bounds the offsets where blends meet.

Remarks

ISO 32000-2 §7.10.3 (Table 40) and §7.10.4 (Table 41), PDF 1.3. Before the first stop the first colour applies, after the last the last; two stops at one offset make a hard edge there. Its outputs are the components of the stops' colour space, so it can colour an axial, radial or mesh shading in that space. Records PDF 1.3. A mutation.