GradientFill
Contents
[
Hide
]GradientFill class
Represents the gradient fill.
class GradientFill;
Methods
Method | Description |
---|---|
getGradientStops() | Represents the gradient stop collection. |
getFillType() | Gets the gradient fill type. |
getDirectionType() | Gets the gradient direction type. |
getAngle() | The angle of linear fill. |
setAngle(number) | The angle of linear fill. |
setGradient(GradientFillType, number, GradientDirectionType) | Set the gradient fill type and direction. |
setPresetThemeGradient(PresetThemeGradientType, ThemeColorType) | Sets preset theme gradient fill. |
setOneColorGradient(Color, number, GradientStyleType, number) | Sets the specified fill to a one-color gradient. Only applies for Excel 2007. |
setTwoColorGradient(Color, Color, GradientStyleType, number) | Sets the specified fill to a two-color gradient. Only applies for Excel 2007. |
setTwoColorGradient(Color, number, Color, number, GradientStyleType, number) | Sets the specified fill to a two-color gradient. Only applies for Excel 2007. |
isNull() | Checks whether the implementation object is null. |
getGradientStops()
Represents the gradient stop collection.
getGradientStops() : GradientStopCollection;
Returns
getFillType()
Gets the gradient fill type.
getFillType() : GradientFillType;
Returns
getDirectionType()
Gets the gradient direction type.
getDirectionType() : GradientDirectionType;
Returns
getAngle()
The angle of linear fill.
getAngle() : number;
setAngle(number)
The angle of linear fill.
setAngle(value: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
value | number | The value to set. |
setGradient(GradientFillType, number, GradientDirectionType)
Set the gradient fill type and direction.
setGradient(type: GradientFillType, angle: number, direction: GradientDirectionType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
type | GradientFillType | Gradient fill type. |
angle | number | The angle. Only applies for GradientFillType.Linear. |
direction | GradientDirectionType | The direction type. Only applies for GradientFillType.Radial and GradientFillType.Rectangle. |
setPresetThemeGradient(PresetThemeGradientType, ThemeColorType)
Sets preset theme gradient fill.
setPresetThemeGradient(gradientType: PresetThemeGradientType, themeColorType: ThemeColorType) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
gradientType | PresetThemeGradientType | The preset gradient type. |
themeColorType | ThemeColorType | The theme color type. |
setOneColorGradient(Color, number, GradientStyleType, number)
Sets the specified fill to a one-color gradient. Only applies for Excel 2007.
setOneColorGradient(color: Color, degree: number, style: GradientStyleType, variant: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
color | Color | One gradient color. |
degree | number | The gradient degree. Can be a value from 0.0 (dark) through 1.0 (light). |
style | GradientStyleType | Gradient shading style. |
variant | number | The 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(Color, Color, GradientStyleType, number)
Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
setTwoColorGradient(color1: Color, color2: Color, style: GradientStyleType, variant: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
color1 | Color | One gradient color. |
color2 | Color | Two gradient color. |
style | GradientStyleType | Gradient shading style. |
variant | number | The 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(Color, number, Color, number, GradientStyleType, number)
Sets the specified fill to a two-color gradient. Only applies for Excel 2007.
setTwoColorGradient(color1: Color, transparency1: number, color2: Color, transparency2: number, style: GradientStyleType, variant: number) : void;
Parameters:
Parameter | Type | Description |
---|---|---|
color1 | Color | One gradient color. |
transparency1 | number | The degree of transparency of the color1 as a value from 0.0 (opaque) through 1.0 (clear). |
color2 | Color | Two gradient color. |
transparency2 | number | The degree of transparency of the color2 as a value from 0.0 (opaque) through 1.0 (clear). |
style | GradientStyleType | Gradient shading style. |
variant | number | The 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. |
isNull()
Checks whether the implementation object is null.
isNull() : boolean;