AgentforceColors
open class AgentforceColorPalette(colorsMap: Map<String, Color>) : Colors
The Agentforce color palette: 271 tokens covering every element the SDK draws. It extends the Salesforce SharedUI Colors class with a component-level token for each UI element, so you can re-skin one component without disturbing anything else that shares the same base color.
You rarely construct one. Start from AgentforceLightColors or AgentforceDarkColors and derive a customized copy. AgentforceColorPalette is the type those two objects are, and the type every colors API hands back.
Declared in AgentforceColorPalette.kt, package com.salesforce.android.agentforcesdk.components.theme.
There’s no type named AgentforceColors — that’s the historical file name. This page covers everything the file publishes: AgentforceColorPalette, the AgentforceLightColors and AgentforceDarkColors default palettes, the AgentforceColorToken enum, and the withOverrides(...) extensions.
For every token’s default value in both light and dark mode, see the Color Token Reference.
AgentforceLightColors and AgentforceDarkColors are the two ready-made palettes. Derive a customized copy with withOverrides(...), which returns a new palette and never mutates the base, so the defaults stay pristine and you can derive several themes from them.
| Object | Signature | Description |
|---|---|---|
AgentforceLightColors | object AgentforceLightColors : AgentforceColorPalette | The default light-mode palette. Seeds all 47 foundation tokens plus the 8 per-mode literals. |
AgentforceDarkColors | object AgentforceDarkColors : AgentforceColorPalette | The default dark-mode palette, same shape. |
Neither object declares any members of its own — every property comes from AgentforceColorPalette. Neither seeds the aliased or fixed-literal tokens either; those resolve on the getter, which is exactly why overriding a foundation token cascades correctly.
Type inference covers the example above, but name the type when you write a helper that builds a palette:
If you only want to change a few tokens, AgentforceThemeOverrides is simpler — no palette object required, and any token you leave out keeps its default:
Build a palette with withOverrides(...) when you want a reusable, fully resolved object; use AgentforceThemeOverrides for everything else.
enum class AgentforceColorToken(val key: String)
A type-safe entry for each of the 271 tokens. Use it everywhere instead of raw strings — typos and renames become compile errors rather than silently ignored keys.
| Member | Signature | Description |
|---|---|---|
key | val key: String | The underlying string key in the colors map. You rarely need to read it. |
fromKey | fun fromKey(key: String): AgentforceColorToken? | Looks up a token by its string key, or null if none matches. Use this only at the boundary with runtime-driven data such as a JSON or remote-config payload. |
Two extension functions, both returning a new palette.
Use the vararg form for a handful of literal overrides and the map form when you assemble overrides from presets or several sources.
| Layer | Count | What it is |
|---|---|---|
| Foundation tokens | 47 | The design-system base palette inherited from SharedUI Colors — surface1, accent1, onSurface1, border1, and so on. Each carries an explicit light and dark value. |
| Component tokens | 224 | One token per UI element, declared on AgentforceColorPalette — titleBarBackground, sendButtonEnabledBackground, carouselSurface, and so on. Grouped into 50 component sections. |
271 tokens in total. Override a foundation token to re-skin everything derived from it; override a component token to change exactly one element.
Every component token resolves its default in one of three ways:
| Kind | Count | Behavior |
|---|---|---|
| Alias | 209 | Falls back to a foundation token, inheriting its value and any override you apply to it. carouselSurface falls back to surface1, so changing Surface1 moves the carousel too — until you override CarouselSurface itself. |
| Fixed literal | 7 | A single color identical in light and dark, defined once on the getter: the two aura colors, the citation external-link color, the PDF viewer page background, and three media-viewer colors. |
| Per-mode literal | 8 | Distinct light and dark values with no single mode-agnostic default, seeded into both default palettes: InputBarPlaceholderColor, AgentAvatarLiveBackground, LauncherPlaceholderColor, UtteranceBackground, VoiceRoomCircleButtonSelectedBackground, AuraAvatarIconTint, MarkdownLinkColor, RichTextLinkColor. |
Section order and token names are kept in lock-step with the iOS AgentforceColorPalette, so the two platforms stay aligned.
| Member | Signature | Description |
|---|---|---|
get | operator fun get(token: AgentforceColorToken): Color? | The raw seeded value for a token, or null when nothing is seeded. Prefer the named properties, which apply the fallback chain. |
colorsMap | Map<String, Color> | The underlying map, inherited from SharedUI Colors. |
| Foundation properties | val surface1: Color, val accent1: Color, … | 47 properties inherited from SharedUI Colors. |
| Component properties | val titleBarBackground: Color, val carouselSurface: Color, … | 224 read-only properties, one per component token, each applying its own fallback. |
Component property names are the camelCase form of the token name: AgentforceColorToken.SendButtonIconTint is read as colors.sendButtonIconTint.
accent4 and accent5 exist on the SharedUI base class but have no AgentforceColorToken and are unused by Agentforce components, so they can’t be overridden through the token enum.
The active palette comes from the theme manager, which picks light or dark based on the resolved theme mode.
The 224 component tokens are organized into these 50 groups. The Color Token Reference lists them in this order, with each token’s fallback and its light and dark defaults.
| Group | Tokens | Covers |
|---|---|---|
| Chat scaffold | 1 | The root chat surface |
| Title bar / navigation | 4 | Conversation header — title, icons, divider |
| Input bar | 10 | Message composer row |
| Send button | 3 | Send-message button |
| Voice / stop-listening button | 3 | Voice-entry waveform button |
| Agent avatar | 4 | AI and live-agent avatars in the feed |
| Agent message | 2 | Agent name and message text |
| User message bubble | 4 | End-user’s message bubble |
| Chat response / reply button | 6 | Suggested reply and chat-response buttons |
| Message action buttons | 2 | Thumbs up / down / copy row |
| Feedback modal | 7 | ”Why wasn’t this helpful?” sheet |
| Toast | 8 | Info, success, warning, and error toasts |
| Modal sheet | 7 | More menu, multi-modal sheet, action list, agent selector |
| Inline chat error | 2 | Error inside an agent response |
| Launcher | 8 | Floating launcher entry point |
| Recommended utterance | 5 | Suggested-utterance chips and list |
| Carousel | 7 | Horizontal card carousel |
| Source / citation | 6 | Citation chips, list, external link |
| Rich link | 5 | Rich link preview card |
| Web link | 3 | Inline web link chip |
| Record info | 5 | Record info card |
| Voice room | 5 | Full-screen voice conversation |
| Record selector | 5 | Record picker list |
| JSON object viewer | 5 | Expandable JSON viewer |
| 1 | Email component surface | |
| Stencil / loading skeleton | 1 | Shimmer placeholder |
| Action sheet | 5 | Record-actions sheet |
| Toxicity | 3 | Toxicity warning block |
| Form field | 13 | Shared by pre-chat fields, secure-form fields, text input, pickers |
| Checkbox | 8 | Checkbox and its label |
| Pre-chat form | 9 | Pre-chat form page |
| Secure form | 9 | Secure form page |
| Secure form link | 3 | Secure form link chip |
| Generic attachment / file chip | 4 | Remove button, chip preview, border |
| Image / PDF preview placeholder | 2 | Placeholder before a preview loads |
| Audio attachment | 6 | Audio attachment player |
| Video attachment | 3 | Video attachment preview |
| PDF attachment | 2 | PDF attachment chip |
| PDF viewer (full screen) | 1 | Full-screen PDF viewer |
| Media viewer | 5 | Image preview and video player chrome |
| Aura | 4 | Animated brand aura and avatar glow |
| Markdown text | 4 | Markdown-rendered agent text |
| Rich text (HTML) | 3 | HTML-rendered rich text |
| Streaming card | 2 | Streaming card fade and action text |
| Chat status | 2 | Status line under the chat |
| Progress indicator | 3 | Typing and progress indicator |
| Full-screen states | 4 | Loading, error, and onboarding screens |
| Refresh button | 4 | Refresh button on the error screen |
| Onboarding confirm button | 3 | Confirm button on the onboarding screen |
| Generic CTA button | 3 | Generic call-to-action button |
- Values are fully opaque
#RRGGBB. A few tokens apply transparency at the call site — the media-viewer close-button scrim is drawn at roughly 45% alpha over an opaque black token. OnAccent1is white in both modes by design, since it colors text and icons sitting on the accent fill.- Setting a tint token to
Color.Unspecifiedmeans “no tint,” which lets a custom icon render in its own colors. See Custom Icons. - Check contrast in both light and dark mode for accessibility (WCAG AA).
- Color Token Reference — all 271 tokens with their fallbacks and light/dark default values.
- AgentforceThemeManager — exposes the resolved palette through
colors(). - Theme Mode — decides which palette renders.
- AgentforceTypography — the matching type scale.