# New Plugin: ColorManager

**URL:** <https://kanboard.discourse.group/t/new-plugin-colormanager/2541>\
**Category:** Plugins\
**Created:** [December 21, 2022, 5:43am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541 "2022-12-21T05:43:29Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [December 21, 2022, 5:43am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/1 "2022-12-21T05:43:29Z")

</div>

Hey All

This new plugin will show up soon in the official directory. Quite simply, its just displays the default colours in Kanboard.

> **[GitHub - aljawaid/ColorManager: A new way to utilise colors to their full...](https://github.com/aljawaid/ColorManager)**
>
> A new way to utilise colors to their full potential in Kanboard. Choose from 3 color palettes, default, extra (includes white) or create your own. - GitHub - aljawaid/ColorManager: A new way to uti...

---

<div class="post-metadata">

**Author:** ![FxFx](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/fxfx/32/1358_2.png) [@FxFx](https://kanboard.discourse.group/u/FxFx)\
**Post date:** [December 21, 2022, 8:14pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/2 "2022-12-21T20:14:40Z")

</div>

Good to see that there is activtiy in the plugin development. Thanks!

Is it possible to change or add one of the colors in Kanboard with this plugin?

I’am aiming for “white” as a default color for the tasks (or better: no color).

Cheers, fx

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [December 21, 2022, 8:33pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/3 "2022-12-21T20:33:14Z")

</div>

hello, thanks for the comments.

At the moment, this plugin just displays the default colours as they were not really properly shown anywhere except as text dropdowns.

I needed this default colour list for the TagManager plugin as that uses the colours also. I have a custom css file for all my tags with different colours away from the default. Basically I am trying to work with the default and new colours. So it is a work in progress as the kanboard docs are the biggest probable reason that people dont develop new plugins.

White? difficult to display but ‘no color’ already exists… if you want, I can alter my plugin to dictate no colour instead of blank. Let me look into it. BUt ou of curiousity, why would you want white task/tag colour on a white screen page?

TagManager plugin (colours)

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/1/116b8af6b65814d98a909889e86aae5fea175a8b.png)

---

<div class="post-metadata">

**Author:** ![FxFx](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/fxfx/32/1358_2.png) [@FxFx](https://kanboard.discourse.group/u/FxFx)\
**Post date:** [December 22, 2022, 7:20am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/4 "2022-12-22T07:20:08Z")

</div>

Sounds good to me. And now i understand what you are aiming for.

Well, i need (white / no color) for a task because i’am working on a theme (i will release that once i’am fine with it). In that theme the task will not have a complete background color. The color ist only on one side of the border of a task. And i would like to choose “no color” in the drop down menu when creating or editing the task basic informations.

At the moment i simply override “gray” with “white” in the css of the Theme (how ugly). I fear that a change of that drop down list requires changes to the core… i don’t know.

Cheers, fx

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [December 22, 2022, 1:45pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/5 "2022-12-22T13:45:00Z")

</div>

There is a hook, you can add colors there:

> <https://github.com/kanboard/kanboard/blob/7c0a239ec399124207b86fcd6b22ade38c5c7574/app/Model/ColorModel.php#L157>

---

<div class="post-metadata">

**Author:** ![FxFx](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/fxfx/32/1358_2.png) [@FxFx](https://kanboard.discourse.group/u/FxFx)\
**Post date:** [December 22, 2022, 2:08pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/6 "2022-12-22T14:08:59Z")

</div>

Thanks creecros!

You mean i can “simply” write a smal PlugIn to archieve to add one ore more colors?

Well, i have to dive deeper into that. I’am not bad in programming, but i’am not used to PHP or the details of KanBoard PlugIn development.

Anyway, thanks for that hint. I will have closer look!

Cheers, fx

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [December 22, 2022, 3:07pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/7 "2022-12-22T15:07:19Z")

</div>

if you figure out a way do let me know so I can add it to the plugin

> <https://github.com/aljawaid/KBColours/issues/1>
>
> \- How can we add a colour to the default colours model?
> \- Should we create a ne…w database for new colours? or add in the app settings metadata?

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [December 22, 2022, 3:39pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/8 "2022-12-22T15:39:37Z")

</div>

i think that was the intent of the hook, but personally, i dont see how that hook does a darn thing. I asked fred in your KB issue regarding colors. maybe he will enlighten us.

maybe it is an oversight or maybe i am missing something:

```auto
    public function getList($prepend = false)
    {
        $listing = $prepend ? array('' => t('All colors')) : array();

        foreach ($this->default_colors as $color_id => $color) {
            $listing[$color_id] = t($color['name']);
        }

        $this->hook->reference('model:color:get-list', $listing);

        return $listing;
    }

```

the return will always be `$listing`, no matter what we do within the hook. unless there is someway to actually return a variable from the hook that acually is capable of changing the value of `$listing`.

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [December 22, 2022, 3:51pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/9 "2022-12-22T15:51:10Z")

</div>

Never mind I figured it out…i’ll eplain it in a bit.

---

<div class="post-metadata">

**Author:** ![creecros](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/creecros/32/156_2.png) [@creecros](https://kanboard.discourse.group/u/creecros)\
**Post date:** [December 22, 2022, 4:20pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/10 "2022-12-22T16:20:54Z")

</div>

If you want this in a plugin:  
You can alter the list by adding to Plugin.php like so:

```auto
        $this->hook->on('model:color:get-list', function (&$listing) {
            $new_colors = array(
                'maroon' => array(
                    'name' => 'Maroon',
                ),);
            $new_list = array();
            foreach ($new_colors as $color_id => $color) {
                $new_list[$color_id] = t($color['name']);
            }
            $listing = array_merge($listing, $new_list);
            return $listing;
        
        });

```

This will add `Maroon` to the drop down.  
 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/a/a40acdc0a91336b6ee217b849a24f3f28f1f3d83.png)

BUT, you cannot alter the “default” color list, as it is a protected variable. So the definitions are not buit into the css like the default colors. so you would need to include your own css with the color defintions for Maroon, in this example, or whatever colors you are adding to the list.

You could have this done automatically, by overriding the ColorModel and add your own Custom Colors and include them in the colorCss function, which is “meh” but at least its a plugin.

but it does work:  
 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/3/3b67cddd04d20f3aadf4140694a87d606163ba1d.png)

The no plugin method:  
you could simply edit the base code and add your custom colors into the protected color list, and there is no need to even use the hook.  
Found here:

> <https://github.com/kanboard/kanboard/blob/ce6c4dfc67713840b9f17551b816d3eef3bca3ab/app/Model/ColorModel.php#L21>

---

<div class="post-metadata">

**Author:** ![FxFx](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/fxfx/32/1358_2.png) [@FxFx](https://kanboard.discourse.group/u/FxFx)\
**Post date:** [December 22, 2022, 9:42pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/11 "2022-12-22T21:42:49Z")

</div>

Awesome 😃

This means i can easily add that to my own theme… I hope i will find some time over the upcoming holidays.

Great!

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [December 23, 2022, 12:33am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/12 "2022-12-23T00:33:36Z")

</div>

> You could have this done automatically, by overriding the ColorModel

just like a template override in plugin.php?

---

<div class="post-metadata">

**Author:** ![FxFx](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/fxfx/32/1358_2.png) [@FxFx](https://kanboard.discourse.group/u/FxFx)\
**Post date:** [December 23, 2022, 9:09am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/13 "2022-12-23T09:09:33Z")

</div>

Yes! Very welcome!

Cheers, fx

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [December 25, 2022, 7:07am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/14 "2022-12-25T07:07:26Z")

</div>

_Quick Update:_

- Big thanks to @creecros for advancing this plugin

Coming up in v2…

- KBColours becomes ColorManager (reinstall will be most likely required)
- add/delete custom colours
- Extra palette with text colors aimed at tags

Its not quite ready for v2 yet though… few more days…

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/9/94c4364a7cf54d852c981458470188206a77e80b.png)

---

<div class="post-metadata">

**Author:** ![FxFx](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/fxfx/32/1358_2.png) [@FxFx](https://kanboard.discourse.group/u/FxFx)\
**Post date:** [December 25, 2022, 9:40am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/15 "2022-12-25T09:40:52Z")

</div>

Looks great! Can’t wait to test it

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [December 28, 2022, 8:07am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/16 "2022-12-28T08:07:32Z")

</div>

**Released v2**

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/6/64af58ce3ad058ae868c66aa7c83c8200318d7c7.png)

---

<div class="post-metadata">

**Author:** ![FxFx](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/fxfx/32/1358_2.png) [@FxFx](https://kanboard.discourse.group/u/FxFx)\
**Post date:** [December 28, 2022, 10:23am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/17 "2022-12-28T10:23:12Z")

</div>

I will check that out as soon as possible!

Great!

---

<div class="post-metadata">

**Author:** ![aljawaid](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/aljawaid/32/1090_2.png) [@aljawaid](https://kanboard.discourse.group/u/aljawaid)\
**Post date:** [January 8, 2023, 6:07am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/18 "2023-01-08T06:07:46Z")

</div>

**Released v3.1**

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/5/5c7ac5bd5b95281d8a4fa630cfdf7245b61fc32a.png)

 ![image](https://global.discourse-cdn.com/free1/uploads/kanboard1/original/2X/3/39a49b09ed76622944367757b42774a1807d5b2a.png)

---

<div class="post-metadata">

**Author:** ![Celsior](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@Celsior](https://kanboard.discourse.group/u/Celsior)\
**Post date:** [June 6, 2024, 8:17pm UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/19 "2024-06-06T20:17:19Z")

</div>

Any way to add PNG image backgrounds to cards? I tried adding

```auto
'background-image' => 'url("image.png")',

```

directly to the ColorModel.php file, but so far no luck. (Image was uploaded to same directory as the php file.)

---

<div class="post-metadata">

**Author:** ![alfredb](https://yyz2.discourse-cdn.com/free1/user_avatar/kanboard.discourse.group/alfredb/32/1051_2.png) [@alfredb](https://kanboard.discourse.group/u/alfredb)\
**Post date:** [June 7, 2024, 9:07am UTC](https://kanboard.discourse.group/t/new-plugin-colormanager/2541/20 "2024-06-07T09:07:09Z")

</div>

No clue.  
This is rather a general question, surely not related to ColorManager.

[Next page](https://kanboard.discourse.group/t/new-plugin-colormanager/2541.md?page=2)
