# Custom Per Layer LED Colors

**URL:** <https://community.keyboard.io/t/custom-per-layer-led-colors/5027>\
**Category:** Uncategorized\
**Created:** [September 9, 2021, 2:29pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027 "2021-09-09T14:29:44Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcavalari](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/dcavalari/32/5289_2.png) [@dcavalari](https://community.keyboard.io/u/dcavalari)\
**Post date:** [September 9, 2021, 2:29pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/1 "2021-09-09T14:29:44Z")

</div>

Had this working on my old firmware a few years ago, but the Kaleidoscope API seems to have changed and now I’m having trouble figuring it out. My goal is that when I toggle to some layer other than layer 0, I want the layer toggle key lit up in red so that I know I’m on an alternate layer and what key to press to get back to layer 0.

Nice to have: I’d also like to set a default color scheme for layer 0, and restore it when returning to the home layer.

Using Chrysalis is not an option for me because I have a mouse navigation layer that I use a lot, and Chrysalis doesn’t have good support for this last I checked.

---

<div class="post-metadata">

**Author:** ![dcavalari](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/dcavalari/32/5289_2.png) [@dcavalari](https://community.keyboard.io/u/dcavalari)\
**Post date:** [September 10, 2021, 1:32pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/2 "2021-09-10T13:32:35Z")

</div>

Whoops, found a post with the answer to this, and it looks like I read it some time ago and forgot about it. 😅

This is what you get for leaving your firmware file on your work computer and then not copying it when you switch jobs…

---

<div class="post-metadata">

**Author:** ![rhinestonebones](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@rhinestonebones](https://community.keyboard.io/u/rhinestonebones)\
**Post date:** [October 2, 2022, 5:26am UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/3 "2022-10-02T05:26:13Z")

</div>

Did you manage to get this working? If so, can you share your .ino file? The only useful info I can find on this is the old post you mentioned, which is a bit hard to follow.

---

<div class="post-metadata">

**Author:** ![dcavalari](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/dcavalari/32/5289_2.png) [@dcavalari](https://community.keyboard.io/u/dcavalari)\
**Post date:** [October 3, 2022, 2:23pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/4 "2022-10-03T14:23:48Z")

</div>

Sure, here it is  
[Model01-Firmware.ino](https://community.keyboard.io/uploads/short-url/i3ZEvrBU2WRxghvCtPGy77XDee2.ino) (22.3 KB)

---

<div class="post-metadata">

**Author:** ![dcavalari](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/dcavalari/32/5289_2.png) [@dcavalari](https://community.keyboard.io/u/dcavalari)\
**Post date:** [October 3, 2022, 2:30pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/5 "2022-10-03T14:30:02Z")

</div>

Most interesting part to look at is the `LayerColorOverride` class. I have (currently) the rainbow wave effect on the main layer, and then custom colors to indicate the “numpad” and “mouse” layers.

The most confusing part about this IMO is figuring out which KeyAddr corresponds to which specific key, although you can easily do some trial and error to work that out. IIRC, it’s just a 2d array with four “rows” and 16 “columns” - “row” and “column” don’t apply as cleanly to the middle columns and the rows of thumb keys, but it’s easy enough to do some trial and error to work out the physical mapping in those cases.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [October 3, 2022, 2:38pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/6 "2022-10-03T14:38:57Z")

</div>

> [@dcavalari](#):
>
> The most confusing part about this IMO is figuring out which KeyAddr corresponds to which specific key, although you can easily do some trial and error to work that out.

FWIW, the row & columns used for KeyAddr are the same as the names used in here:

> <https://github.com/keyboardio/Kaleidoscope/blob/fefc6699baec3bb84defb1ee5d6bc46c9de0ff3e/plugins/Kaleidoscope-Hardware-Keyboardio-Model100/src/kaleidoscope/device/keyboardio/Model100.h#L176-L188>

Or, for a more visual representation:

> **[Keyboard Layout Editor](https://www.keyboard-layout-editor.com/)**

---

<div class="post-metadata">

**Author:** ![rhinestonebones](https://avatars.discourse-cdn.com/v4/letter/r/58956e/32.png) [@rhinestonebones](https://community.keyboard.io/u/rhinestonebones)\
**Post date:** [October 7, 2022, 3:13pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/7 "2022-10-07T15:13:14Z")

</div>

Thanks for this info, i’ll give it a look this weekend. 🙂

---

<div class="post-metadata">

**Author:** ![dcavalari](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/dcavalari/32/5289_2.png) [@dcavalari](https://community.keyboard.io/u/dcavalari)\
**Post date:** [October 18, 2022, 6:01pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/8 "2022-10-18T18:01:23Z")

</div>

So this is interesting: I ported this firmware pretty much verbatim to my Model100 when I got it. It seems to work fine, except for a very odd bug. In the “NUMPAD” layer, the CRGB values seem to be interpreted backwards. For example, the key marked CRGB(160, 0, 0) appears blue, while the keys marked CRGB(0, 0, 170) are red. It’s only an issue on that one layer, and only on the Model100.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [October 18, 2022, 6:27pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/9 "2022-10-18T18:27:56Z")

</div>

> [@dcavalari](#):
>
> For example, the key marked CRGB(160, 0, 0) appears blue, while the keys marked CRGB(0, 0, 170) are red. It’s only an issue on that one layer, and only on the Model100.

I’m fairly certain that this is the `NumPad` plugin in play. The NumPad plugin will override any other LED mode on the NUMPAD layer. Is the blue key breathing? If so, that’s 100% NumPad. I’d suggest disabling that plugin if you want custom colors on that layer.

---

<div class="post-metadata">

**Author:** ![dcavalari](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/dcavalari/32/5289_2.png) [@dcavalari](https://community.keyboard.io/u/dcavalari)\
**Post date:** [October 18, 2022, 7:00pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/10 "2022-10-18T19:00:54Z")

</div>

> [@algernon](#):
>
> Is the blue key breathing?

Indeed it is! Thanks, I bet that’s it then!

---

<div class="post-metadata">

**Author:** ![dlyr](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/dlyr/32/4667_2.png) [@dlyr](https://community.keyboard.io/u/dlyr)\
**Post date:** [March 7, 2023, 9:18pm UTC](https://community.keyboard.io/t/custom-per-layer-led-colors/5027/11 "2023-03-07T21:18:34Z")

</div>

Since I first found this post after finding a bundled plugin:  
As of mars 2023, you can use several plugins to achieve these per mod led colors  
e.g.

- [LED-ActiveLayerColor — Kaleidoscope documentation](https://kaleidoscope.readthedocs.io/en/stable/plugins/Kaleidoscope-LED-ActiveLayerColor.html)
- [Colormap — Kaleidoscope documentation](https://kaleidoscope.readthedocs.io/en/stable/plugins/Kaleidoscope-Colormap.html)

See more plugins [Bundled plugins — Kaleidoscope documentation](https://kaleidoscope.readthedocs.io/en/stable/plugin_list.html), and led documentation.
