> ## Documentation Index
> Fetch the complete documentation index at: https://www.cometchat.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Color Resources

> The CometChat iOS UI Kit v6 colour palette — every token with its light and dark value, and how to override it in SwiftUI and UIKit.

> [accordion] AI Integration Quick Reference
>
> ```json theme={null}
> {
>   "source": "CometChatCore's palette table — one table both toolkits read",
>   "swiftUI": "CometChatColorScheme (theme.light / theme.dark); .derived(primary:isDark:); set any token on the value",
>   "uiKit": "CometChatUIKitTheme.shared — 56 UIColor properties; setBrandColor(_:)",
>   "keyTokens": ["primary", "background1…background4", "textPrimary/Secondary/Tertiary", "strokeDefault/Light/Dark", "success", "error", "warning", "info"],
>   "related": ["/ui-kit/ios/v6/theming", "/ui-kit/ios/v6/component-styling"]
> }
> ```

The UI Kit ships a complete palette for light and dark appearance. This page lists the default
values and shows how to override them.

***

## Color Categories

| Category | Tokens | Purpose |
| - | - | - |
| Primary | `primary`, `extendedPrimary50` – `extendedPrimary900` | brand colour and its ten-step ramp |
| Neutral | `neutral50` – `neutral900` | the grey ramp backgrounds, text and strokes are built on |
| Alert | `info`, `success`, `warning`, `error`, `messageRead` | status indicators; `messageRead` is the read receipt |
| Background | `background1` – `background4` | surfaces, defined as neutrals |
| Stroke | `strokeDefault`, `strokeLight`, `strokeDark`, `strokeHighlight` | borders and dividers |
| Text | `textPrimary`, `textSecondary`, `textTertiary`, `textDisabled`, `textWhite`, `textHighlight` | text |
| Icon | `iconTintPrimary`, `iconTintSecondary`, `iconTintTertiary`, `iconTintWhite`, `iconTintHighlight` | icon tints |
| Button | `primaryButtonBackground`, `primaryButtonIconTint`, `primaryButtonText`, `secondaryButtonBackground`, `secondaryButtonIconTint`, `secondaryButtonText`, `linkButton`, `fabButtonBackground`, `fabButtonIconTint` | buttons |
| Fixed | `white`, `black` | the same in both appearances |

***

## Default Palette

Both toolkits read this one table, so a token is the same colour in SwiftUI and in UIKit.

| Token | Light | Dark | Defined as |
| - | - | - | - |
| `primary` | #6852D6 | #6852D6 | |
| `extendedPrimary50` | #F9F8FD | #15102B | ramp of `primary` |
| `extendedPrimary100` | #EDEAFA | #1D173C | ramp of `primary` |
| `extendedPrimary200` | #DCD7F6 | #251E4D | ramp of `primary` |
| `extendedPrimary300` | #CCC4F1 | #2E245E | ramp of `primary` |
| `extendedPrimary400` | #BBB1ED | #362B6F | ramp of `primary` |
| `extendedPrimary500` | #AA9EE8 | #3E3180 | ramp of `primary` |
| `extendedPrimary600` | #9A8BE4 | #473892 | ramp of `primary` |
| `extendedPrimary700` | #8978DF | #4F3EA3 | ramp of `primary` |
| `extendedPrimary800` | #7965DB | #5745B4 | ramp of `primary` |
| `extendedPrimary900` | #5D49BE | #7460D9 | ramp of `primary` |
| `neutral50` | #FFFFFF | #141414 | |
| `neutral100` | #FAFAFA | #1A1A1A | |
| `neutral200` | #F5F5F5 | #272727 | |
| `neutral300` | #E8E8E8 | #383838 | |
| `neutral400` | #DCDCDC | #4C4C4C | |
| `neutral500` | #A1A1A1 | #858585 | |
| `neutral600` | #727272 | #989898 | |
| `neutral700` | #5B5B5B | #A8A8A8 | |
| `neutral800` | #434343 | #C8C8C8 | |
| `neutral900` | #141414 | #FFFFFF | |
| `info` | #0B7BEA | #0D66BF | |
| `success` | #09C26F | #0B9F5D | |
| `warning` | #FFAB00 | #D08D04 | |
| `error` | #F44649 | #C73C3E | |
| `messageRead` | #56E8A7 | #56E8A7 | |
| `background1` | #FFFFFF | #141414 | `neutral50` |
| `background2` | #FAFAFA | #1A1A1A | `neutral100` |
| `background3` | #F5F5F5 | #272727 | `neutral200` |
| `background4` | #E8E8E8 | #383838 | `neutral300` |
| `strokeDefault` | #E8E8E8 | #383838 | `neutral300` |
| `strokeLight` | #F5F5F5 | #272727 | `neutral200` |
| `strokeDark` | #DCDCDC | #4C4C4C | `neutral400` |
| `strokeHighlight` | #6852D6 | #6852D6 | `primary` |
| `textPrimary` | #141414 | #FFFFFF | `neutral900` |
| `textSecondary` | #727272 | #989898 | `neutral600` |
| `textTertiary` | #A1A1A1 | #858585 | `neutral500` |
| `textDisabled` | #DCDCDC | #4C4C4C | `neutral400` |
| `textWhite` | #FFFFFF | #141414 | `neutral50` |
| `textHighlight` | #6852D6 | #6852D6 | `primary` |
| `iconTintPrimary` | #141414 | #FFFFFF | `neutral900` |
| `iconTintSecondary` | #A1A1A1 | #858585 | `neutral500` |
| `iconTintTertiary` | #DCDCDC | #4C4C4C | `neutral400` |
| `iconTintWhite` | #FFFFFF | #141414 | `neutral50` |
| `iconTintHighlight` | #6852D6 | #6852D6 | `primary` |
| `primaryButtonBackground` | #6852D6 | #6852D6 | `primary` |
| `primaryButtonIconTint` | #FFFFFF | #FFFFFF | |
| `primaryButtonText` | #FFFFFF | #FFFFFF | |
| `secondaryButtonBackground` | #434343 | #C8C8C8 | `neutral800` |
| `secondaryButtonIconTint` | #434343 | #C8C8C8 | `neutral800` |
| `secondaryButtonText` | #434343 | #C8C8C8 | `neutral800` |
| `linkButton` | #0B7BEA | #0D66BF | `info` |
| `fabButtonBackground` | #6852D6 | #6852D6 | `primary` |
| `fabButtonIconTint` | #FFFFFF | #FFFFFF | |
| `white` | #FFFFFF | #FFFFFF | |
| `black` | #141414 | #141414 | |

