---
name: kimaai_chatbot_theme
type: filter
since: 1.3.5
tier: free
feature: chatbot-appearance
area: chatbot
summary: Changes the six colours of the chatbot's older theme; deprecated for kimaai_chatbot_theme_vars.
parameters:
  - name: theme
    type: array
    description: The six colours, bodyBgColor, bodyTextColor, userMessageBgColor, userMessageTextColor, aiMessageBgColor and aiMessageTextColor, derived from the current theme.
returns:
  type: array
  description: The six colours to use.
deprecated:
  since: 1.6.0
  replacement: kimaai_chatbot_theme_vars
  removal: 1.8.0
---

# kimaai_chatbot_theme

## When it fires

Right after `kimaai_chatbot_theme_vars`, once per colour mode, while the widget's style is built. It still works, and WordPress gives its deprecation notice when a callback is hooked to it. Move to `kimaai_chatbot_theme_vars`: it reaches every colour of the widget and knows the colour mode.

The six keys come from the current theme's colours, so a callback that returns them unchanged changes nothing. When it changes any of them, KimaAI sets the stylesheet's older properties from all six, `--kimaai-chatbot-primary` and the `--kimaai-chatbot-*-override` properties for the text, the body, the header and the two kinds of message, in both colour modes; they win over the theme's own colours.

## Example

```php
add_filter(
  'kimaai_chatbot_theme',
  function (array $theme): array {
    $theme['bodyBgColor'] = '#14213d';
    $theme['bodyTextColor'] = '#ffffff';

    return $theme;
  }
);
```

## More examples

The same with `kimaai_chatbot_theme_vars`, which also gives the dark pages their own colour:

```php
add_filter(
  'kimaai_chatbot_theme_vars',
  function (array $vars, array $theme, array $appearance, array $look, string $scheme): array {
    $vars['--kimaai-w-header-bg'] = $scheme === 'dark' ? '#1e3a5f' : '#14213d';
    $vars['--kimaai-w-header-text'] = '#ffffff';

    return $vars;
  },
  10,
  5
);
```

## Related

- `kimaai_chatbot_theme_vars`: the replacement.
