# Custom background color in files section

**URL:** <https://forum.getkirby.com/t/custom-background-color-in-files-section/16217>\
**Category:** Questions\
**Tags:** v3\
**Created:** [November 7, 2019, 4:11pm UTC](https://forum.getkirby.com/t/custom-background-color-in-files-section/16217 "2019-11-07T16:11:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![VIPStephan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/vipstephan/32/14662_2.png) [@VIPStephan](https://forum.getkirby.com/u/VIPStephan)\
**Post date:** [November 7, 2019, 4:11pm UTC](https://forum.getkirby.com/t/custom-background-color-in-files-section/16217/1 "2019-11-07T16:11:39Z")

</div>

I’m using the awesome [Color Palette](https://github.com/sylvainjule/kirby-color-palette/) plugin to assign colors to pages and use these in templates, and I’d also like to show these colors in the pages sections in the panel. Is there a way to do this?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 7, 2019, 4:47pm UTC](https://forum.getkirby.com/t/custom-background-color-in-files-section/16217/2 "2019-11-07T16:47:58Z")

</div>

Yes, that is possible with a page model that returns some html with a class or inline styles

Example, assuming you have a field `pageColor`:

```auto
class NotePage extends Page
{
    public function color()
    {
        $html = '<span class="'. $this->pagecolor() .'"></span>';
        return $html;
    }
}

```

Then in info:

```auto
info: "{{ page.color }}"

```

---

<div class="post-metadata">

**Author:** ![VIPStephan](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/vipstephan/32/14662_2.png) [@VIPStephan](https://forum.getkirby.com/u/VIPStephan)\
**Post date:** [November 7, 2019, 5:23pm UTC](https://forum.getkirby.com/t/custom-background-color-in-files-section/16217/3 "2019-11-07T17:23:58Z")

</div>

Thanks. And sorry, I forgot to mention that I’d like this color to show up as background color in the icon/image part of the page item. I don’t suppose that info is doing that, right?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [November 7, 2019, 5:37pm UTC](https://forum.getkirby.com/t/custom-background-color-in-files-section/16217/4 "2019-11-07T17:37:39Z")

</div>

I see, no, the icon/image part is controlled via the image option and can have either an icon or an image.

I see basically two options:

- a custom pages section that puts a color swatch where the image/icon should be
- a method that generates a mini-image from the color value and use that as the image
