Class Color Stay organized with collections Save and categorize content based on your preferences.
Color
A Color object which represents a color in the RGBA color space.
Only available for Google Workspace add-ons that extend Google Workspace Studio.
consterrorStyledText=AddOnsResponseService.newStyledText().setText("Styled Text!").addStyle(AddOnsResponseService.TextStyle.UNDERLINE).setColor(AddOnsResponseService.newColor().setRed(0.1).setBlue(1.0).setGreen(1.0).setAlpha(0.78))
Methods
| Method | Return type | Brief description |
|---|---|---|
set | Color | Sets the alpha component of the color. |
set | Color | Sets the blue component of the color. |
set | Color | Sets the green component of the color. |
set | Color | Sets the red component of the color. |
Detailed documentation
setAlpha(alpha)
Sets the alpha component of the color.
Parameters
| Name | Type | Description |
|---|---|---|
alpha | Number | The alpha component of the color. |
Return
Color — This object, for chaining.
setBlue(blue)
Sets the blue component of the color.
Parameters
| Name | Type | Description |
|---|---|---|
blue | Number | The blue component of the color. |
Return
Color — This object, for chaining.
setGreen(green)
Sets the green component of the color.
Parameters
| Name | Type | Description |
|---|---|---|
green | Number | The green component of the color. |
Return
Color — This object, for chaining.
setRed(red)
Sets the red component of the color.
Parameters
| Name | Type | Description |
|---|---|---|
red | Number | The red component of the color. |
Return
Color — This object, for chaining.
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-03 UTC.