配色方案定义了从 ThemeColorType 的成员到用于渲染它们的实际颜色的映射。
方法
| 方法 | 返回类型 | 简介 |
|---|---|---|
get | Color | 返回与此颜色方案中的 Theme 关联的具体 Color。 |
get | Theme | 返回配色方案中所有可能的主题颜色类型的列表。 |
set | Color | 将此配色方案中与 Theme 关联的具体颜色设置为指定颜色。 |
set | Color | 将此配色方案中与 Theme 关联的具体颜色设置为以 RGB 格式表示的指定颜色。 |
set | Color | 将此配色方案中与 Theme 关联的具体颜色设置为以十六进制格式表示的指定颜色。 |
详细文档
getConcreteColor(theme)
返回与此颜色方案中的 ThemeColorType 关联的具体 Color。
返回的颜色保证不是 ThemeColor 的实例。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
theme | Theme | 用于派生具体颜色的主题颜色。 |
返回
Color - 相应方案中与主题颜色类型对应的具体颜色。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
getThemeColors()
返回配色方案中所有可能的主题颜色类型的列表。
返回
ThemeColorType[] - 此方案中可能的主题颜色类型。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setConcreteColor(type, color)
将此配色方案中与 ThemeColorType 关联的具体颜色设置为指定颜色。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
type | Theme | 主题颜色类型。 |
color | Color | 要将主题背景颜色类型设置成的颜色。 |
返回
ColorScheme - 此配色方案,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setConcreteColor(type, red, green, blue)
将此配色方案中与 ThemeColorType 关联的具体颜色设置为以 RGB 格式表示的指定颜色。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
type | Theme | 主题颜色类型。 |
red | Integer | 要将主题颜色类型设置为的颜色的红色值(介于 0 和 255 之间)。 |
green | Integer | 要将主题颜色类型设置为的颜色的绿色值(介于 0 和 255 之间)。 |
blue | Integer | 要将主题颜色类型设置为的颜色的蓝色值(介于 0 和 255 之间)。 |
返回
ColorScheme - 此配色方案,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations
setConcreteColor(type, hexColor)
将此配色方案中与 ThemeColorType 关联的具体颜色设置为以十六进制格式表示的指定颜色。
十六进制字符串必须采用“#RRGGBB”格式。
参数
| 名称 | 类型 | 说明 |
|---|---|---|
type | Theme | 主题颜色类型。 |
hex | String | 要将主题颜色类型设置为的十六进制颜色,例如“#F304a7”。 |
返回
ColorScheme - 此配色方案,用于链式调用。
授权
使用此方法的脚本需要获得以下一项或多项范围的授权:
-
https://www.googleapis.com/auth/presentations.currentonly -
https://www.googleapis.com/auth/presentations