[]
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.
IColorStop Add(double position)
Function Add(position As Double) As IColorStop
| Type | Name | Description |
|---|---|---|
| double | position | The relative position of the gradient stop, from 0.0 to 1.0. |
| Type | Description |
|---|---|
| IColorStop | The new IColorStop object. |
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;