// -*- mode: c++ -*- #pragma once #include class ColorPicker : public kaleidoscope::Plugin { public: ColorPicker(void) : is_active(false), current_index(0), colors{}, map{} { } void toggle(void) { is_active = !is_active; } kaleidoscope::EventHandlerResult onKeyswitchEvent(Key &mapped_key, byte row, byte col, uint8_t key_state) { if (!Kaleidoscope.has_leds || !is_active) return kaleidoscope::EventHandlerResult::OK; return kaleidoscope::EventHandlerResult::EVENT_CONSUMED; } private: bool is_active; uint8_t current_index; cRGB colors[16]; uint8_t map[ROWS][COLS]; }; ColorPicker theColorPicker;