We are fine with the cached value, so lets use that and save a little time,
rather than the always-correct `Layer.top()`.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Now that we only care about the highest active layer, make sure we only do work
if that changed between two cycles. This way, `onActivate()` will take care of
the initial setup, `update()` will be an almost no-op for most of the time, and
`refreshAt()` will take care of refreshing keys other plugins may have changed.
This makes us about twice as fast as we were, on average.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
The underlying `LED-PaletteTheme` plugin stopped supporting transparent colors,
and as a consequence, so did we. Update the README accordingly.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Instead of iterating down from the 32th layer, do so from `max_layers_` instead.
Not only is this more performant, it allows us to have higher layers outside of
Colormap's control.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Put the return type and the function name on the same line in the .cpp file too.
While neither astyle, nor cpplint warn about this, this is how Kaleidoscope core
does it, so lets do the same.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Use astyle 3.0 (included in Kaleidoscope-Plugin) to apply styling, instead of
whatever came with Debian Stretch.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Rearranged both in style, and in naming conventions to match the Kaleidoscope
Style Guide, and please the linter too.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Full documentation takes way too much space, and command names are a reasonable
compromise for discoverability.
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>
Since we always read input sequentially, use a single while loop for both
palette and map input. Less calculations, less code, more free space. And we can
now upload a partial palette too!
Signed-off-by: Gergely Nagy <algernon@madhouse-project.org>