Table of Contents

Class AxialShading

Namespace
UglyToad.PdfPig.Graphics.Colors
Assembly
UglyToad.PdfPig.dll

Axial shadings (type 2) define a colour blend along a line between two points, optionally extended beyond the boundary points by continuing the boundary colours.

public sealed class AxialShading : Shading
Inheritance
AxialShading
Inherited Members

Constructors

AxialShading(bool, DictionaryToken, ColorSpaceDetails, PdfRectangle?, double[], double[], double[], PdfFunction[], bool[])

Create a new AxialShading.

public AxialShading(bool antiAlias, DictionaryToken shadingDictionary, ColorSpaceDetails colorSpace, PdfRectangle? bbox, double[] background, double[] coords, double[] domain, PdfFunction[] functions, bool[] extend)

Parameters

antiAlias bool
shadingDictionary DictionaryToken
colorSpace ColorSpaceDetails
bbox PdfRectangle?
background double[]
coords double[]
domain double[]
functions PdfFunction[]
extend bool[]

Properties

Coords

(Required) An array of four numbers [x0 y0 x1 y1] specifying the starting and ending coordinates of the axis, expressed in the shading's target coordinate space.

public double[] Coords { get; }

Property Value

double[]

Domain

(Optional) An array of two numbers [t0 t1] specifying the limiting values of a parametric variable t. The variable is considered to vary linearly between these two values as the colour gradient varies between the starting and ending points of the axis. The variable t becomes the input argument to the colour function(s). Default value: [0.0 1.0].

public double[] Domain { get; }

Property Value

double[]

Extend

(Optional) An array of two boolean values specifying whether to extend the shading beyond the starting and ending points of the axis, respectively. Default value: [false false].

public bool[] Extend { get; }

Property Value

bool[]

Functions

(Required) A 1-in, n-out function or an array of n 1-in, 1-out functions (where n is the number of colour components in the shading dictionary's colour space). The function(s) shall be called with values of the parametric variable t in the domain defined by the Domain entry. Each function's domain shall be a superset of that of the shading dictionary. If the value returned by the function for a given colour component is out of range, it shall be adjusted to the nearest valid value.

public override PdfFunction[] Functions { get; }

Property Value

PdfFunction[]