Class Color

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

MethodReturn typeBrief description
setAlpha(alpha)ColorSets the alpha component of the color.
setBlue(blue)ColorSets the blue component of the color.
setGreen(green)ColorSets the green component of the color.
setRed(red)ColorSets the red component of the color.

Detailed documentation

setAlpha(alpha)

Sets the alpha component of the color.

Parameters

NameTypeDescription
alphaNumberThe alpha component of the color.

Return

Color — This object, for chaining.


setBlue(blue)

Sets the blue component of the color.

Parameters

NameTypeDescription
blueNumberThe blue component of the color.

Return

Color — This object, for chaining.


setGreen(green)

Sets the green component of the color.

Parameters

NameTypeDescription
greenNumberThe green component of the color.

Return

Color — This object, for chaining.


setRed(red)

Sets the red component of the color.

Parameters

NameTypeDescription
redNumberThe 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.