Use `Kaleidoscope.use` and `Kaleidoscope.useEventHandlerHook` instead of the
deprecated `USE_PLUGINS` and `event_handler_hook_use` interfaces.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Use `Kaleidoscope.use` and `Kaleidoscope.useEventHandlerHook` instead of the
deprecated `USE_PLUGINS` and `event_handler_hook_use` interfaces.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Use `Kaleidoscope.use`, `Kaleidoscope.useEventHandlerHook`, and
`Kaleidoscope.useLoopHook` instead of the deprecated `USE_PLUGINS`,
`event_handler_hook_use`, and `loop_hook_use` interfaces.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Use `Kaleidoscope.useEventHandlerHook` and `Kaleidoscope.useLoopHook` instead of
the deprecated `event_handler_hook_use` and `loop_hook_use` interfaces.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
As `USE_PLUGINS` and `loop_hook_use` are getting deprecated, use the newer APIs:
`Kaleidoscope.use` and `Kaleidoscope.useLoopHook`.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Use `Kaleidoscope.useEventHandlerHook` instead of `event_handler_hook_use`,
which is getting deprecated.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Use `Kaleidoscope.use`, `Kaleidoscope.useEventHandlerHook`, and
`Kaleidoscope.useLoopHook` instead of `USE_PLUGINS`, `event_handler_hook_use`,
and `loop_hook_use`, which are getting deprecated.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
`USE_PLUGINS` and `loop_hook_use` are deprecated, use `Kaleidoscope.use` and
`Kaleidoscope.useLoopHook` instead.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Use `Kaleidoscope.use` and `Kaleidoscope.useEventHandlerHook` instead of the
obsolete `USE_PLUGINS` and `event_handler_hook_use` interfaces.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Sometimes we would like to know the highest active layer, which is available in
the `highestLayer` private variable, and via `.top()` too. We do not want to
make `highestLayer` public, because we want to be the only ones changing it. And
while `top()` gets us roughly the same information, it does so at a cost. For a
lot of purposes, the cached `highestLayer` would be perfectly adequate.
The new `Layer.highest()` accessor does just this.
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>
Supporting transparency is very, very expensive in terms of speed, while the
benefits are marginal at best. Drop support for it for now.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>
Instead of using `Kaleidoscope-Ranges` and custom helper functions with magic
constants to decide whether we need to highlight a key, refresh it, or leave it
alone, use an if-else chain and inner ifs for activity.
Leverages the new `OneShot.isOneShotKey(key)` and `OneShot.isActive(key)`
methods.
The net result is slightly cleaner code (though it can still be improved), and
about 0.2ms saved, along with some PROGMEM space.
Signed-off-by: Gergely Nagy <kaleidoscope@gergo.csillger.hu>