Class Fill

  • Fill describes the background of a page element.

  • You can get the solid fill, fill type, and visibility status of a fill.

  • Solid fills can be set using Color objects, RGB values, hex strings, or ThemeColorType.

  • You can set the fill to transparent.

Fill

Describes the page element's background

Methods

MethodReturn typeBrief description
getSolidFill()SolidFill|nullGet the solid fill of this background, or null if the fill type is not FillType.SOLID.
getType()FillTypeGet the type of this fill.
isVisible()BooleanWhether the background is visible.
setSolidFill(color)voidSets the solid fill to the given Color.
setSolidFill(color, alpha)voidSets the solid fill to the given alpha and Color.
setSolidFill(red, green, blue)voidSets the solid fill to the given RGB values.
setSolidFill(red, green, blue, alpha)voidSets the solid fill to the given alpha and RGB values.
setSolidFill(hexString)voidSets the solid fill to the given hex color string.
setSolidFill(hexString, alpha)voidSets the solid fill to the given alpha and hex color string.
setSolidFill(color)voidSets the solid fill to the given ThemeColorType.
setSolidFill(color, alpha)voidSets the solid fill to the given alpha and ThemeColorType.
setTransparent()voidSets the background to transparent.

Detailed documentation

getSolidFill()

Get the solid fill of this background, or null if the fill type is not FillType.SOLID.

Return

SolidFill|null — The solid fill setting, or null if this fill type is not solid.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

getType()

Get the type of this fill.

Return

FillType — The type of this fill.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

isVisible()

Whether the background is visible.

Return

Booleantrue if the background is visible; false otherwise.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSolidFill(color)

Sets the solid fill to the given Color.

Parameters

NameTypeDescription
colorColorThe color to set.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSolidFill(color, alpha)

Sets the solid fill to the given alpha and Color.

Parameters

NameTypeDescription
colorColorThe color to set.
alphaNumberThe alpha value (transparency).

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSolidFill(red, green, blue)

Sets the solid fill to the given RGB values.

Parameters

NameTypeDescription
redIntegerThe red component.
greenIntegerThe green component.
blueIntegerThe blue component.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSolidFill(red, green, blue, alpha)

Sets the solid fill to the given alpha and RGB values.

Parameters

NameTypeDescription
redIntegerThe red component.
greenIntegerThe green component.
blueIntegerThe blue component.
alphaNumberThe alpha value (transparency).

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSolidFill(hexString)

Sets the solid fill to the given hex color string.

Parameters

NameTypeDescription
hexStringStringThe hex color string.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSolidFill(hexString, alpha)

Sets the solid fill to the given alpha and hex color string.

Parameters

NameTypeDescription
hexStringStringThe hex color string.
alphaNumberThe alpha value (transparency).

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSolidFill(color)

Sets the solid fill to the given ThemeColorType.

Parameters

NameTypeDescription
colorThemeColorTypeThe theme color type.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setSolidFill(color, alpha)

Sets the solid fill to the given alpha and ThemeColorType.

Parameters

NameTypeDescription
colorThemeColorTypeThe theme color type.
alphaNumberThe alpha value (transparency).

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations

setTransparent()

Sets the background to transparent.

Authorization

Scripts that use this method require authorization with one or more of the following scopes:

  • https://www.googleapis.com/auth/presentations.currentonly
  • https://www.googleapis.com/auth/presentations