# Invalid Colour Name

**URL:** <https://discourse.cataclysmdda.org/t/invalid-colour-name/14734>\
**Category:** The Toolbox\
**Created:** [January 4, 2018, 8:09am UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734 "2018-01-04T08:09:49Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aggregate](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/aggregate/32/1484_2.png) [@Aggregate](https://discourse.cataclysmdda.org/u/Aggregate)\
**Post date:** [January 4, 2018, 8:09am UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734/1 "2018-01-04T08:09:49Z")

</div>

I’m attempting to apply colour to a monster but getting the following error:

 ![invalid_colour](https://us1.discourse-cdn.com/flex016/uploads/cataclysmdda/original/2X/e/e7078eb929c955674920a46a7eae8f5806360d51.png)

I literally just copy-pasted it from COLOR.md, as far as I know it should work. I’ve also had problems with, I think, all of the colour combinations I’ve tried. Assistance would be appreciated.

Also, is there a way to stop COLOR.md from being turned into a link?

Not quite related, but is there a way to give a monster a reusable flashbang, akin to the Flashbang Generator CBM?

---

<div class="post-metadata">

**Author:** ![NuG](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/nug/32/7057_2.png) [@NuG](https://discourse.cataclysmdda.org/u/NuG)\
**Post date:** [January 4, 2018, 5:18pm UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734/2 "2018-01-04T17:18:01Z")

</div>

Colors were changed or something recently, I think light was changed to lt and dark to dk(better info in links below).  
[Error with some Mods](https://discourse.cataclysmdda.org/t/error-with-some-mods/14580/7?u=nug) is where I just got my info and/or  
[https://github.com/CleverRaven/Cataclysm-DDA/pull/22535](https://github.com/CleverRaven/Cataclysm-DDA/pull/22535) might be relevant .

---

<div class="post-metadata">

**Author:** ![Aggregate](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/aggregate/32/1484_2.png) [@Aggregate](https://discourse.cataclysmdda.org/u/Aggregate)\
**Post date:** [January 4, 2018, 10:02pm UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734/3 "2018-01-04T22:02:14Z")

</div>

They were actually changed from lt\_ to light\_ etc, and I’m fairly sure that the “[COLOR.md](http://COLOR.md)” file was added around that time.

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [January 4, 2018, 10:54pm UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734/4 "2018-01-04T22:54:18Z")

</div>

`invalid color name` error will be thrown when `color_from_string` function returns `c_unset`.

---

<div class="post-metadata">

**Author:** ![Aggregate](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/aggregate/32/1484_2.png) [@Aggregate](https://discourse.cataclysmdda.org/u/Aggregate)\
**Post date:** [January 4, 2018, 11:03pm UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734/5 "2018-01-04T23:03:23Z")

</div>

Right, nice to know why the error’s thrown (even if I’m not code savvy enough to actually understand it), but it _should_ be working. There are even existing working examples; the zombie hulk and dancer use “color”: “white\_magenta”,.

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [January 4, 2018, 11:05pm UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734/6 "2018-01-04T23:05:11Z")

</div>

I agree, but it seems error is thrown for some valid combinations of foreground and background color.

---

<div class="post-metadata">

**Author:** ![Zhilkin](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/zhilkin/32/3749_2.png) [@Zhilkin](https://discourse.cataclysmdda.org/u/Zhilkin)\
**Post date:** [January 4, 2018, 11:36pm UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734/7 "2018-01-04T23:36:46Z")

</div>

It seems all possible color combinations are hardcoded.

You can see them in `Settings - Colors` menu or in `color_manager::load_default()` function:

> <https://github.com/CleverRaven/Cataclysm-DDA/blob/master/src/color.cpp#L207>

---

<div class="post-metadata">

**Author:** ![Aggregate](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/aggregate/32/1484_2.png) [@Aggregate](https://discourse.cataclysmdda.org/u/Aggregate)\
**Post date:** [January 5, 2018, 1:10am UTC](https://discourse.cataclysmdda.org/t/invalid-colour-name/14734/8 "2018-01-05T01:10:31Z")

</div>

That’s unfortunate. Still, thank you for the assistance.
