[]
        
(Showing Draft Content)

GrapeCity.Documents.Excel.IColorStops

IColorStops Interface

Represents a collection of IColorStop objects for a linear or rectangular gradient fill.

Use this interface to access, add, clear, or iterate gradient stops in a cell or range gradient fill. You can get this collection from ColorStops or ColorStops.

Namespace: GrapeCity.Documents.Excel
Assembly: DS.Documents.Excel.dll
Syntax
public interface IColorStops : IEnumerable
Public Interface IColorStops
    Inherits IEnumerable
Examples
IRange range = worksheet.Range["A1"];
range.Interior.Pattern = Pattern.LinearGradient;

ILinearGradient gradient = (ILinearGradient) range.Interior.Gradient;
IColorStops colorStops = gradient.ColorStops;

colorStops[0].Color = Color.Red;
colorStops[1].Color = Color.Blue;

IColorStop middleStop = colorStops.Add(0.5);
middleStop.Color = Color.Yellow;

Properties

Name Description
Count

Gets the number of gradient stops in the collection.

this[int]

Gets the IColorStop object at the specified index in the collection.

Methods

Name Description
Add(double)

Adds a gradient stop at the specified relative position and returns the new IColorStop object.

The position value must be between 0.0 and 1.0, where 0.0 represents the start of the gradient and 1.0 represents the end.

Clear()

Clears all gradient stops from the collection.