Class Color

  • The Color class represents an opaque color.

  • TheasRgbColor() method converts the color to an RgbColor.

  • TheasThemeColor() method converts the color to a ThemeColor.

  • ThegetColorType() method gets the type of the color.

Color

An opaque color

Methods

MethodReturn typeBrief description
asRgbColor()RgbColorConverts this color to anRgbColor.
asThemeColor()ThemeColorConverts this color to aThemeColor.
getColorType()ColorTypeGet the type of this color.

Detailed documentation

asRgbColor()

Converts this color to anRgbColor.

Return

RgbColor

Throws

Error — if the color is not anRgbColor

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

asThemeColor()

Converts this color to aThemeColor.

Return

ThemeColor

Throws

Error — if the color is not aThemeColor

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

getColorType()

Get the type of this color.

Return

ColorType — The color type.

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.