# Colormap plugin is “variant”?

**URL:** <https://community.keyboard.io/t/colormap-plugin-is-variant/1840>\
**Category:** Plugins\
**Created:** [July 26, 2018, 6:14am UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840 "2018-07-26T06:14:52Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jamadagni](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jamadagni/32/2030_2.png) [@jamadagni](https://community.keyboard.io/u/jamadagni)\
**Post date:** [July 26, 2018, 6:14am UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840/1 "2018-07-26T06:14:52Z")

</div>

The [GitHub page of the ColorMap plugin](https://github.com/keyboardio/Kaleidoscope-Colormap) labels it:

> Colormap extension for Kaleidoscope, EEPROM storage variant

… but I don’t see any other variant. Am I missing something?

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [July 26, 2018, 6:24am UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840/2 "2018-07-26T06:24:49Z")

</div>

No, you’re not missing anything. There used to be two versions of the `Colormap` plugin, but only one remains now. The description is an artifact of old times, which I forgot to remove when deciding to only keep one.

---

<div class="post-metadata">

**Author:** ![jamadagni](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jamadagni/32/2030_2.png) [@jamadagni](https://community.keyboard.io/u/jamadagni)\
**Post date:** [July 26, 2018, 10:13am UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840/3 "2018-07-26T10:13:46Z")

</div>

So what did that other version do can you tell?

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [July 26, 2018, 10:17am UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840/4 "2018-07-26T10:17:05Z")

</div>

There was only one other variant (which happened to be the original),) which stored the colormap in `PROGMEM` instead of `EEPROM`. That was the only difference in the beginning. Then the current version was made to use `LEDPaletteTheme`, so control of the palette was moved outside of the plugin.

You can find remnants of the other variant on the `obsolete/progmem-variant` branch (or named something along those lines…)

---

<div class="post-metadata">

**Author:** ![jamadagni](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jamadagni/32/2030_2.png) [@jamadagni](https://community.keyboard.io/u/jamadagni)\
**Post date:** [July 26, 2018, 10:19am UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840/5 "2018-07-26T10:19:02Z")

</div>

Was there a particular reason for preferring `EEPROM` than `PROGMEM`?

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [July 26, 2018, 10:26am UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840/6 "2018-07-26T10:26:45Z")

</div>

A couple:

- Using EEPROM makes it possible to update the colors without having to recompile and reflash the keymap.
- I needed PROGMEM space, and the colormap was eating a fairly large chunk of it.
- It was easier to optimize the colormap storage in EEPROM than it was for PROGMEM. With EEPROM, it was easy to use only four bits per key, while the PROGMEM variant used eight. So storing it in EEPROM resulted in a more compact map.

Initially, Colormap supported up to 256 colors and a dynamically sized palette, it was limited to a 16-byte palette later on, to save space. At that point, it was easier to make the EEPROM variant more compact. I’m sure you’ll be interested in why, and the answer is pretty simple: for PROGMEM, I wanted an API that is easy to use, something that resembles the keymap definition itself (see this [old example](https://github.com/keyboardio/Kaleidoscope-Colormap/blob/obsolete/progmem-colormap/examples/Colormap/Colormap.ino#L54-L73)). While it would have been possible to write a macro that turns that into a structure that places two key colors into a single byte, I found that to be cumbersome. And since I wanted to save PROGMEM space anyway, and wanted to make the Colormap configurable via Focus anyway, I dropped the PROGMEM variant.

---

<div class="post-metadata">

**Author:** ![jamadagni](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jamadagni/32/2030_2.png) [@jamadagni](https://community.keyboard.io/u/jamadagni)\
**Post date:** [July 26, 2018, 1:27pm UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840/7 "2018-07-26T13:27:26Z")

</div>

OK so I looked through all that old and the corresponding current code.

As advertised in the README, this plugin seems to be largely what I’m looking for but I am looking for an example which will tell me how exactly to specify the colours! Neither [the Colormap example](https://github.com/keyboardio/Kaleidoscope-Colormap/blob/master/examples/Colormap/Colormap.ino) nor [the LED palette theme example](https://github.com/keyboardio/Kaleidoscope-LED-Palette-Theme/blob/master/examples/LED-Palette-Theme/LED-Palette-Theme.ino) teaches me how to specify the colours!

From [the code](https://github.com/keyboardio/Kaleidoscope-Colormap/blob/524523e0d07c99fe6620f651e7c22756678a6346/src/Kaleidoscope/Colormap.cpp#L62) I see that a file by name `colormap.map` is expected, but where to create/store this file and how?

Is this plugin meant only for use from Chrysalis (which I have not used yet as it is said to be under beta)?

Runtime configurability is nice to hear but if I really don’t care much for it (as I mostly look at the screen and not my keyboard and just looking for colours as guides to the right keys) and I just want something that “simply works”, then what is my option (other than to write my own plugin/fork)?

Thanks!

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [July 26, 2018, 1:49pm UTC](https://community.keyboard.io/t/colormap-plugin-is-variant/1840/8 "2018-07-26T13:49:13Z")

</div>

> [@jamadagni](#):
>
> From [the code](https://github.com/keyboardio/Kaleidoscope-Colormap/blob/524523e0d07c99fe6620f651e7c22756678a6346/src/Kaleidoscope/Colormap.cpp#L62) I see that a file by name `colormap.map` is expected, but where to create/store this file and how?

That’s not a file, but a Focus command. My Sketch has a [few tools](https://github.com/algernon/Model01-sketch/tree/master/tools/colormap) that may serve as examples. You can also play with it without any “special” tool, by using the `extras/kaleidoscope-focus.py` tool in `Focus`. Once your sketch is set up correctly (with the appropriate Focus hooks enabled), you connect to the serial port with that tool, type `palette 255 255 255` to set the first color to white. You can list up to 16 colors there, simply `R G B` triplets one after another. Similarly, `colormap.map IDX1 IDX2...` will set the color of the LED at the first, second, etc positions. You can repeat indexes for every key on a layer, for the maximum layers you configure `Colormap` to use.

Yes, this is a tad cumbersome at the moment. ☹

> [@jamadagni](#):
>
> I just want something that “simply works”, then what is my option (other than to write my own plugin/fork)?

Pretty much fork or write your own at the moment. Or use Colormap and a few helper scripts on the host side (see my tools above).
