Search Results for

    Show / Hide Table of Contents

    Interface IGradient

    Namespace: IronPPT.Interfaces
    Assembly: IronPPT.dll
    Syntax
    public interface IGradient

    Filling a shape or background with a smooth color blend in C# runs through IGradient. The contract describes a multi-stop gradient: the colors it passes through, the points where each color sits, and the angle the blend follows. A developer works with it while styling a shape fill, where a flat color is not enough and the look calls for one color easing into another.

    A gradient is reached through the fill of the element being styled rather than built in isolation, so an IGradient is usually obtained from the object it decorates and then adjusted. Three members carry the work. StopPoints is a List<IGradientStop> holding each color and its position along the blend, so adding or reordering stops shapes the transition. LinearShadeAngle is an IRotation that sets the direction the gradient runs. LinearShadeScaled, a Nullable<bool>, controls whether the shade scales with the shape. The concrete implementor in IronPPT is the Gradient class, so most code uses Gradient directly and names the interface only when a method should accept any gradient.

    gradient.StopPoints.Add(stop);

    The add shape example builds a styled shape, and the paragraph style example shows related styling work.

    Properties

    LinearShadeAngle

    Declaration
    IRotation LinearShadeAngle { get; set; }
    Property Value
    Type Description
    IRotation

    LinearShadeScaled

    Declaration
    Nullable<bool> LinearShadeScaled { get; set; }
    Property Value
    Type Description
    System.Nullable<System.Boolean>

    StopPoints

    Declaration
    List<IGradientStop> StopPoints { get; set; }
    Property Value
    Type Description
    System.Collections.Generic.List<IGradientStop>
    ☀
    ☾
    Downloads
    • Download with NuGet
    • Start for Free
    In This Article
    Back to top
    Install with NuGet