Skip to main content
Primer Checkout iOS SDK is currently in beta (v3.0.0-beta.8). The API is subject to change before the stable release.
ColorOverrides lets you override individual color tokens used across the checkout UI. You pass one instance to PrimerCheckoutTheme as colors for light mode and, optionally, another as darkColors for dark mode. Every property is an optional Color?. Any token you leave nil keeps the SDK’s default for that appearance. colors applies only in light mode and darkColors only in dark mode. A token you set in colors does not carry over to dark mode: anything you leave nil in darkColors uses Primer’s dark default. The tables list the light and dark defaults as #RRGGBBAA hex values.
Override primerColorBrand to recolor buttons, focus borders, loaders and selected states in one change. It applies to light mode through colors and to dark mode through darkColors. Override a more specific token only when one element must differ from the token it follows.

Brand and primary

Background and text

Border colors (outlined)

Borders of inputs, payment method rows, saved cards and outlined buttons, per state.

Border colors (transparent)

Reserved for elements with a transparent border. No component reads these tokens.

Icon colors

Utility

Overriding colors

Pass a ColorOverrides instance as colors for light mode and another as darkColors for dark mode. Tokens you omit keep the SDK default for that appearance.
Dark mode reads only darkColors. To change a token in both appearances, set it in both colors and darkColors. A dynamic Color, such as an asset catalog color set, shows only its value for the appearance of its group. A dynamic Color in colors always shows its light value.
Some tokens follow another token unless you set them too, so one change can recolor several elements. Within the same group (colors or darkColors):
  • primerColorBrand also moves primerColorFocus, primerColorLoader, primerColorBorderOutlinedSelected, primerColorBorderOutlinedFocus and primerColorBorderTransparentFocus.
  • primerColorFocus moves primerColorBorderOutlinedFocus and primerColorBorderTransparentFocus.
  • primerColorBackgroundPrimary moves primerColorBackgroundOutlinedDefault.
  • primerColorTextPrimary moves primerColorTextOutlinedDefault.
  • A nil primerColorOnBrand uses primerColorBackgroundPrimary.
A token you set explicitly always wins over the token it follows.

See also

PrimerTheme

The container that bundles color, shape, spacing, and typography overrides.

Shape Tokens

Override corner radius and border width tokens.

Typography Tokens

Override font, size, weight, and line height per text style.

Spacing Tokens

Override spacing and size scale tokens.