That’s a miracle then! There are only two layers, because layers are essentially used to mix the button interaction with encoder rotations. Moreover only the encoder control element or TEK2’s endless rotary control element have 2 layers for LED control.
- layer 1: the button interaction
- layer 2: the rotation interaction
When you press an encoder, while it is rotated to a value, the two led layer’s value will be mixed together to get the resulting color. They often “burn out” to white, but you can test this if you set the led intensities lower and mix a blue with red for a purple color.
Your idea about declaring led colors in tables is legit, I usually do that.
You can do that either globally on system event’s init like
colors = {
{255,0,0},
{125,50,0}
}
Or if you want it element scoped on init, then
self.colors = {
{255,0,0},
{125,50,0}
}
Probably instead of colors, just use c or similar short character variable name to spare characters.
Also on a event, you could use the first color from the table like this, layer is 1 or 2 if encoder:
led_color(self:element_index(), LAYER, self.c[1][1], self.c[1][2],self.c[1][3])