# Layer transparency

**URL:** https://community.keyboard.io/t/layer-transparency/733
**Category:** Programming
**Created:** [November 9, 2017, 11:16am UTC](https://community.keyboard.io/t/layer-transparency/733 "2017-11-09T11:16:07Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![dshields](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@dshields](https://community.keyboard.io/u/dshields)
#### Post date: [November 9, 2017, 11:16am UTC](https://community.keyboard.io/t/layer-transparency/733/1 "2017-11-09T11:16:07Z")

</div>

I have replaced the function layer with two separate layers. Key transparency from the default layer to the first layer works as expected. Transparency from keys defined in the first layer to the second doesn’t work as I would expect. The second layer is getting keys from the default layer rather than the one below.

Is this behaviour expected?

---

<div class="post-metadata">

### Author: ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)
#### Post date: [November 9, 2017, 1:26pm UTC](https://community.keyboard.io/t/layer-transparency/733/2 "2017-11-09T13:26:12Z")

</div>

If you share your `.ino` file, I’m pretty sure we can work out what’s gone wrong.

---

<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: [November 9, 2017, 2:07pm UTC](https://community.keyboard.io/t/layer-transparency/733/3 "2017-11-09T14:07:25Z")

</div>

Transparency gets you keys from the **active** layers below. If you have three layers, with 0 and 2 active, transparent keys on layer 2 will be from layer 0. If you make layer 1 active too, then the transparent keys of layer 2 will be looked for on layer 1. If they are still transparent there, then from layer 0.

Does this clear things up a bit?

---

<div class="post-metadata">

### Author: ![dshields](https://avatars.discourse-cdn.com/v4/letter/d/b9bd4f/32.png) [@dshields](https://community.keyboard.io/u/dshields)
#### Post date: [November 9, 2017, 3:01pm UTC](https://community.keyboard.io/t/layer-transparency/733/4 "2017-11-09T15:01:39Z")

</div>

That makes sense, I’ll adjust the key maps accordingly.

---

<div class="post-metadata">

### Author: ![Jennigma](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jennigma/32/353_2.png) [@Jennigma](https://community.keyboard.io/u/Jennigma)
#### Post date: [November 9, 2017, 4:51pm UTC](https://community.keyboard.io/t/layer-transparency/733/5 "2017-11-09T16:51:20Z")

</div>

Argh. This is the metaphor issue we were talking about here:

> [@Multiple layers?](https://community.keyboard.io/t/multiple-layers/401/24):
>
> I agree that the wording doesn’t convey unambiguously. My metaphor for the keymaps is like a kids picture book with transparent overlay pages, but of course that fails because with a keymap stack you can apply each layer independently without the ones below it, while in a picture book if you are looking at layer 3 then layers 1 and 2 are also active. A metaphor of a stack of layers with toggle switches would more closely reflect the design than my picture book, so I see the merit of “Toggle.” …

I’ll adjust the intro document to be more correct right now. Might make sense to make a comment about this in the Model01-Firmware.ino as well. I am still not convinced that renaming the function names is the best course, but this behavior is going to confuse a lot of smart people, and we should think seriously about how to mitigate it.

---

<div class="post-metadata">

### Author: ![Jennigma](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jennigma/32/353_2.png) [@Jennigma](https://community.keyboard.io/u/Jennigma)
#### Post date: [November 9, 2017, 5:15pm UTC](https://community.keyboard.io/t/layer-transparency/733/6 "2017-11-09T17:15:49Z")

</div>

Improved section. Commentary welcome:

> **[keyboardio/Kaleidoscope](https://github.com/keyboardio/Kaleidoscope/wiki/Keyboardio-Model-01-Introduction#editing-keymaps)**
>
> Firmware for the Keyboardio Model 01 and other keyboards with AVR or ARM MCUs. - keyboardio/Kaleidoscope