The neutrals invert in dark appearance, so every token defined as a neutral — backgrounds,
strokes, text and icons — follows without a dark value of its own.

> [tab] SwiftUI
>
> The defaults are `CometChatColorScheme.light` and `CometChatColorScheme.dark`, which a new
> `CometChatTheme()` uses. Read a token from the environment in your own views, so they
> match the Kit:
>
> ```swift theme={null}
> struct MyBadge: View {
>     @Environment(\.cometChatTheme) private var theme
>     @Environment(\.colorScheme) private var colorScheme
>
>     var body: some View {
>         let colors = theme.colors(for: colorScheme)
>         Text("New")
>             .font(theme.typography.caption1Medium)
>             .foregroundStyle(colors.primaryButtonText)
>             .padding(4)
>             .background(colors.primary, in: .capsule)
>     }
> }
> ```

> [tab] UIKit
>
> `CometChatUIKitTheme.shared` holds the defaults. Each token is a dynamic `UIColor`, so
> using it in your own views follows the appearance:
>
> ```swift theme={null}
> let badge = UILabel()
> badge.text = "New"
> badge.font = CometChatUIKitTheme.shared.caption1Medium
> badge.textColor = CometChatUIKitTheme.shared.primaryButtonText
> badge.backgroundColor = CometChatUIKitTheme.shared.primary
> ```

***

## Override Colors

> [tab] SwiftUI
>
> Derive from a brand colour, then set any token on the value:
>
> ```swift theme={null}
> var theme = CometChatTheme()
> theme.light = .derived(primary: Color(red: 0.97, green: 0.41, blue: 0.03), isDark: false)
> theme.light.background1 = .white
> theme.light.textPrimary = .black
> theme.light.strokeDefault = Color(red: 0.88, green: 0.88, blue: 0.88)
> ```
>
> ```swift theme={null}
> MyAppRoot()
>     .cometChatTheme(brandTheme)
> ```

> [tab] UIKit
>
> ```swift theme={null}
> let theme = CometChatUIKitTheme.shared
> theme.setBrandColor(UIColor(red: 0.97, green: 0.41, blue: 0.03, alpha: 1))
> theme.background1 = .white
> theme.textPrimary = .black
> theme.strokeDefault = UIColor(white: 0.88, alpha: 1)
> ```

![Conversations with a brand colour driving the whole derived palette](https://mintcdn.com/cometchat-22654f5b/pWDsskjSUHgot30F/images/ui-kit/ios/v6/docs-brand.png?fit=max\&auto=format\&n=pWDsskjSUHgot30F\&q=85\&s=1e6677b15b1b69450e7fc98b553f2099)

One brand colour, nothing else set

***

## Derived Colors

The "Defined as" column above is live in both toolkits, with one difference:

> [tab] SwiftUI
>
> `.derived(primary:isDark:)` resolves every reference when it builds the scheme. Once
> you have the value, each token is a plain `Color`: setting `neutral300` afterwards does not
> move `background4`. Set the dependent tokens too, or derive again.

> [tab] UIKit
>
> A token defined as another **follows it until you set it**: set `neutral300`
> and `background4` and `strokeDefault` change with it; set `primary` and `strokeHighlight`,
> `textHighlight`, `iconTintHighlight`, `primaryButtonBackground` and `fabButtonBackground`
> follow. Only `setBrandColor(_:)` recomputes the `extendedPrimary` ramp.
>
> ```swift theme={null}
> CometChatUIKitTheme.shared.neutral300 = UIColor(white: 0.85, alpha: 1)
> // background4 and strokeDefault are now this colour too.
> ```

## Next Steps

> [card] [Theme Introduction](https://www.cometchat.com/docs/ui-kit/ios/v6/theming.md)
>
> Apply a theme, typography and dark appearance.

> [card] [Component Styling](https://www.cometchat.com/docs/ui-kit/ios/v6/component-styling.md)
>
> Override colours for one component.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.