You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Kaleidoscope/README.md

2.5 KiB

Kaleidoscope-Colormap

status Build Status

The Colormap extension provides an easier way to set up a different - static - color map per-layer. This means that we can set up a map of colors for each key, on a per-layer basis, and whenever a layer becomes active, the color map for that layer is applied on top of everything else. Colors are picked from a 15-color palette (or 16, if we disable transparency), provided by the LED-Palette-Theme plugin. The color map is stored in EEPROM, and can be easily changed via the Focus plugin, which also provides palette editing capabilities.

Using the extension

To use the extension, include the header, tell it the number of layers you have, register the Focus hooks, and it will do the rest.

#include <Kaleidoscope.h>
#include <Kaleidoscope-Colormap.h>
#include <Kaleidoscope-Focus.h>

void setup(void) {
  Kaleidoscope.setup();
  USE_PLUGINS(&ColormapEffect, &Focus);
  
  ColormapEffect.max_layers(1);
  Focus.addHook(FOCUS_HOOK_LEDPALETTETHEME);
  Focus.addHook(FOCUS_HOOK_COLORMAP);
}

Extension methods

The extension provides an ColormapEffect singleton object, with a single method:

.max_layers(max)

Tells the extension to reserve space in EEPROM for up to max layers. Can only be called once, any subsequent call will be a no-op.

Dependencies

Further reading

Starting from the example is the recommended way of getting started with the plugin.