# Could not resolve function 'color'

**URL:** <https://community.hubspot.com/t/could-not-resolve-function-color/41358>\
**Category:** CMS Development\
**Tags:** css\
**Created:** [July 27, 2021, 2:39pm UTC](https://community.hubspot.com/t/could-not-resolve-function-color/41358 "2021-07-27T14:39:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawel\_p](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pawel_p/32/43030_2.png) [@pawel\_p](https://community.hubspot.com/u/pawel_p)\
**Post date:** [July 27, 2021, 2:39pm UTC](https://community.hubspot.com/t/could-not-resolve-function-color/41358/1 "2021-07-27T14:39:36Z")

</div>

I have an error in my CSS file saying “Could not resolve function ‘color’” on the line where I have the theme override specific styles:

```lia-code-sample
/* Theme Override Specific style */
{% set header_bg_color = color(theme.header.background_color) %}
{% set footer_bg_color = color(theme.footer.background_color) %}

```

The current setting in fields.json are as follow:

```lia-code-sample
[
 {
 "label": "Website header",
 "name": "header",
 "type": "group",
 "children": [
 {
 "label": "Background color",
 "name": "background_color",
 "type": "color",
 "default": {
 "color": "#EFEFEF",
 "opacity": 100
 }
 }
 ]
 },
 {
 "label": "Website footer",
 "name": "footer",
 "type": "group",
 "children": [
 {
 "label": "Background color",
 "name": "background_color",
 "type": "color",
 "default": {
 "color": "#EFEFEF",
 "opacity": 100
 }
 }
 ]
 }
]

```

Please help if you have an idea why I have these errors: ‘Error: Cannot resolve property’ and ‘Error: Syntax error’.

Thnak you

---

<div class="post-metadata">

**Author:** ![Teun](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/teun/32/28739_2.png) [@Teun](https://community.hubspot.com/u/Teun)\
**Post date:** [July 27, 2021, 2:51pm UTC](https://community.hubspot.com/t/could-not-resolve-function-color/41358/2 "2021-07-27T14:51:10Z")

</div>

Hi [@pawel\_p](https://community.hubspot.com/t5/user/viewprofilepage/user-id/218132) , where did you find the `color()` function? You should be able to set the variables like this:

```lia-code-sample
{% set header_bg_color = theme.header.background_color.color %}
{% set footer_bg_color = theme.footer.background_color.color %}

```

You can also access the opacity like this:

```lia-code-sample
{% set header_bg_opacity = theme.header.background_color.opacity %}
{% set footer_bg_opcaity = theme.footer.background_color.opacity %}

```

---

<div class="post-metadata">

**Author:** ![pawel\_p](https://d10pqhm3lwygmk.cloudfront.net/user_avatar/community.hubspot.com/pawel_p/32/43030_2.png) [@pawel\_p](https://community.hubspot.com/u/pawel_p)\
**Post date:** [July 27, 2021, 3:10pm UTC](https://community.hubspot.com/t/could-not-resolve-function-color/41358/3 "2021-07-27T15:10:30Z")

</div>

Thanks. I manage to fix that before you sen the reply.

The color() function I saw in a boilerplate theme, when i created a example in a Design Tool.
