GradientFill

GradientFill class

Represents the gradient fill.

Methods

NameDescription
equals(obj)/
getAngle()The angle of linear fill.
getDirectionType()Gets the gradient direction type. The value of the property is GradientDirectionType integer constant.
getFillType()Gets the gradient fill type. The value of the property is GradientFillType integer constant.
getGradientColor1()Gets gradient color 1. Applies to Excel97-2003
getGradientColor2()Gets gradient color 2. Applies to Excel97-2003
getGradientColorType()Gets gradient color type. Applies to Excel97-2003 The value of the property is GradientColorType integer constant.
getGradientDegree()Gets gradient degree. Applies to Excel97-2003
getGradientStops()Represents the gradient stop collection.
getGradientStyle()Gets gradient style type. Applies to Excel97-2003 The value of the property is GradientStyleType integer constant.
getPresetColor()Returns the gradient preset color for the specified fill. Applies to Excel97-2003 The value of the property is GradientP
getVariant()Gets variant. Applies to Excel97-2003
hashCode()Gets the hash code.
setAngle()The angle of linear fill.
setGradient(type, angle, direction)Set the gradient fill type and direction.
setOneColorGradient(color, degree, style, variant)Sets the specified fill to a one-color gradient. Only applies for Excel 2007.
setPresetColor()Returns the gradient preset color for the specified fill. Applies to Excel97-2003 The value of the property is GradientP
setPresetColorGradient(presetColor, style, variant)Sets the specified fill to a preset-color gradient. Only applies for Excel 97-2003
setPresetThemeGradient(gradientType, themeColorType)Sets preset theme gradient fill.
setTwoColorGradient(color1, color2, style, variant)Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
setTwoColorGradient(color1, transparency1, color2, transparency2, style, variant)Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

equals(obj)

/

ParameterTypeDescription
objObject

Returns: boolean — boolean

getAngle()

The angle of linear fill.

getDirectionType()

Gets the gradient direction type. The value of the property is GradientDirectionType integer constant.

getFillType()

Gets the gradient fill type. The value of the property is GradientFillType integer constant.

getGradientColor1()

Gets gradient color 1. Applies to Excel97-2003

getGradientColor2()

Gets gradient color 2. Applies to Excel97-2003

getGradientColorType()

Gets gradient color type. Applies to Excel97-2003 The value of the property is GradientColorType integer constant.

getGradientDegree()

Gets gradient degree. Applies to Excel97-2003

getGradientStops()

Represents the gradient stop collection.

getGradientStyle()

Gets gradient style type. Applies to Excel97-2003 The value of the property is GradientStyleType integer constant.

getPresetColor()

Returns the gradient preset color for the specified fill. Applies to Excel97-2003 The value of the property is GradientPresetType integer constant.

getVariant()

Gets variant. Applies to Excel97-2003

hashCode()

Gets the hash code.

Returns: Number — Number

setAngle()

The angle of linear fill.

setGradient(type, angle, direction)

Set the gradient fill type and direction.

ParameterTypeDescription
typeNumberGradientFillType
angleNumberThe angle. Only applies for GradientFillType.Linear.
directionNumberGradientDirectionType

setOneColorGradient(color, degree, style, variant)

Sets the specified fill to a one-color gradient. Only applies for Excel 2007.

ParameterTypeDescription
colorColorOne gradient color.
degreeNumberThe gradient degree. Can be a value from 0.0 (dark) through 1.0 (light).
styleNumberGradientStyleType
variantNumberThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setPresetColor()

Returns the gradient preset color for the specified fill. Applies to Excel97-2003 The value of the property is GradientPresetType integer constant.

setPresetColorGradient(presetColor, style, variant)

Sets the specified fill to a preset-color gradient. Only applies for Excel 97-2003

ParameterTypeDescription
presetColorNumberGradientPresetType
styleNumberGradientStyleType
variantNumberThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setPresetThemeGradient(gradientType, themeColorType)

Sets preset theme gradient fill.

ParameterTypeDescription
gradientTypeNumberPresetThemeGradientType
themeColorTypeNumberThemeColorType

setTwoColorGradient(color1, color2, style, variant)

Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

ParameterTypeDescription
color1ColorOne gradient color.
color2ColorTwo gradient color.
styleNumberGradientStyleType
variantNumberThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.

setTwoColorGradient(color1, transparency1, color2, transparency2, style, variant)

Sets the specified fill to a two-color gradient. Only applies for Excel 2007.

ParameterTypeDescription
color1ColorOne gradient color.
transparency1NumberThe degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear).
color2ColorTwo gradient color.
transparency2NumberThe degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear).
styleNumberGradientStyleType
variantNumberThe gradient variant. Can be a value from 1 through 4, corresponding to one of the four variants on the Gradient tab in the Fill Effects dialog box. If style is GradientStyle.FromCenter, the Variant argument can only be 1 or 2.