Firmware for the Keyboardio Model 01 and other keyboards with AVR or ARM MCUs.
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.
 
 
 
 
 
 
Go to file
Gergely Nagy 196588fdda
onFocusEvent: Refresh the colormap if responding to colormap.map
6 years ago
examples/Colormap Migrate to the onFocusEvent API 6 years ago
src onFocusEvent: Refresh the colormap if responding to colormap.map 6 years ago
.gitignore Initial import 8 years ago
.travis.yml shellcheck should only be run in the Kaleidoscope repo 6 years ago
CONTRIBUTING.md Add CONTRIBUTING.md 6 years ago
COPYING Initial import 8 years ago
Makefile Update Makefile with OSX fixes and new paths 7 years ago
README.md Migrate to the onFocusEvent API 6 years ago
library.properties Assign my copyright to Keyboard.io 6 years ago

README.md

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 FocusSerial 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-EEPROM-Settings.h>
#include <Kaleidoscope-Colormap.h>
#include <Kaleidoscope-FocusSerial.h>
#include <Kaleidoscope-LED-Palette-Theme.h>

KALEIDOSCOPE_INIT_PLUGINS(EEPROMSettings,
                          LEDPaletteTheme,
                          ColormapEffect,
                          Focus);

void setup(void) {
  Kaleidoscope.setup();

  ColormapEffect.max_layers(1);
}

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

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.