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.

const errorStyledText = 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.