AI-generated Key Takeaways
-
SpreadsheetTheme allows access and modification of existing spreadsheet themes.
-
You can set a theme on a spreadsheet using
Spreadsheet.setSpreadsheetTheme(theme). -
Methods are available to get and set concrete colors for theme color types and to get and set the font family of a theme.
-
Methods like
getConcreteColorandgetFontFamilyreturn theme properties, while methods likesetConcreteColorandsetFontFamilymodify them and return the theme object for chaining. -
Using these methods requires specific authorization scopes related to accessing and modifying spreadsheets.
Access and modify existing themes. To set a theme on a spreadsheet, use Spreadsheet.setSpreadsheetTheme(theme)
.
Methods
| Method | Return type | Brief description |
|---|---|---|
Color
|
Returns the concrete Color
for a valid theme color type. |
|
String
|
Returns the font family of the theme, or null
if it's a null
theme. |
|
Theme
|
Returns a list of all possible theme color types for the current theme. | |
Spreadsheet
|
Sets the concrete color associated with the Theme
in this color scheme to the
given color. |
|
Spreadsheet
|
Sets the concrete color associated with the Theme
in this color scheme to the
given color in RGB format. |
|
Spreadsheet
|
Sets the font family for the theme. |
Detailed documentation
get
Concrete
Color(themeColorType)
Returns the concrete Color
for a valid theme color type. Throws exception if the theme
color type is not set in the current theme.
Parameters
| Name | Type | Description |
|---|---|---|
theme
|
Theme
|
Theme color type. |
Return
Color
— Concrete color.
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
Font
Family()
Returns the font family of the theme, or null
if it's a null
theme.
Return
String
— The theme font family.
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
Theme
Colors()
Returns a list of all possible theme color types for the current theme.
Return
Theme
— A list of theme colors.
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
set
Concrete
Color(themeColorType, color)
Sets the concrete color associated with the Theme
in this color scheme to the
given color.
Parameters
| Name | Type | Description |
|---|---|---|
theme
|
Theme
|
The theme color type. |
color
|
Color
|
The color. |
Return
Spreadsheet
— The theme, for chaining.
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
set
Concrete
Color(themeColorType, red, green, blue)
Sets the concrete color associated with the Theme
in this color scheme to the
given color in RGB format.
Parameters
| Name | Type | Description |
|---|---|---|
theme
|
Theme
|
The theme color type. |
red
|
Integer
|
The value of red channel. |
green
|
Integer
|
The value of green channel. |
blue
|
Integer
|
The value of blue channel. |
Return
Spreadsheet
— The theme, for chaining.
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
set
Font
Family(fontFamily)
Sets the font family for the theme.
Parameters
| Name | Type | Description |
|---|---|---|
font
|
String
|
The new theme font family. |
Return
Spreadsheet
— This theme, for chaining.
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

