Merge pull request #12 from keyboardio/f/settable-color

Allow setting the highlight color & the breathe hue
pull/365/head
Jesse Vincent 7 years ago committed by GitHub
commit 2060a2a704
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -7,7 +7,8 @@ byte NumPad_::row = 255, NumPad_::col = 255;
uint8_t NumPad_::numPadLayer; uint8_t NumPad_::numPadLayer;
bool NumPad_::cleanupDone = true; bool NumPad_::cleanupDone = true;
bool NumPad_::originalNumLockState = false; bool NumPad_::originalNumLockState = false;
cRGB numpad_color = CRGB(160, 0, 0); cRGB NumPad_::color = CRGB(160, 0, 0);
uint8_t NumPad_::lock_hue = 170;
kaleidoscope::EventHandlerResult NumPad_::onSetup(void) { kaleidoscope::EventHandlerResult NumPad_::onSetup(void) {
originalNumLockState = !!(kaleidoscope::hid::getKeyboardLEDs() & LED_NUM_LOCK); originalNumLockState = !!(kaleidoscope::hid::getKeyboardLEDs() & LED_NUM_LOCK);
@ -57,7 +58,7 @@ kaleidoscope::EventHandlerResult NumPad_::afterEachCycle() {
if ((k != layer_key) || (k == Key_NoKey) || (k.flags != KEY_FLAGS)) { if ((k != layer_key) || (k == Key_NoKey) || (k.flags != KEY_FLAGS)) {
LEDControl.refreshAt(r, c); LEDControl.refreshAt(r, c);
} else { } else {
LEDControl.setCrgbAt(r, c, numpad_color); LEDControl.setCrgbAt(r, c, color);
} }
} }
} }
@ -65,8 +66,8 @@ kaleidoscope::EventHandlerResult NumPad_::afterEachCycle() {
if (row > ROWS || col > COLS) if (row > ROWS || col > COLS)
return kaleidoscope::EventHandlerResult::OK; return kaleidoscope::EventHandlerResult::OK;
cRGB color = breath_compute(); cRGB lock_color = breath_compute(lock_hue);
LEDControl.setCrgbAt(row, col, color); LEDControl.setCrgbAt(row, col, lock_color);
return kaleidoscope::EventHandlerResult::OK; return kaleidoscope::EventHandlerResult::OK;
} }

@ -9,6 +9,8 @@ class NumPad_ : public kaleidoscope::Plugin {
NumPad_(void) {} NumPad_(void) {}
static uint8_t numPadLayer; static uint8_t numPadLayer;
static cRGB color;
static uint8_t lock_hue;
kaleidoscope::EventHandlerResult onSetup(void); kaleidoscope::EventHandlerResult onSetup(void);
kaleidoscope::EventHandlerResult afterEachCycle(); kaleidoscope::EventHandlerResult afterEachCycle();

Loading…
Cancel
Save