summaryrefslogtreecommitdiff
path: root/keyboards/crkbd/keymaps/ninjonas/rgb.c
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/crkbd/keymaps/ninjonas/rgb.c')
-rw-r--r--keyboards/crkbd/keymaps/ninjonas/rgb.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/keyboards/crkbd/keymaps/ninjonas/rgb.c b/keyboards/crkbd/keymaps/ninjonas/rgb.c
new file mode 100644
index 0000000000..f9ac3a8610
--- /dev/null
+++ b/keyboards/crkbd/keymaps/ninjonas/rgb.c
@@ -0,0 +1,27 @@
+#include QMK_KEYBOARD_H
+
+extern keymap_config_t keymap_config;
+
+#ifdef RGBLIGHT_ENABLE
+//Following line allows macro to read current RGB settings
+extern rgblight_config_t rgblight_config;
+#endif
+
+extern uint8_t is_master;
+
+int RGB_current_mode;
+
+// Setting ADJUST layer RGB back to default
+void update_tri_layer_RGB(uint8_t layer1, uint8_t layer2, uint8_t layer3) {
+ if (IS_LAYER_ON(layer1) && IS_LAYER_ON(layer2)) {
+ layer_on(layer3);
+ } else {
+ layer_off(layer3);
+ }
+}
+
+void keyboard_post_init_user(void) {
+ #ifdef RGBLIGHT_ENABLE
+ RGB_current_mode = rgblight_config.mode;
+ #endif
+} \ No newline at end of file