Table of Contents

Class Gradient

Namespace
Rustaveli.Pdf
Assembly
Rustaveli.Pdf.dll

A linear blend of two or more inks along a line at an angle across the box it fills, evenly spaced or at the positions given.

public sealed class Gradient
Inheritance
Gradient
Inherited Members

Remarks

At 0 degrees the blend runs from left to right, and the angle turns it clockwise: 90 runs from top to bottom. As in CSS, the line is long enough that the box's corners take the first and last inks exactly, whatever the angle.

Constructors

Gradient(float, params GradientStop[])

A blend at angle degrees through stops, each ink at its position along the line, from 0 at its start to 1 at its end.

public Gradient(float angle, params GradientStop[] stops)

Parameters

angle float
stops GradientStop[]

Exceptions

ArgumentException

Fewer than two stops, positions outside 0 to 1 or out of order, inks of different opacity, or an angle that is not a finite number.

Gradient(float, params Ink[])

A blend at angle degrees through inks, evenly spaced, in order.

public Gradient(float angle, params Ink[] inks)

Parameters

angle float
inks Ink[]

Exceptions

ArgumentException

Fewer than two inks, inks of different opacity, or an angle that is not a finite number.

Properties

Angle

The direction of the blend in degrees, clockwise from left to right.

public float Angle { get; }

Property Value

float

Inks

The inks blended, first to last.

public IReadOnlyList<Ink> Inks { get; }

Property Value

IReadOnlyList<Ink>

Opacity

The opacity the whole blend is drawn at.

public float Opacity { get; }

Property Value

float

Positions

Where each ink lies along the blend, from 0 at its start to 1 at its end.

public IReadOnlyList<float> Positions { get; }

Property Value

IReadOnlyList<float>

Methods

Across(params Ink[])

A blend from left to right.

public static Gradient Across(params Ink[] inks)

Parameters

inks Ink[]

Returns

Gradient

Down(params Ink[])

A blend from top to bottom.

public static Gradient Down(params Ink[] inks)

Parameters

inks Ink[]

Returns

Gradient