# Color

#### Customize Theme Colors

To change the color of the theme, you can either apply the color directly to `src\theme\palette.tsx` **or** define a new variable in `src\assets\scss\_themes-vars.module.scss` and replace it in `palette.tsx`

For instance, if you want to change the color that `theme.palette.primary.light` is being used in a theme, then update the following in **`src\themes\palette.tsx`**

{% tabs %}
{% tab title="Typescript" %}
{% code title="" %}

```typescript
import defaultColor from 'assets/scss/_themes-vars.module.scss';

/**
 * Color intention that you want to used in your theme
 */
export default function Palette(mode: ThemeMode, presetColor: PresetColor) {
  let colors: ColorProps;
  switch (presetColor) {
    case 'theme1':
      colors = theme1;
        ...
        ...
    };
    
  return createTheme({
    palette: {
      mode,
      common: {
        black: colors.darkPaper
      },
      ...
    }
  });
}
```

{% endcode %}
{% endtab %}

{% tab title="Javascript" %}

```javascript
import defaultColor from 'assets/scss/_themes-vars.module.scss';

/**
 * Color intention that you want to used in your theme
 */
export default function Palette(mode, presetColor) {
  let colors: ColorProps;
  switch (presetColor) {
    case 'theme1':
      colors = theme1;
        ...
        ...
    };
    
  return createTheme({
    palette: {
      mode,
      common: {
        black: colors.darkPaper
      },
      ...
    }
  });
}
```

{% endtab %}
{% endtabs %}

{% code title="src/themes/palette.tsx" %}

```javascript
import defaultColor from 'assets/scss/_themes-vars.module.scss';

/**
 * Color intention that you want to used in your theme
 */
export default function Palette(mode: ThemeMode, presetColor: PresetColor) {
  let colors: ColorProps;
  switch (presetColor) {
    case 'theme1':
      colors = theme1;
        ...
        ...
    };
    
  return createTheme({
    palette: {
      mode,
      common: {
        black: colors.darkPaper
      },
      ...
    }
  });
}
```

{% endcode %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://codedthemes.gitbook.io/berry/theme/theme-config/color.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
