Class Gradient
Inheritance
Implements
Namespace: IronPPT.Models
Assembly: IronPPT.dll
Syntax
public class Gradient : Object, IGradient
Gradient is the fill that blends one color into another across a shape, the smooth transition a flat color cannot give. Use it when a slide element needs a graduated background, defined by the colors it passes through and the angle along which they shade.
The colors live in StopPoints, a List<IGradientStop> where each stop pairs a color with a position along the blend, so the fill runs through the stops in order. LinearShadeAngle, an IRotation, sets the direction the gradient travels across the shape, turning a top-to-bottom blend into a diagonal or side-to-side one. LinearShadeScaled, a nullable bool, controls whether the linear shade scales with the shape's dimensions, leaving the default behavior in place when null. Add at least two stops for a visible blend, order them from start to end, and set the angle to aim the transition. Assign the configured Gradient to the element's fill so it renders with the shape. To place and style the shape it fills, begin from the slide element workflow.
using IronPPT.Models;
var gradient = new Gradient();
gradient.StopPoints = new List<IGradientStop>();The slide element tutorial styles elements on a slide, and the GradientStop reference details the color stops a gradient holds.
Constructors
Gradient()
Declaration
public Gradient()
Properties
LinearShadeAngle
Declaration
public IRotation LinearShadeAngle { get; set; }
Property Value
| Type | Description |
|---|---|
| IRotation |
LinearShadeScaled
Declaration
public Nullable<bool> LinearShadeScaled { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.Boolean> |
StopPoints
Declaration
public List<IGradientStop> StopPoints { get; set; }
Property Value
| Type | Description |
|---|---|
| System.Collections.Generic.List<IGradientStop> |