Class ColorScheme

  • A ColorScheme maps ThemeColorTypes to actual colors used for rendering.

  • You can retrieve the concrete color associated with a ThemeColorType usinggetConcreteColor.

  • The available ThemeColorTypes in a scheme can be listed usinggetThemeColors.

  • You can set the concrete color for a ThemeColorType usingsetConcreteColor with a Color object, RGB values, or a hex string.

ColorScheme

A color scheme defines a mapping from members ofThemeColorType to the actual colors usedto render them.

Methods

MethodReturn typeBrief description
getConcreteColor(theme)ColorReturns the concreteColor associated with theThemeColorType in this colorscheme.
getThemeColors()ThemeColorType[]Returns a list of all possible theme color types in a color scheme.
setConcreteColor(type, color)ColorSchemeSets the concrete color associated with theThemeColorType in this color scheme to thegiven color.
setConcreteColor(type, red, green, blue)ColorSchemeSets the concrete color associated with theThemeColorType in this color scheme to thegiven color in RGB format.
setConcreteColor(type, hexColor)ColorSchemeSets the concrete color associated with theThemeColorType in this color scheme to thegiven color in HEX format.

Detailed documentation

getConcreteColor(theme)

Returns the concreteColor associated with theThemeColorType in this colorscheme.

The returned color is guaranteed to not be an instance ofThemeColor.

Parameters

NameTypeDescription
themeThemeColorTypeThe theme color to derive the concrete color from.

Return

Color — The concrete color corresponding the theme color type in this scheme.

Authorization

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

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

getThemeColors()

Returns a list of all possible theme color types in a color scheme.

Return

ThemeColorType[] — The possible theme color types in this scheme.

Authorization

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

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

setConcreteColor(type, color)

Sets the concrete color associated with theThemeColorType in this color scheme to thegiven color.

Parameters

NameTypeDescription
typeThemeColorTypeThe theme color type.
colorColorThe color to set the theme color type to.

Return

ColorScheme — This color scheme, for chaining.

Authorization

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

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

setConcreteColor(type, red, green, blue)

Sets the concrete color associated with theThemeColorType in this color scheme to thegiven color in RGB format.

Parameters

NameTypeDescription
typeThemeColorTypeThe theme color type.
redIntegerThe red value of the color to set the theme color type to (between 0 and 255).
greenIntegerThe green value of the color to set the theme color type to (between 0 and 255).
blueIntegerThe blue value of the color to set the theme color type to (between 0 and 255).

Return

ColorScheme — This color scheme, for chaining.

Authorization

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

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

setConcreteColor(type, hexColor)

Sets the concrete color associated with theThemeColorType in this color scheme to thegiven color in HEX format.

The hex string must be in the format '#RRGGBB'.

Parameters

NameTypeDescription
typeThemeColorTypeThe theme color type.
hexColorStringThe hex color to set the theme color type to, such as '#F304a7'.

Return

ColorScheme — This color scheme, for chaining.

Authorization

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

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

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-12-11 UTC.