diff options
author | KemoNine <mcrosson@kemonine.info> | 2020-12-15 06:00:52 +0000 |
---|---|---|
committer | Pete Johanson <peter@peterjohanson.com> | 2021-01-08 16:08:13 -0500 |
commit | 99f932a47d4705c7ddde83256fada9aa7aa3bda6 (patch) | |
tree | 1fd1e7637d418c3b54dce38023651aa48d301e98 /app/src/rgb_underglow.c | |
parent | 167600f01d0000539bf1f963dbcee0d9b15600cc (diff) |
(feat) Allow setting underglow color by key press
Diffstat (limited to 'app/src/rgb_underglow.c')
-rw-r--r-- | app/src/rgb_underglow.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/app/src/rgb_underglow.c b/app/src/rgb_underglow.c index 73a5c5e..a2c02ed 100644 --- a/app/src/rgb_underglow.c +++ b/app/src/rgb_underglow.c @@ -346,6 +346,19 @@ int zmk_rgb_underglow_toggle() { return zmk_rgb_underglow_save_state(); } +int zmk_rgb_underglow_set_hsb(uint16_t hue, uint8_t saturation, uint8_t brightness) { + if (hue > 360 || saturation > 100 || brightness > 100) { + return -ENOTSUP; + } + + state.hue = hue; + state.saturation = saturation; + state.brightness = brightness; + state.current_effect = UNDERGLOW_EFFECT_SOLID; + + return 0; +} + int zmk_rgb_underglow_change_hue(int direction) { if (!led_strip) return -ENODEV; |