Class Gradient
Represents a gradient fill.
Inheritance
Namespace: IronWord.Models
Assembly: IronWord.dll
Syntax
public class Gradient : Object
A multi-color fill that blends along an angle, applied to Word text, is configured through Gradient. You build one from its color stops and a direction, then attach it to the GradientEffect property of a TextEffect so the run renders with the blend.
The stops live in StopPoints, a List<GradientStop> where each entry pairs a color with the position along the gradient where that color lands. LinearShadeAngle sets the direction of the blend as a nullable double, and LinearShadeScaled is a nullable bool that controls whether the shade scales with the shape. For a quick starting point, the static DefaultGray returns a ready-made gray gradient you can apply directly or use as a template before swapping in your own stops. Order the entries in StopPoints by their stop positions so the colors blend in the intended sequence.
Gradient gradient = Gradient.DefaultGray;
gradient.LinearShadeAngle = 45;The gradient text effect how-to covers configuring the blend, and the gradient effect example shows it on a run.
Constructors
Gradient()
Declaration
public Gradient()
Fields
DefaultGray
Declaration
public static Gradient DefaultGray
Field Value
| Type | Description |
|---|---|
| Gradient |
Properties
LinearShadeAngle
Gets or sets the angle of the linear shade.
Declaration
public Nullable<double> LinearShadeAngle { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Double> |
LinearShadeScaled
Gets or sets a value indicating whether the linear shade is scaled.
Declaration
public Nullable<bool> LinearShadeScaled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
StopPoints
Gets or sets the list of gradient stops defining the gradient fill.
Declaration
public List<GradientStop> StopPoints { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<GradientStop> |