StyledText

Text element with styles such as bold, italic and color.

Only available for Google Workspace add-ons that extend Google Workspace Studio.

Sample usage:

```javascript
const styledText = AddOnsResponseService.newStyledText()
  .setText("Styled Text!")
  .addStyle(AddOnsResponseService.TextStyle.ITALIC)
  .addStyle(AddOnsResponseService.TextStyle.UNDERLINE)
  .setFontWeight(AddOnsResponseService.FontWeight.BOLD)
  .setColor(
    AddOnsResponseService.newColor()
      .setRed(0.1)
      .setBlue(0.3)
      .setGreen(0.1)
      .setAlpha(0.78)
  );
```

### Methods

| Method | Return type | Brief description |
|---|---|---|
| `https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#addStyle(TextStyle)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#` | Sets the style of the styled text, can apply multiple styles to a single styled text. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#setColor(Color)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#` | Sets the color of the styled text. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#setFontWeight(FontWeight)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#` | Sets the font weight of the styled text. |
| `https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#setText(String)` | `https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#` | Sets the main content of the styled text. |

## Detailed documentation

### `addStyle(style)`

Sets the style of the styled text, can apply multiple styles to a single styled text.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `style` | `https://developers.google.com/apps-script/reference/add-ons-response-service/text-style` | The `https://developers.google.com/apps-script/reference/add-ons-response-service/text-style` of the styled text. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#` --- This styled text object, for chaining.

*** ** * ** ***

### `setColor(color)`

Sets the color of the styled text.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `color` | `https://developers.google.com/apps-script/reference/add-ons-response-service/color` | The `https://developers.google.com/apps-script/reference/add-ons-response-service/color` of the styled text. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#` --- This styled text object, for chaining.

*** ** * ** ***

### `setFontWeight(fontWeight)`

Sets the font weight of the styled text.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `fontWeight` | `https://developers.google.com/apps-script/reference/add-ons-response-service/font-weight` | The `https://developers.google.com/apps-script/reference/add-ons-response-service/font-weight` of the styled text. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#` --- This styled text object, for chaining.

*** ** * ** ***

### `setText(text)`

Sets the main content of the styled text.

#### Parameters

| Name | Type | Description |
|---|---|---|
| `text` | `String` | The text message in the styled text. |

#### Return


`https://developers.google.com/apps-script/reference/add-ons-response-service/styled-text#` --- This styled text object, for chaining.