Colors
ChatColors class provides centralized color palette management for all chat interface elements.
Main Colors
| Property | Description | Default Value |
|---|---|---|
primary | Primary accent color (buttons, active elements) | System blue |
secondary | Secondary accent color | System gray |
background | Main background | System background |
surface | Surface color (cards, panels) | Secondary system background |
error | Error indication | System red |
text | Main text | Label |
textSecondary | Secondary text | Secondary label |
Message Colors
| Property | Description |
|---|---|
incomingMessageBackground | Incoming message background |
outgoingMessageBackground | Outgoing message background |
incomingMessageText | Incoming message text |
outgoingMessageText | Outgoing message text |
Status Colors
| Property | Description |
|---|---|
success | Success status |
warning | Warning status |
info | Information status |
Usage Example
let colors = ChatColors()
// Customize main colors
colors.primary = UIColor(red: 0.2, green: 0.4, blue: 0.8, alpha: 1.0)
colors.background = .white
colors.text = .black
// Customize message colors
colors.incomingMessageBackground = UIColor(red: 0.95, green: 0.95, blue: 0.97, alpha: 1.0)
colors.outgoingMessageBackground = UIColor(red: 0.0, green: 0.48, blue: 1.0, alpha: 1.0)
// Create theme with customized colors
let components = ChatComponents(colors: colors)
let theme = ChatTheme(components: components)
// Apply theme
chatCenterSDK.theme = theme
tip
For corporate branding, it's recommended to define a custom color palette matching your brand guidelines and apply it at this level.