GradientFill
GradientFill class
Represents the gradient fill.
class GradientFill;
Properties
| Property | Type | Description |
|---|---|---|
| gradientStops | GradientStopCollection | Readonly. Represents the gradient stop collection. |
| fillType | GradientFillType | Readonly. Gets the gradient fill type. |
| directionType | GradientDirectionType | Readonly. Gets the gradient direction type. |
| angle | number | The angle of linear fill. |
Methods
| Method | Description |
|---|---|
| getGradientStops() | @deprecated. Please use the ‘gradientStops’ property instead. Represents the gradient stop collection. |
| getFillType() | @deprecated. Please use the ‘fillType’ property instead. Gets the gradient fill type. |
| getDirectionType() | @deprecated. Please use the ‘directionType’ property instead. Gets the gradient direction type. |
| getAngle() | @deprecated. Please use the ‘angle’ property instead. The angle of linear fill. |
| setAngle(number) | @deprecated. Please use the ‘angle’ property instead. 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. |
gradientStops
Readonly. Represents the gradient stop collection.
gradientStops : GradientStopCollection;
fillType
Readonly. Gets the gradient fill type.
fillType : GradientFillType;
directionType
Readonly. Gets the gradient direction type.
directionType : GradientDirectionType;
angle
The angle of linear fill.
angle : number;
getGradientStops()
@deprecated. Please use the ‘gradientStops’ property instead. Represents the gradient stop collection.
getGradientStops() : GradientStopCollection;
Returns
getFillType()
@deprecated. Please use the ‘fillType’ property instead. Gets the gradient fill type.
getFillType() : GradientFillType;
Returns
getDirectionType()
@deprecated. Please use the ‘directionType’ property instead. Gets the gradient direction type.
getDirectionType() : GradientDirectionType;
Returns
getAngle()
@deprecated. Please use the ‘angle’ property instead. The angle of linear fill.
getAngle() : number;
setAngle(number)
@deprecated. Please use the ‘angle’ property instead. 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;