New to Telerik Document ProcessingStart a free 30-day trial

Two-color gradient fill for cell backgrounds, blending between Color1 and Color2 along the specified direction.

Definition

Namespace:Telerik.Windows.Documents.Spreadsheet.Model

Assembly:Telerik.Windows.Documents.Spreadsheet.dll

Syntax:

C#
public class GradientFill : IFill

Inheritance: objectGradientFill

Implements: IFill

Constructors

Initializes a new GradientFill with the specified direction and explicit RGB colors.

C#
public GradientFill(GradientType gradientType, Color color1, Color color2)
Parameters:gradientTypeGradientType

Type of the gradient.

color1Color

The first color.

color2Color

The second color.

Initializes a new GradientFill with the specified direction and theme-aware colors.

C#
public GradientFill(GradientType gradientType, ThemableColor color1, ThemableColor color2)
Parameters:gradientTypeGradientType

Type of the gradient.

color1ThemableColor

The first color.

color2ThemableColor

The second color.

Properties

Gets the starting color in the gradient blend.

C#
public ThemableColor Color1 { get; }
Property Value:

The first color.

Gets the ending color in the gradient blend.

C#
public ThemableColor Color2 { get; }
Property Value:

The second color.

Gets the gradient direction and pattern (Horizontal, Vertical, DiagonalUp, FromCenter, etc.).

C#
public GradientType GradientType { get; }
Property Value:

The type of the gradient.

Methods

Determines whether the specified object is equal to the current object.

C#
public override bool Equals(object obj)
Parameters:objobject

The object to compare with the current object.

Returns:

bool

True if the specified object is equal to the current object; otherwise, false.

Overrides: object.Equals(object)

Serves as a hash function for a particular type.

C#
public override int GetHashCode()
Returns:

int

A hash code for the current object.

Overrides: object.GetHashCode()