diff --git a/README.md b/README.md index a666e3ea..099bbcd4 100644 --- a/README.md +++ b/README.md @@ -1,18 +1,18 @@ -# Kaleidoscope-EEPROM-Colormap +# Kaleidoscope-Colormap ![status][st:experimental] [![Build Status][travis:image]][travis:status] - [travis:image]: https://travis-ci.org/keyboardio/Kaleidoscope-EEPROM-Colormap.svg?branch=master - [travis:status]: https://travis-ci.org/keyboardio/Kaleidoscope-EEPROM-Colormap + [travis:image]: https://travis-ci.org/keyboardio/Kaleidoscope-Colormap.svg?branch=master + [travis:status]: https://travis-ci.org/keyboardio/Kaleidoscope-Colormap [st:stable]: https://img.shields.io/badge/stable-✔-black.svg?style=flat&colorA=44cc11&colorB=494e52 [st:broken]: https://img.shields.io/badge/broken-X-black.svg?style=flat&colorA=e05d44&colorB=494e52 [st:experimental]: https://img.shields.io/badge/experimental----black.svg?style=flat&colorA=dfb317&colorB=494e52 -The `EEPROM-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. The extension supports +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. The extension supports transparent colors, to make things easier. Both the palette and the color map is stored in EEPROM, and the palette is @@ -30,14 +30,14 @@ and it will do the rest. ```c++ #include #include -#include +#include #include void setup (void) { Kaleidoscope.setup (); - USE_PLUGINS (&EEPROMColormapEffect, &Focus); + USE_PLUGINS (&ColormapEffect, &Focus); - EEPROMColormapEffect.configure (1); + ColormapEffect.configure (1); Focus.addHook (FOCUS_HOOK_LEDPALETTETHEME); Focus.addHook (FOCUS_HOOK_COLORMAP); } @@ -45,7 +45,7 @@ void setup (void) { ## Extension methods -The extension provides an `EEPROMColormapEffect` singleton object, with a single method: +The extension provides an `ColormapEffect` singleton object, with a single method: ### `.configure(maxLayers)` @@ -62,4 +62,4 @@ The extension provides an `EEPROMColormapEffect` singleton object, with a single Starting from the [example][plugin:example] is the recommended way of getting started with the plugin. - [plugin:example]: https://github.com/keyboardio/Kaleidoscope-EEPROM-Colormap/blob/master/examples/EEPROM-Colormap/EEPROM-Colormap.ino + [plugin:example]: https://github.com/keyboardio/Kaleidoscope-Colormap/blob/master/examples/Colormap/Colormap.ino diff --git a/examples/EEPROM-Colormap/EEPROM-Colormap.ino b/examples/Colormap/Colormap.ino similarity index 91% rename from examples/EEPROM-Colormap/EEPROM-Colormap.ino rename to examples/Colormap/Colormap.ino index 536288e7..27d16a79 100644 --- a/examples/EEPROM-Colormap/EEPROM-Colormap.ino +++ b/examples/Colormap/Colormap.ino @@ -17,7 +17,7 @@ */ #include -#include +#include const Key keymaps[][ROWS][COLS] PROGMEM = { [0] = KEYMAP_STACKED @@ -41,11 +41,11 @@ const Key keymaps[][ROWS][COLS] PROGMEM = { }; void setup () { - Kaleidoscope.use (&EEPROMColormapEffect, NULL); + Kaleidoscope.use (&ColormapEffect, NULL); Kaleidoscope.setup (); - EEPROMColormapEffect.configure (1); - EEPROMColormapEffect.activate (); + ColormapEffect.configure (1); + ColormapEffect.activate (); } void loop () { diff --git a/library.properties b/library.properties index e15a9f58..412b3c83 100644 --- a/library.properties +++ b/library.properties @@ -1,10 +1,10 @@ -name=Kaleidoscope-EEPROM-Colormap +name=Kaleidoscope-Colormap version=0.0.0 author=Gergely Nagy maintainer=Gergely Nagy sentence=Per-layer colormap effect for Kaleidoscope, with EEPROM storage. paragraph=Colors keys according to a colormap whenever a layer changes. category=Communication -url=https://github.com/keyboardio/Kaleidoscope-EEPROM-Colormap +url=https://github.com/keyboardio/Kaleidoscope-Colormap architectures=avr dot_a_linkage=true diff --git a/src/Kaleidoscope-EEPROM-Colormap.h b/src/Kaleidoscope-Colormap.h similarity index 83% rename from src/Kaleidoscope-EEPROM-Colormap.h rename to src/Kaleidoscope-Colormap.h index 3a500b95..fb6b4ffe 100644 --- a/src/Kaleidoscope-EEPROM-Colormap.h +++ b/src/Kaleidoscope-Colormap.h @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- - * Kaleidoscope-EEPROM-Colormap -- Per-layer colormap effect - * Copyright (C) 2017 Gergely Nagy + * Kaleidoscope-Colormap -- Per-layer colormap effect + * Copyright (C) 2016, 2017 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -18,4 +18,4 @@ #pragma once -#include +#include diff --git a/src/Kaleidoscope/EEPROM-Colormap.cpp b/src/Kaleidoscope/Colormap.cpp similarity index 65% rename from src/Kaleidoscope/EEPROM-Colormap.cpp rename to src/Kaleidoscope/Colormap.cpp index 39e06987..84bd6ea0 100644 --- a/src/Kaleidoscope/EEPROM-Colormap.cpp +++ b/src/Kaleidoscope/Colormap.cpp @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- - * Kaleidoscope-EEPROM-Colormap -- Per-layer colormap effect - * Copyright (C) 2017 Gergely Nagy + * Kaleidoscope-Colormap -- Per-layer colormap effect + * Copyright (C) 2016, 2017 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,21 +16,21 @@ * along with this program. If not, see . */ -#include +#include #include #include #include namespace KaleidoscopePlugins { -uint16_t EEPROMColormapEffect::mapBase; -uint8_t EEPROMColormapEffect::maxLayers; +uint16_t ColormapEffect::mapBase; +uint8_t ColormapEffect::maxLayers; -EEPROMColormapEffect::EEPROMColormapEffect (void) { +ColormapEffect::ColormapEffect (void) { } void -EEPROMColormapEffect::configure (uint8_t maxLayers_) { +ColormapEffect::configure (uint8_t maxLayers_) { USE_PLUGINS (&::EEPROMSettings, &::LEDPaletteTheme); maxLayers = maxLayers_; @@ -38,7 +38,7 @@ EEPROMColormapEffect::configure (uint8_t maxLayers_) { } void -EEPROMColormapEffect::update (void) { +ColormapEffect::update (void) { for (uint8_t l = 0; l < 32; l++) { if (!Layer.isOn (l)) continue; @@ -48,10 +48,10 @@ EEPROMColormapEffect::update (void) { } bool -EEPROMColormapEffect::focusHook (const char *command) { - return ::LEDPaletteTheme.themeFocusHandler (command, PSTR("colormap.map"), mapBase, maxLayers); +ColormapEffect::focusHook (const char *command) { + return ::LEDPaletteTheme.themeFocusHandler (command, PSTR("colormap.map"), mapBase, maxLayers); } }; -KaleidoscopePlugins::EEPROMColormapEffect EEPROMColormapEffect; +KaleidoscopePlugins::ColormapEffect ColormapEffect; diff --git a/src/Kaleidoscope/EEPROM-Colormap.h b/src/Kaleidoscope/Colormap.h similarity index 77% rename from src/Kaleidoscope/EEPROM-Colormap.h rename to src/Kaleidoscope/Colormap.h index 18e75236..14c4d056 100644 --- a/src/Kaleidoscope/EEPROM-Colormap.h +++ b/src/Kaleidoscope/Colormap.h @@ -1,6 +1,6 @@ /* -*- mode: c++ -*- - * Kaleidoscope-EEPROM-Colormap -- Per-layer colormap effect - * Copyright (C) 2017 Gergely Nagy + * Kaleidoscope-Colormap -- Per-layer colormap effect + * Copyright (C) 2016, 2017 Gergely Nagy * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,9 +22,9 @@ #include namespace KaleidoscopePlugins { -class EEPROMColormapEffect : public LEDMode { +class ColormapEffect : public LEDMode { public: - EEPROMColormapEffect (void); + ColormapEffect (void); virtual void update (void) final; void configure (uint8_t maxLayers); @@ -37,7 +37,7 @@ class EEPROMColormapEffect : public LEDMode { }; }; -extern KaleidoscopePlugins::EEPROMColormapEffect EEPROMColormapEffect; +extern KaleidoscopePlugins::ColormapEffect ColormapEffect; -#define FOCUS_HOOK_COLORMAP FOCUS_HOOK(EEPROMColormapEffect.focusHook, \ +#define FOCUS_HOOK_COLORMAP FOCUS_HOOK(ColormapEffect.focusHook, \ "colormap.map")