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.
| Property | Light (default) | Dark (default) | Used in |
|---|---|---|---|
main | #191E23 | #E1E1EA | Main message text, message time, operator names, system message text; author and quote text color in outgoing messages |
secondary | #777B7E | #B0B0BA | Date 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 | #8A8A8E | Disabled state of buttons and quick replies, input field border, text of deleted messages and out-of-hours messages |
background | #F1F1F7 | #1C1C1E | Chat and search screen background; base background for component styles (most visible elements override it with backgroundWhite) |
backgroundWhite | #FFFFFF | #2C2C2F | Message bubbles (incoming and outgoing by default), link preview background (OpenGraph), spinner color and caption in the chat loading overlay |
link | #007AFF | #007AFF | Links in text, input field cursor, navigation bar buttons ("Back", "Close", search), quote divider, loading indicator, progress bar, quick reply buttons |
linkLight | #4EAAFF | #4EAAFF | Quote background, input field tint, pressed state of accent buttons (including quick replies) |
positive | #09A460 | #09A460 | Message status icons (sent / delivered / read), active "yes" button in yes/no surveys, pull-to-refresh, toast background, scroll-to-unread button icon |
warning | #FFC043 | #FFC043 | Rating survey icons, author and quote text color in incoming messages (ChatFlow.incomeMessages.quoteStyle) |
error | #AF1400 | #E11900 | Status indicator and time color on send error, color of the error message bubble |
errorLight | #E11900 | #FF594C | Send-error text color, scroll-to-unread button background |
darkTheme is not setIf 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)
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
| Effect | SDK status | Alternative |
|---|---|---|
| Gradients (linear, radial) | Not supported | Solid color — pick the dominant shade |
| Drop Shadow (complex configurations) | No public API | Only cornerRadius is available in styles |
| Blur / Frosted Glass | Not supported | Solid color with the required transparency |
| Semi-transparent overlays | Partial | UIColor(white: 0, alpha: 0.4) |
Additional accent colors (besides link/linkLight) | No direct token | Configured per-element through component styles |
Related
- Accessibility — contrast and testing requirements
- Component styles — detailed color customization for specific components
- Typography — font configuration