[]
Represents the ILinearGradient object that transitions through a series of colors in a linear manner along a specific angle.
Use this interface to configure a linear gradient fill by defining its color stops and the angle of the gradient direction.
public interface ILinearGradient
Public Interface ILinearGradient
IRange range = worksheet.Range["A1"];
range.Interior.Pattern = Pattern.LinearGradient;
ILinearGradient gradient = (ILinearGradient) range.Interior.Gradient;
gradient.Degree = 45;
gradient.ColorStops.Add(0).Color = Color.Red;
gradient.ColorStops.Add(1).Color = Color.Blue;
bool hasRed = Enumerable.Range(0, gradient.ColorStops.Count).Any(i => gradient.ColorStops[i].Color.ToArgb() == Color.Red.ToArgb());
bool hasBlue = Enumerable.Range(0, gradient.ColorStops.Count).Any(i => gradient.ColorStops[i].Color.ToArgb() == Color.Blue.ToArgb());
| Name | Description |
|---|---|
| ColorStops | Gets the IColorStops for the ILinearGradient object. Use the returned collection to access or add the color stops that define the linear gradient transition. |
| Degree | Gets or sets the angle of the linear gradient fill within a selection. Use this property to get or set the direction of the ILinearGradient transition. |