summaryrefslogtreecommitdiffstats
path: root/keyboards/melody96/keymaps/konstantin/keymap.c
diff options
context:
space:
mode:
authorKonstantin Đorđević <vomindoraan@gmail.com>2019-02-18 03:16:21 +0100
committerKonstantin Đorđević <vomindoraan@gmail.com>2019-03-02 15:15:58 +0100
commitfbe2eba4729a1d7b00b76243e146b5324d65976b (patch)
tree6ae5143e0f35530ce285d2312d43b4b81201842c /keyboards/melody96/keymaps/konstantin/keymap.c
parentde2e03650bd4d6056513991d4481679e246667bb (diff)
Add GODSPEED_YELLOW color
Diffstat (limited to 'keyboards/melody96/keymaps/konstantin/keymap.c')
-rw-r--r--keyboards/melody96/keymaps/konstantin/keymap.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/keyboards/melody96/keymaps/konstantin/keymap.c b/keyboards/melody96/keymaps/konstantin/keymap.c
index 02d84d693a..c8b6edb3d6 100644
--- a/keyboards/melody96/keymaps/konstantin/keymap.c
+++ b/keyboards/melody96/keymaps/konstantin/keymap.c
@@ -1,8 +1,12 @@
#include QMK_KEYBOARD_H
#include "konstantin.h"
+static const hsv_t *colors[] = { &GODSPEED_BLUE, &GODSPEED_YELLOW };
+static size_t cnum = sizeof colors / sizeof *colors;
+static size_t cidx;
+
void eeconfig_init_keymap(void) {
- rgblight_sethsv(GODSPEED_BLUE.h, GODSPEED_BLUE.s, GODSPEED_BLUE.v);
+ rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v);
}
enum keycodes_keymap {
@@ -12,7 +16,10 @@ enum keycodes_keymap {
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
case RGB_SET:
- rgblight_sethsv(GODSPEED_BLUE.h, GODSPEED_BLUE.s, GODSPEED_BLUE.v);
+ if (record->event.pressed) {
+ cidx = (cidx + 1) % cnum;
+ rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v);
+ }
return false;
default: