AI-generated Key Takeaways
-
The Color object represents a color and can be converted to an RgbColor or a ThemeColor.
-
You can get the type of the color using the
getColorType()method. -
Converting to RgbColor or ThemeColor may throw an error if the color is not of that type.
-
Using these methods requires specific spreadsheet authorization scopes.
A representation for a color.
Methods
| Method | Return type | Brief description |
|---|---|---|
Rgb
|
Converts this color to an Rgb
. |
|
Theme
|
Converts this color to a Theme
. |
|
Color
|
Get the type of this color. |
Detailed documentation
as
Rgb
Color()
Converts this color to an Rgb
.
Return
Rgb
— The RGB color.
Throws
Error
— if the color is not an Rgb
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
as
Theme
Color()
Converts this color to a Theme
.
Return
Theme
— The theme color.
Throws
Error
— if the color is not a Theme
.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets
get
Color
Type()
Get the type of this color.
Return
Color
— The color type.
Authorization
Scripts that use this method require authorization with one or more of the following scopes :
-
https://www.googleapis.com/auth/spreadsheets.currentonly -
https://www.googleapis.com/auth/spreadsheets

