Class GradientCellFill
Represents a gradient fill for cell backgrounds.
Inherited Members
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public class GradientCellFill
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Examples
// Create a linear gradient from red to blue
var gradient = new GradientCellFill(GradientType.Linear, 90, Color.Red, Color.Blue);
Constructors
GradientCellFill()
Initializes a new GradientCellFill for the supplied workbook data.
Declaration
public GradientCellFill()
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
GradientCellFill(GradientType, double, params SpreadsheetColor[])
Initializes a new GradientCellFill for the supplied workbook data.
Declaration
public GradientCellFill(GradientType gradientType, double degree, params SpreadsheetColor[] stopColors)
Parameters
| Type | Name | Description |
|---|---|---|
| GradientType | gradientType | |
| double | degree | |
| SpreadsheetColor[] | stopColors |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
GradientCellFill(GradientType, double, params Color[])
Initializes a new GradientCellFill for the supplied workbook data.
Declaration
public GradientCellFill(GradientType gradientType, double degree, params Color[] stopColors)
Parameters
| Type | Name | Description |
|---|---|---|
| GradientType | gradientType | |
| double | degree | |
| Color[] | stopColors |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Properties
Bottom
Specifies the bottom boundary position for path gradients.
Declaration
public double Bottom { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Degree
Specifies the angle of the gradient in degrees.
Declaration
public double Degree { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
GradientType
Specifies the gradient type (Linear or Path).
Declaration
public GradientType GradientType { get; set; }
Property Value
| Type | Description |
|---|---|
| GradientType |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Left
Specifies the left boundary position for path gradients.
Declaration
public double Left { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Right
Specifies the right boundary position for path gradients.
Declaration
public double Right { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Stops
Gets the list of gradient color stops.
Declaration
public List<GradientStop> Stops { get; }
Property Value
| Type | Description |
|---|---|
| List<GradientStop> |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Top
Specifies the top boundary position for path gradients.
Declaration
public double Top { get; set; }
Property Value
| Type | Description |
|---|---|
| double |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Methods
CreateRectangularGradientFill(double, double, double, double, params Color[])
Exposes the create rectangular gradient fill associated with GradientCellFill.
Declaration
public static GradientCellFill CreateRectangularGradientFill(double left, double right, double top, double bottom, params Color[] stopColors)
Parameters
| Type | Name | Description |
|---|---|---|
| double | left | |
| double | right | |
| double | top | |
| double | bottom | |
| Color[] | stopColors |
Returns
| Type | Description |
|---|---|
| GradientCellFill | The create rectangular gradient fill returned by the operation. |
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
Equals(object)
Exposes the equals associated with GradientCellFill.
Declaration
public override bool Equals(object fill)
Parameters
| Type | Name | Description |
|---|---|---|
| object | fill | The fill used by the operation. |
Returns
| Type | Description |
|---|---|
| bool | The equals returned by the operation. |
Overrides
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.
GetHashCode()
Retrieves the requested hash code from the GradientCellFill.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | The get hash code returned by the operation. |
Overrides
Remarks
A GradientCellFill defines a smooth transition between multiple colors.
Gradients can be linear (straight line) or path-based, with multiple color stops.
Use CellFill.CreateGradient factory methods to create gradient fills.