Class Fill Stay organized with collections Save and categorize content based on your preferences.
Page Summary
Fill describes the background of a page element.
You can get the solid fill, fill type, and visibility status of a fill.
Solid fills can be set using Color objects, RGB values, hex strings, or ThemeColorType.
You can set the fill to transparent.
Describes the page element's background
Methods
| Method | Return type | Brief description |
|---|---|---|
get | Solid | Get the solid fill of this background, ornull if the fill type is notFill. |
get | Fill | Get the type of this fill. |
is | Boolean | Whether the background is visible. |
set | void | Sets the solid fill to the givenColor. |
set | void | Sets the solid fill to the given alpha andColor. |
set | void | Sets the solid fill to the given RGB values. |
set | void | Sets the solid fill to the given alpha and RGB values. |
set | void | Sets the solid fill to the given hex color string. |
set | void | Sets the solid fill to the given alpha and hex color string. |
set | void | Sets the solid fill to the givenTheme. |
set | void | Sets the solid fill to the given alpha andTheme. |
set | void | Sets the background to transparent. |
Detailed documentation
getSolidFill()
Get the solid fill of this background, ornull if the fill type is notFill.
Return
Solid — The solid fill setting, ornull if this fill type is not solid.
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
getType()
isVisible()
Whether the background is visible.
Return
Boolean —true if the background is visible;false otherwise.
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(color)
setSolidFill(color, alpha)
Sets the solid fill to the given alpha andColor.
Parameters
| Name | Type | Description |
|---|---|---|
color | Color | |
alpha | Number |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(red, green, blue)
Sets the solid fill to the given RGB values.
Parameters
| Name | Type | Description |
|---|---|---|
red | Integer | |
green | Integer | |
blue | Integer |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(red, green, blue, alpha)
Sets the solid fill to the given alpha and RGB values.
Parameters
| Name | Type | Description |
|---|---|---|
red | Integer | |
green | Integer | |
blue | Integer | |
alpha | Number |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(hexString)
Sets the solid fill to the given hex color string.
The hex string must be in the format '#RRGGBB'. For example, pink is represented as'#FFC0CB'.
Parameters
| Name | Type | Description |
|---|---|---|
hex | String |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(hexString, alpha)
Sets the solid fill to the given alpha and hex color string.
The hex string must be in the format '#RRGGBB'. For example, pink is represented as'#FFC0CB'.
Parameters
| Name | Type | Description |
|---|---|---|
hex | String | |
alpha | Number |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(color)
Sets the solid fill to the givenTheme.
Parameters
| Name | Type | Description |
|---|---|---|
color | Theme |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setSolidFill(color, alpha)
Sets the solid fill to the given alpha andTheme.
Parameters
| Name | Type | Description |
|---|---|---|
color | Theme | |
alpha | Number |
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://www.googleapis.com/auth/presentations
setTransparent()
Sets the background to transparent.
Authorization
Scripts that use this method require authorization with one or more of the followingscopes:
https://www.googleapis.com/auth/presentations.currentonlyhttps://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.