Class Color
Detailed documentation
asRgbColor()
Converts this color to an RgbColor
.
Return
RgbColor
Throws
Error
— if the color is not an RgbColor
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
https://www.googleapis.com/auth/presentations.currentonly
-
https://www.googleapis.com/auth/presentations
asThemeColor()
Converts this color to a ThemeColor
.
Return
ThemeColor
Throws
Error
— if the color is not a ThemeColor
Authorization
Scripts that use this method require authorization with one or more of the following scopes:
-
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 following scopes:
-
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 the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-12-02 UTC.
[null,null,["Last updated 2024-12-02 UTC."],[[["This documentation describes how to work with opaque colors in Google Apps Script's Slides service."],["`Color` objects can be converted to RGB or Theme colors using the `asRgbColor()` and `asThemeColor()` methods."],["`getColorType()` allows you to retrieve the specific type of a given color."],["Using any of these methods requires authorization with the `presentations.currentonly` or `presentations` scopes."]]],["The provided content describes an opaque color object with three methods. `asRgbColor()` converts the color to an RgbColor, returning an `RgbColor`. `asThemeColor()` converts the color to a ThemeColor, returning a `ThemeColor`. `getColorType()` identifies the color's type, returning a `ColorType`. All methods require specific authorization scopes, including `https://www.googleapis.com/auth/presentations.currentonly` and `https://www.googleapis.com/auth/presentations`. Errors are thrown if the color type is not compatible with the requested conversion.\n"]]