ExcelScript.ShapeFill interface

Represents the fill formatting of a shape object.

Methods

clear()

Clears the fill formatting of this shape.

getForegroundColor()

Represents the shape fill foreground color in HTML color format, in the form #RRGGBB (e.g., "FFA500") or as a named HTML color (e.g., "orange")

getTransparency()

Specifies the transparency percentage of the fill as a value from 0.0 (opaque) through 1.0 (clear). Returns null if the shape type does not support transparency or the shape fill has inconsistent transparency, such as with a gradient fill type.

getType()

Returns the fill type of the shape. See ExcelScript.ShapeFillType for details.

setForegroundColor(foregroundColor)

Represents the shape fill foreground color in HTML color format, in the form #RRGGBB (e.g., "FFA500") or as a named HTML color (e.g., "orange")

setSolidColor(color)

Sets the fill formatting of the shape to a uniform color. This changes the fill type to "Solid".

setTransparency(transparency)

Specifies the transparency percentage of the fill as a value from 0.0 (opaque) through 1.0 (clear). Returns null if the shape type does not support transparency or the shape fill has inconsistent transparency, such as with a gradient fill type.

Method Details

clear()

Clears the fill formatting of this shape.

clear(): void;

Returns

void

getForegroundColor()

Represents the shape fill foreground color in HTML color format, in the form #RRGGBB (e.g., "FFA500") or as a named HTML color (e.g., "orange")

getForegroundColor(): string;

Returns

string

getTransparency()

Specifies the transparency percentage of the fill as a value from 0.0 (opaque) through 1.0 (clear). Returns null if the shape type does not support transparency or the shape fill has inconsistent transparency, such as with a gradient fill type.

getTransparency(): number;

Returns

number

getType()

Returns the fill type of the shape. See ExcelScript.ShapeFillType for details.

getType(): ShapeFillType;

Returns

setForegroundColor(foregroundColor)

Represents the shape fill foreground color in HTML color format, in the form #RRGGBB (e.g., "FFA500") or as a named HTML color (e.g., "orange")

setForegroundColor(foregroundColor: string): void;

Parameters

foregroundColor

string

Returns

void

setSolidColor(color)

Sets the fill formatting of the shape to a uniform color. This changes the fill type to "Solid".

setSolidColor(color: string): void;

Parameters

color

string

A string that represents the fill color in HTML color format, in the form #RRGGBB (e.g., "FFA500") or as a named HTML color (e.g., "orange").

Returns

void

setTransparency(transparency)

Specifies the transparency percentage of the fill as a value from 0.0 (opaque) through 1.0 (clear). Returns null if the shape type does not support transparency or the shape fill has inconsistent transparency, such as with a gradient fill type.

setTransparency(transparency: number): void;

Parameters

transparency

number

Returns

void