配色方案定义了从 ThemeColorType
成员到用于渲染它们的实际颜色的映射。
方法
方法 | 返回类型 | 简介 |
---|---|---|
getConcreteColor(theme) | Color | 返回与此配色方案中的 ThemeColorType 相关联的具体 Color 。 |
getThemeColors() | ThemeColorType[] | 返回配色方案中所有可能的主题颜色类型的列表。 |
setConcreteColor(type, color) | ColorScheme | 将与此配色方案中的 ThemeColorType 相关联的具体颜色设为指定颜色。 |
setConcreteColor(type, red, green, blue) | ColorScheme | 将与此配色方案中的 ThemeColorType 相关联的具体颜色设为 RGB 格式的指定颜色。 |
setConcreteColor(type, hexColor) | ColorScheme | 将与此配色方案中的 ThemeColorType 关联的具体颜色设置为十六进制格式的指定颜色。 |
详细文档
getConcreteColor(theme)
返回与该配色方案中的 ThemeColorType
相关联的具体 Color
。
返回的颜色肯定不是 ThemeColor
的实例。
参数
名称 | 类型 | 说明 |
---|---|---|
theme | ThemeColorType | 用于派生具体颜色的主题颜色。 |
返回
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 | ThemeColorType | 主题颜色类型。 |
color | Color | 要将主题颜色类型设为的颜色。 |
返回
ColorScheme
- 此配色方案。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
setConcreteColor(type, red, green, blue)
将与此配色方案中的 ThemeColorType
相关联的具体颜色设为 RGB 格式的指定颜色。
参数
名称 | 类型 | 说明 |
---|---|---|
type | ThemeColorType | 主题颜色类型。 |
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 | ThemeColorType | 主题颜色类型。 |
hexColor | String | 要设置主题颜色类型的十六进制颜色,例如 '#F304a7'。 |
返回
ColorScheme
- 此配色方案。
授权
使用此方法的脚本需要通过以下一个或多个范围进行授权:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations