Skip to main content
Version: 5.9.0

Color scheme

For light and dark themes, use either two separate ChatColors objects in theme and darkTheme, or a single ChatColors with dynamic UIColor values — through UIColor { traitCollection in ... } or the SDK extension UIColor.colorFor(light:dark:).


Property reference

All properties have default values — override only what you need.

PropertyLight (default)Dark (default)Used in
main #191E23 #E1E1EAMain message text, message time, operator names, system message text; author and quote text color in outgoing messages
secondary #777B7E #B0B0BADate separator in the message feed, subtitle of the empty-chat placeholder, text in the quote bar above the input, URL in link previews
disabled #9FA5A9 #8A8A8EDisabled state of buttons and quick replies, input field border, text of deleted messages and out-of-hours messages
background #F1F1F7 #1C1C1EChat and search screen background; base background for component styles (most visible elements override it with backgroundWhite)
backgroundWhite #FFFFFF #2C2C2FMessage bubbles (incoming and outgoing by default), link preview background (OpenGraph), spinner color and caption in the chat loading overlay
link #007AFF #007AFFLinks in text, input field cursor, navigation bar buttons ("Back", "Close", search), quote divider, loading indicator, progress bar, quick reply buttons
linkLight #4EAAFF #4EAAFFQuote background, input field tint, pressed state of accent buttons (including quick replies)
positive #09A460 #09A460Message status icons (sent / delivered / read), active "yes" button in yes/no surveys, pull-to-refresh, toast background, scroll-to-unread button icon
warning #FFC043 #FFC043Rating survey icons, author and quote text color in incoming messages (ChatFlow.incomeMessages.quoteStyle)
error #AF1400 #E11900Status indicator and time color on send error, color of the error message bubble
errorLight #E11900 #FF594CSend-error text color, scroll-to-unread button background
Behavior when darkTheme is not set

If chatCenterSDK.darkTheme is not set, the light palette is applied even in the system dark theme.

Contrast requirements (WCAG AA) and how to verify custom colors — see Accessibility.


Initialization

Direct property assignment:

let colors = ChatColors()
colors.main = .black
colors.background = .systemBackground
colors.link = .systemBlue

The build factory method — returns a configured instance:

let colors = ChatColors.build { colors in
colors.main = .black
colors.background = .systemBackground
colors.link = .systemBlue
}

The apply method (from the Applicable protocol) — mutates an existing instance and supports chaining:

let colors = ChatColors().apply { colors in
colors.main = .black
colors.link = .systemBlue
}

A full palette configuration example is in the demo at MainViewController+Full.swift, in the makeFullTheme() method, block // MARK: - ChatColors - full palette.


Light and dark themes

chatCenterSDK.theme accepts a ChatTheme for the light theme; chatCenterSDK.darkTheme accepts one for the dark theme.

let lightColors = ChatColors()
lightColors.main = .black
lightColors.background = .white
// fall back to the system color if the asset is not found
lightColors.link = UIColor(named: "BrandBlue") ?? .systemBlue

let darkColors = ChatColors()
darkColors.main = .white
darkColors.background = UIColor(named: "BackgroundDark") ?? .black
darkColors.link = UIColor(named: "BrandBlueDark") ?? .systemBlue

chatCenterSDK.theme = ChatTheme(colors: lightColors)
chatCenterSDK.darkTheme = ChatTheme(colors: darkColors)
Assignment order matters

Assigning chatCenterSDK.theme automatically overwrites chatCenterSDK.darkTheme with the same object. If you assign darkTheme before theme, the dark theme is lost. Always set darkTheme after theme.

ChatTheme(colors:) is the short form; the full signature is ChatTheme(colors:images:typography:), with defaults for every parameter. Component styles copy colors at creation time: some of them (inputViewStyle, addFileMenuStyle) are created immediately in ChatTheme.init, the rest are created lazily on first access. After a chat is opened, edits to ChatColors no longer apply — recreate ChatTheme and reassign chatCenterSDK.theme / darkTheme.

One palette for both themes

If the color scheme differs only in tint, use a single ChatColors with dynamic UIColor values:

let adaptiveLink = UIColor { traitCollection in
traitCollection.userInterfaceStyle == .dark
? UIColor(red: 0.31, green: 0.67, blue: 1.0, alpha: 1)
: UIColor(red: 0.0, green: 0.48, blue: 1.0, alpha: 1)
}

let colors = ChatColors()
colors.link = adaptiveLink
chatCenterSDK.theme = ChatTheme(colors: colors)

Limitations

EffectSDK statusAlternative
Gradients (linear, radial)Not supportedSolid color — pick the dominant shade
Drop Shadow (complex configurations)No public APIOnly cornerRadius is available in styles
Blur / Frosted GlassNot supportedSolid color with the required transparency
Semi-transparent overlaysPartialUIColor(white: 0, alpha: 0.4)
Additional accent colors (besides link/linkLight)No direct tokenConfigured per-element through component styles