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.

ObjectSignatureDescription
AgentforceLightColorsobject AgentforceLightColors : AgentforceColorPaletteThe default light-mode palette. Seeds all 47 foundation tokens plus the 8 per-mode literals.
AgentforceDarkColorsobject AgentforceDarkColors : AgentforceColorPaletteThe 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.

MemberSignatureDescription
keyval key: StringThe underlying string key in the colors map. You rarely need to read it.
fromKeyfun 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.

LayerCountWhat it is
Foundation tokens47The design-system base palette inherited from SharedUI Colors — surface1, accent1, onSurface1, border1, and so on. Each carries an explicit light and dark value.
Component tokens224One 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:

KindCountBehavior
Alias209Falls 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 literal7A 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 literal8Distinct 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.

MemberSignatureDescription
getoperator 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.
colorsMapMap<String, Color>The underlying map, inherited from SharedUI Colors.
Foundation propertiesval surface1: Color, val accent1: Color, …47 properties inherited from SharedUI Colors.
Component propertiesval 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.

GroupTokensCovers
Chat scaffold1The root chat surface
Title bar / navigation4Conversation header — title, icons, divider
Input bar10Message composer row
Send button3Send-message button
Voice / stop-listening button3Voice-entry waveform button
Agent avatar4AI and live-agent avatars in the feed
Agent message2Agent name and message text
User message bubble4End-user’s message bubble
Chat response / reply button6Suggested reply and chat-response buttons
Message action buttons2Thumbs up / down / copy row
Feedback modal7”Why wasn’t this helpful?” sheet
Toast8Info, success, warning, and error toasts
Modal sheet7More menu, multi-modal sheet, action list, agent selector
Inline chat error2Error inside an agent response
Launcher8Floating launcher entry point
Recommended utterance5Suggested-utterance chips and list
Carousel7Horizontal card carousel
Source / citation6Citation chips, list, external link
Rich link5Rich link preview card
Web link3Inline web link chip
Record info5Record info card
Voice room5Full-screen voice conversation
Record selector5Record picker list
JSON object viewer5Expandable JSON viewer
Email1Email component surface
Stencil / loading skeleton1Shimmer placeholder
Action sheet5Record-actions sheet
Toxicity3Toxicity warning block
Form field13Shared by pre-chat fields, secure-form fields, text input, pickers
Checkbox8Checkbox and its label
Pre-chat form9Pre-chat form page
Secure form9Secure form page
Secure form link3Secure form link chip
Generic attachment / file chip4Remove button, chip preview, border
Image / PDF preview placeholder2Placeholder before a preview loads
Audio attachment6Audio attachment player
Video attachment3Video attachment preview
PDF attachment2PDF attachment chip
PDF viewer (full screen)1Full-screen PDF viewer
Media viewer5Image preview and video player chrome
Aura4Animated brand aura and avatar glow
Markdown text4Markdown-rendered agent text
Rich text (HTML)3HTML-rendered rich text
Streaming card2Streaming card fade and action text
Chat status2Status line under the chat
Progress indicator3Typing and progress indicator
Full-screen states4Loading, error, and onboarding screens
Refresh button4Refresh button on the error screen
Onboarding confirm button3Confirm button on the onboarding screen
Generic CTA button3Generic 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.
  • OnAccent1 is white in both modes by design, since it colors text and icons sitting on the accent fill.
  • Setting a tint token to Color.Unspecified means “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).