Class Fill

填充

描述页面元素的背景

方法

方法返回类型简介
getSolidFill()SolidFill|null获取此背景的纯色填充,如果填充类型不是 FillType.SOLID,则返回 null
getType()FillType获取相应填充的类型。
isVisible()Boolean背景是否可见。
setSolidFill(color)void将纯色填充设置为指定的 Color
setSolidFill(color, alpha)void将纯色填充设置为给定的 Alpha 和 Color
setSolidFill(red, green, blue)void将纯色填充设置为指定的 RGB 值。
setSolidFill(red, green, blue, alpha)void将纯色填充设置为指定的 Alpha 和 RGB 值。
setSolidFill(hexString)void将纯色填充设置为给定的十六进制颜色字符串。
setSolidFill(hexString, alpha)void将纯色填充设置为给定的 Alpha 和十六进制颜色字符串。
setSolidFill(color)void将纯色填充设置为指定的 ThemeColorType
setSolidFill(color, alpha)void将纯色填充设置为给定的 Alpha 和 ThemeColorType
setTransparent()void将背景设置为透明。

详细文档

getSolidFill()

获取此背景的纯色填充,如果填充类型不是 FillType.SOLID,则返回 null

返回

SolidFill|null - 纯色填充设置,如果此填充类型不是纯色,则为 null

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

getType()

获取相应填充的类型。

返回

FillType - 相应填充的类型。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

isVisible()

背景是否可见。

返回

Boolean - 如果背景可见,则为 true;否则为 false

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setSolidFill(color)

将纯色填充设置为指定的 Color

参数

名称类型说明
colorColor要设置的颜色。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setSolidFill(color, alpha)

将纯色填充设置为给定的 Alpha 和 Color

参数

名称类型说明
colorColor要设置的颜色。
alphaNumberAlpha 值(透明度)。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setSolidFill(red, green, blue)

将纯色填充设置为指定的 RGB 值。

参数

名称类型说明
redInteger红色分量。
greenInteger绿色分量。
blueInteger蓝色分量。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setSolidFill(red, green, blue, alpha)

将纯色填充设置为指定的 Alpha 和 RGB 值。

参数

名称类型说明
redInteger红色分量。
greenInteger绿色分量。
blueInteger蓝色分量。
alphaNumberAlpha 值(透明度)。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setSolidFill(hexString)

将纯色填充设置为给定的十六进制颜色字符串。

参数

名称类型说明
hexStringString十六进制颜色字符串。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setSolidFill(hexString, alpha)

将纯色填充设置为给定的 Alpha 和十六进制颜色字符串。

参数

名称类型说明
hexStringString十六进制颜色字符串。
alphaNumberAlpha 值(透明度)。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setSolidFill(color)

将纯色填充设置为指定的 ThemeColorType

参数

名称类型说明
colorThemeColorType主题颜色类型。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setSolidFill(color, alpha)

将纯色填充设置为给定的 Alpha 和 ThemeColorType

参数

名称类型说明
colorThemeColorType主题颜色类型。
alphaNumberAlpha 值(透明度)。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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

setTransparent()

将背景设置为透明。

授权

使用此方法的脚本需要获得以下一项或多项范围的授权:

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