Skip to main content
Version: Next

Colors

ChatColors class provides centralized color palette management for all chat interface elements.

Main Colors

PropertyDescriptionDefault Value
primaryPrimary accent color (buttons, active elements)System blue
secondarySecondary accent colorSystem gray
backgroundMain backgroundSystem background
surfaceSurface color (cards, panels)Secondary system background
errorError indicationSystem red
textMain textLabel
textSecondarySecondary textSecondary label

Message Colors

PropertyDescription
incomingMessageBackgroundIncoming message background
outgoingMessageBackgroundOutgoing message background
incomingMessageTextIncoming message text
outgoingMessageTextOutgoing message text

Status Colors

PropertyDescription
successSuccess status
warningWarning status
infoInformation 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.