|
|
@ -81,13 +81,19 @@ namespace KaleidoscopePlugins {
|
|
|
|
if (!key_toggled_on (keyState))
|
|
|
|
if (!key_toggled_on (keyState))
|
|
|
|
return Key_NoKey;
|
|
|
|
return Key_NoKey;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
cRGB oldColor, newColor;
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t location = row * COLS + col;
|
|
|
|
uint16_t location = row * COLS + col;
|
|
|
|
uint8_t colorIndex = EEPROM.read (colorBase + location);
|
|
|
|
uint8_t colorIndex = EEPROM.read (colorBase + location);
|
|
|
|
if (colorIndex == 255)
|
|
|
|
if (colorIndex == 255)
|
|
|
|
colorIndex = 0;
|
|
|
|
colorIndex = 0;
|
|
|
|
|
|
|
|
EEPROM.get (paletteBase + colorIndex * sizeof (cRGB), oldColor);
|
|
|
|
colorIndex++;
|
|
|
|
colorIndex++;
|
|
|
|
if (colorIndex > 15)
|
|
|
|
if (colorIndex > 15)
|
|
|
|
colorIndex = 0;
|
|
|
|
colorIndex = 0;
|
|
|
|
|
|
|
|
EEPROM.get (paletteBase + colorIndex * sizeof (cRGB), newColor);
|
|
|
|
|
|
|
|
if (memcmp (&oldColor, &newColor, sizeof (cRGB)) == 0)
|
|
|
|
|
|
|
|
colorIndex = 0;
|
|
|
|
EEPROM.update (colorBase + location, colorIndex);
|
|
|
|
EEPROM.update (colorBase + location, colorIndex);
|
|
|
|
|
|
|
|
|
|
|
|
return Key_NoKey;
|
|
|
|
return Key_NoKey;
|
|
|
|