Colormap-Overlay

This plugin provides an easier way to apply color to specific combinations of keys and layers, regardless of the active LED mode. Colors are picked from a 16-color palette, provided by the LED-Palette-Theme plugin. The overlays are stored in EEPROM, and can be easily changed via the FocusSerial plugin, which also provides palette editing capabilities.

It is also possible to set up a default palette and overrides, using the PALETTE macro provided by the LED-Palette-Theme package and the COLORMAP_OVERLAYS provided by this package. See below for its documentation.

Using the extension

To use the extension, include the headers and, optionally, register the Focus hooks. Use the macros mentioned above to set up a default for both the palette and colormap overlays. Note that layers and key addresses are all zero-indexed, and key addresses rows are top to bottom and columns are left to right. For the key coordinates refer to the relevant header file:

#include <Kaleidoscope.h>
#include <Kaleidoscope-LEDControl.h>
#include <Kaleidoscope-LED-Palette-Theme.h>
#include <Kaleidoscope-Colormap-Overlay.h>
#include <Kaleidoscope-FocusSerial.h>

PALETTE(
 /* A list of 16 cRGB colors... */
)

KALEIDOSCOPE_INIT_PLUGINS(EEPROMSettings,
                          LEDControl,
                          ColormapOverlay,
                          DefaultPalette,
                          Focus);

void setup() {
  Kaleidoscope.setup();

  COLORMAP_OVERLAYS(
    // List of overlays, using kaleidoscope::plugin::Overlay
    // kaleidoscope::plugin::Overlay({layer}, {key address}, {palette index})
    // A special value `ColormapOverlay::layer_wildcard` can be used in place of
    // a layer number to apply the color overlay on all layers
  )

  ColormapOverlay.setup();
  DefaultPalette.setup();
}

Plugin methods

The extension only has a single method:

.setup()

Intended to be called from the setup() method of the sketch, it reserves the required space in EEPROM.