@ -12,34 +12,32 @@
The `Colormap` extension provides an easier way to set up a different - static -
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,
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
on a per-layer basis, and whenever a layer becomes active, the color map for
that layer is applied on top of everything else. The extension supports
that layer is applied on top of everything else. Colors are picked from a
transparent colors, to make things easier.
15-color palette (or 16, if we disable transparency), provided by
the [LED-Palette-Theme][plugin:l-p-t] plugin. The color map is stored in
Both the palette and the color map is stored in EEPROM, and the palette is
`EEPROM` , and can be easily changed via the [Focus][plugin:focus] plugin, which
limited to 15 colors (with the 16th being the transparent color). The plugin can
also provides palette editing capabilities.
work together with the [Focus][plugin:focus] plugin, to make it easier to update
the palette or the color map itself.
[plugin:focus]: https://github.com/keyboardio/Kaleidoscope-Focus
[plugin:focus]: https://github.com/keyboardio/Kaleidoscope-Focus
[plugin:l-p-t]: https://github.com/keyboardio/Kaleidoscope-LED-Palette-Theme
## Using the extension
## Using the extension
To use the extension, include the header, tell it the number of layers you have,
To use the extension, include the header, tell it the number of layers you have,
and it will do the rest.
register the `Focus` hooks, and it will do the rest.
```c++
```c++
#include < Kaleidoscope.h >
#include < Kaleidoscope.h >
#include < Kaleidoscope-LED-Palette-Theme.h >
#include < Kaleidoscope-Colormap.h >
#include < Kaleidoscope-Colormap.h >
#include < Kaleidoscope-Focus.h >
#include < Kaleidoscope-Focus.h >
void setup (void) {
void setup(void) {
Kaleidoscope.setup ();
Kaleidoscope.setup();
USE_PLUGINS (& ColormapEffect, &Focus);
USE_PLUGINS(& ColormapEffect, &Focus);
ColormapEffect.configure (1);
ColormapEffect.max_layers (1);
Focus.addHook (FOCUS_HOOK_LEDPALETTETHEME);
Focus.addHook(FOCUS_HOOK_LEDPALETTETHEME);
Focus.addHook (FOCUS_HOOK_COLORMAP);
Focus.addHook(FOCUS_HOOK_COLORMAP);
}
}
```
```
@ -47,9 +45,10 @@ void setup (void) {
The extension provides an `ColormapEffect` singleton object, with a single method:
The extension provides an `ColormapEffect` singleton object, with a single method:
### `. configure(maxLayers )`
### `. max_layers(max )`
> Tells the extension to reserve space in EEPROM for up to `maxLayers` layers.
> 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
## Dependencies