# Chat Options

`ChatOption` controls the appearance of livestream chat messages. It allows customization of chat text styling including color and shadow effects.

## Overview

`ChatOption` provides styling for chat messages that appear during livestreams. It allows you to customize:

* Chat text color
* Text shadow effects (color, offset, radius)

## Creating ChatOption

### Using Builder

```kotlin
val chatOption = ChatOption.Builder()
    .chatStyle(
        ChatStyle(
            textColor = Color.WHITE,
            textShadow = TextShadow(
                color = Color.BLACK,
                offsetX = 1f,
                offsetY = 1f,
                radius = 2f
            )
        )
    )
    .build()
```

### Using DSL (Recommended)

```kotlin
val viewOptions = viewOptions {
    chatOptions {
        chatStyle(
            ChatStyle(
                textColor = Color.WHITE,
                textShadow = TextShadow(
                    color = Color.parseColor("#66000000"),
                    offsetX = 0f,
                    offsetY = 0.5f,
                    radius = 7f
                )
            )
        )
    }
}
```

## Properties

### chatStyle

**Type:** `ChatStyle`\
**Default:** White text with default shadow

Configures the visual appearance of chat text.

```kotlin
chatOptions {
    chatStyle(
        ChatStyle(
            textColor = Color.WHITE,
            textShadow = TextShadow(
                color = Color.BLACK,
                offsetX = 1f,
                offsetY = 1f,
                radius = 2f
            )
        )
    )
}
```

## ChatStyle Properties

### textColor

**Type:** `Int` (color)\
**Default:** White (`Color.WHITE`)

Color of the chat message text.

```kotlin
ChatStyle(
    textColor = Color.WHITE
)
```

### textShadow

**Type:** `TextShadow`\
**Default:** Semi-transparent black shadow with default offsets

Shadow effect applied to chat text for better readability.

```kotlin
ChatStyle(
    textShadow = TextShadow(
        color = Color.parseColor("#66000000"),
        offsetX = 0f,
        offsetY = 0.5f,
        radius = 7f
    )
)
```

## TextShadow Properties

### color

**Type:** `Int` (color)\
**Default:** Semi-transparent black (`#66000000`)

Color of the text shadow. Use semi-transparent colors for subtle effects.

```kotlin
TextShadow(
    color = Color.parseColor("#80000000") // 50% black
)
```

### offsetX

**Type:** `Float`\
**Default:** `0f`

Horizontal offset of the shadow in pixels. Positive values shift right, negative shift left.

```kotlin
TextShadow(
    offsetX = 2f // Shift shadow 2px to the right
)
```

### offsetY

**Type:** `Float`\
**Default:** `0.5f`

Vertical offset of the shadow in pixels. Positive values shift down, negative shift up.

```kotlin
TextShadow(
    offsetY = 2f // Shift shadow 2px down
)
```

### radius

**Type:** `Float`\
**Default:** `7f`

Blur radius of the shadow. Larger values create softer shadows.

```kotlin
TextShadow(
    radius = 10f // Softer, more blurred shadow
)
```

## Default Values

| Property             | Default Value                        |
| -------------------- | ------------------------------------ |
| `textColor`          | `Color.WHITE`                        |
| `TextShadow.color`   | `#66000000` (semi-transparent black) |
| `TextShadow.offsetX` | `0f`                                 |
| `TextShadow.offsetY` | `0.5f`                               |
| `TextShadow.radius`  | `7f`                                 |

## Complete Examples

### Default Chat Style

```kotlin
val viewOptions = viewOptions {
    chatOptions {
        chatStyle(
            ChatStyle(
                textColor = Color.WHITE,
                textShadow = TextShadow(
                    color = Color.parseColor("#66000000"),
                    offsetX = 0f,
                    offsetY = 0.5f,
                    radius = 7f
                )
            )
        )
    }
}
```

### No Shadow (Clean Look)

```kotlin
val viewOptions = viewOptions {
    chatOptions {
        chatStyle(
            ChatStyle(
                textColor = Color.WHITE,
                textShadow = null // No shadow
            )
        )
    }
}
```

## Important Notes

* Chat styling only applies to livestream content
* Chat messages are not available in compact mode for StoryBlock
* Shadow effects improve text readability over video backgrounds
* Use semi-transparent shadow colors for natural appearance
* Large shadow radius values may impact performance
* Text color should contrast with typical video content
* Consider accessibility when choosing colors
* Chat styling is applied globally to all livestream chat in the app

## See Also

* [ViewOptions Overview](/firework-for-developers/android-sdk/integration-guide/configuration.md) - Complete configuration system
* [Livestream Configuration](/firework-for-developers/android-sdk/integration-guide/livestream.md) - Livestream features
* [Livestream Chat](/firework-for-developers/android-sdk/integration-guide/livestream/livestream-chat.md) - Chat functionality
* [StoryBlockOption](/firework-for-developers/android-sdk/integration-guide/configuration/story-block-options.md) - StoryBlock configuration
* [FwVideoFeedView](/firework-for-developers/android-sdk/integration-guide/configure-video-feed.md) - Video feed configuration


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.firework.com/firework-for-developers/android-sdk/integration-guide/configuration/chat-options.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
