• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class CellFill

Represents the fill formatting for a cell, including solid colors and patterns.

Inheritance
object
CellFill
FormattableCellFill
FormattingCellFill
Implements
IEquatable<CellFill>
Inherited Members
object.ToString()
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetType()
object.MemberwiseClone()
Namespace: DRIT.Spreadsheet
Assembly: DRIT.Spreadsheet.dll
Syntax
public class CellFill : IEquatable<CellFill>
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

Examples
// Create a solid fill
var fill = CellFill.CreatePattern(Color.White, Color.Blue, PatternType.Solid);

// Create a gradient fill
var gradientFill = CellFill.CreateGradient(GradientType.Linear, 90, Color.Red, Color.Blue);

Constructors

CellFill()

Initializes a new CellFill for the supplied workbook data.

Declaration
public CellFill()
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

CellFill(CellFill)

Initializes a new CellFill for the supplied workbook data.

Declaration
public CellFill(CellFill fill)
Parameters
Type Name Description
CellFill fill
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

Properties

BackgroundColor

Specifies the background color as a Color.

Declaration
public Color BackgroundColor { get; set; }
Property Value
Type Description
Color
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

BackgroundSpreadsheetColor

Specifies the background color behind the pattern.

Declaration
public virtual SpreadsheetColor BackgroundSpreadsheetColor { get; set; }
Property Value
Type Description
SpreadsheetColor
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

Gradient

Specifies the gradient fill settings for this fill.

Declaration
public virtual GradientCellFill Gradient { get; set; }
Property Value
Type Description
GradientCellFill
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

PatternColor

Specifies the pattern color as a Color.

Declaration
public virtual Color PatternColor { get; set; }
Property Value
Type Description
Color
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

PatternSpreadsheetColor

Specifies the color of the pattern or gradient stop.

Declaration
public virtual SpreadsheetColor PatternSpreadsheetColor { get; set; }
Property Value
Type Description
SpreadsheetColor
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

Type

Specifies the fill pattern type (Solid, None, Gray125, etc.).

Declaration
public virtual PatternType Type { get; set; }
Property Value
Type Description
PatternType
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

Methods

CreateGradient(GradientType, double, params SpreadsheetColor[])

Exposes the create gradient associated with CellFill.

Declaration
public static CellFill CreateGradient(GradientType gradientType, double degree, params SpreadsheetColor[] stopColors)
Parameters
Type Name Description
GradientType gradientType

The gradient type used by the operation.

double degree

The degree used by the operation.

SpreadsheetColor[] stopColors

The stop colors used by the operation.

Returns
Type Description
CellFill

The create gradient returned by the operation.

Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

CreateGradient(GradientType, double, params Color[])

Exposes the create gradient associated with CellFill.

Declaration
public static CellFill CreateGradient(GradientType gradientType, double degree, params Color[] stopColors)
Parameters
Type Name Description
GradientType gradientType

The gradient type used by the operation.

double degree

The degree used by the operation.

Color[] stopColors

The stop colors used by the operation.

Returns
Type Description
CellFill

The create gradient returned by the operation.

Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

CreatePattern(SpreadsheetColor, SpreadsheetColor, PatternType)

Exposes the create pattern associated with CellFill.

Declaration
public static CellFill CreatePattern(SpreadsheetColor backgroundColor, SpreadsheetColor patternColor, PatternType patternType)
Parameters
Type Name Description
SpreadsheetColor backgroundColor

The background color used by the operation.

SpreadsheetColor patternColor

The pattern color used by the operation.

PatternType patternType

The pattern type used by the operation.

Returns
Type Description
CellFill

The create pattern returned by the operation.

Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

CreatePattern(SpreadsheetColor, PatternType)

Exposes the create pattern associated with CellFill.

Declaration
public static CellFill CreatePattern(SpreadsheetColor patternColor, PatternType patternType)
Parameters
Type Name Description
SpreadsheetColor patternColor

The pattern color used by the operation.

PatternType patternType

The pattern type used by the operation.

Returns
Type Description
CellFill

The create pattern returned by the operation.

Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

CreatePattern(Color, Color, PatternType)

Exposes the create pattern associated with CellFill.

Declaration
public static CellFill CreatePattern(Color backgroundColor, Color patternColor, PatternType patternType)
Parameters
Type Name Description
Color backgroundColor

The background color used by the operation.

Color patternColor

The pattern color used by the operation.

PatternType patternType

The pattern type used by the operation.

Returns
Type Description
CellFill

The create pattern returned by the operation.

Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

CreateSolidFill(SpreadsheetColor)

Exposes the create solid fill associated with CellFill.

Declaration
public static CellFill CreateSolidFill(SpreadsheetColor color)
Parameters
Type Name Description
SpreadsheetColor color

The color used by the operation.

Returns
Type Description
CellFill

The create solid fill returned by the operation.

Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

Equals(CellFill)

Exposes the equals associated with CellFill.

Declaration
public virtual bool Equals(CellFill fill)
Parameters
Type Name Description
CellFill fill

The fill used by the operation.

Returns
Type Description
bool

The equals returned by the operation.

Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

Equals(object)

Exposes the equals associated with CellFill.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The obj used by the operation.

Returns
Type Description
bool

The equals returned by the operation.

Overrides
object.Equals(object)
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

GetHashCode()

Retrieves the requested hash code from the CellFill.

Declaration
public override int GetHashCode()
Returns
Type Description
int

The get hash code returned by the operation.

Overrides
object.GetHashCode()
Remarks

A CellFill defines the background appearance of a cell, including solid colors, patterns, and gradients. The fill can be applied to individual cells or ranges.

Use CreatePattern for solid and pattern fills, or CreateGradient for gradient fills.

Implements

IEquatable<T>
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX