keyboardio/Kaleidoscope-Colormap

Name: Kaleidoscope-Colormap

Owner: Keyboardio

Description: Colormap extension for Kaleidoscope, EEPROM storage variant

Created: 2017-03-18 19:41:58.0

Updated: 2018-05-15 05:07:16.0

Pushed: 2018-05-15 05:07:17.0

Homepage: null

Size: 54

Language: C++

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

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. Colors are picked from a 16-color palette, 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.

lude <Kaleidoscope.h>
lude <Kaleidoscope-EEPROM-Settings.h>
lude <Kaleidoscope-Colormap.h>
lude <Kaleidoscope-Focus.h>
lude <Kaleidoscope-LED-Palette-Theme.h>

IDOSCOPE_INIT_PLUGINS(EEPROMSettings,
                      LEDPaletteTheme,
                      ColormapEffect,
                      Focus);

 setup(void) {
leidoscope.setup();

lormapEffect.max_layers(1);
cus.addHook(FOCUS_HOOK_LEDPALETTETHEME);
cus.addHook(FOCUS_HOOK_COLORMAP);

PROMSettings.seal();

Plugin 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.

Focus commands

The plugin provides a single Focus hook, FOCUS_HOOK_COLORMAP, implementing the following command:

colormap.map

Without arguments, prints the color map: palette indexes for all layers.

With arguments, updates the color map with new indexes. One does not need to give the full map, the plugin will process as many arguments as available, and ignore anything past the last key on the last layer (as set by the .max_layers() method).

Dependencies
Further reading

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


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.