diff --git a/keyboards/svalboard/config.h b/keyboards/svalboard/config.h
index 704177adc6..2843cc6e7e 100644
--- a/keyboards/svalboard/config.h
+++ b/keyboards/svalboard/config.h
@@ -62,3 +62,17 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
// hub, KVM, or a machine that boots slowly (ECC RAM), the keyboard no longer
// needs to be reset to come to life.
#define SPLIT_WATCHDOG_ENABLE
+
+// pretty lights
+// https://docs.qmk.fm/#/feature_rgblight?id=configuration
+#define WS2812_DI_PIN GP16
+#define RGBLED_NUM 2
+#define RGBLED_SPLIT { 1, 1 }
+#define RGBLIGHT_LAYERS DYNAMIC_KEYMAP_LAYER_COUNT
+#define RGBLIGHT_DEFAULT_SAT 0 // white?
+#define RGBLIGHT_LIMIT_VAL 130
+#define RGBLIGHT_DEFAULT_VAL 20
+#define RGBLIGHT_LAYERS_RETAIN_VAL // remember val across restarts
+#define RGBLIGHT_SLEEP // don't annoy when host asleep
+#define RGBLIGHT_MAX_LAYERS DYNAMIC_KEYMAP_LAYER_COUNT
+#define RGBLIGHT_VAL_STEP 10
diff --git a/keyboards/svalboard/info.json b/keyboards/svalboard/info.json
index 25b3c5cdba..ecee25dbd7 100644
--- a/keyboards/svalboard/info.json
+++ b/keyboards/svalboard/info.json
@@ -17,7 +17,7 @@
"midi": false,
"mousekey": true,
"nkro": true,
- "rgblight": false,
+ "rgblight": true,
"sleep_led": false,
"unicode": false
},
@@ -109,4 +109,4 @@
]
}
}
-}
\ No newline at end of file
+}
diff --git a/keyboards/svalboard/keymaps/vial/keymap.c b/keyboards/svalboard/keymaps/vial/keymap.c
index 193804e21a..721302ddca 100644
--- a/keyboards/svalboard/keymaps/vial/keymap.c
+++ b/keyboards/svalboard/keymaps/vial/keymap.c
@@ -19,12 +19,57 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <stdbool.h>
#include <stdint.h>
+#ifdef RGBLIGHT_ENABLE
+#define LC(name, color) const rgblight_segment_t PROGMEM (name)[] = RGBLIGHT_LAYER_SEGMENTS({0, 2, color})
+LC(layer0_colors, HSV_CHARTREUSE); // NORMAL
+LC(layer1_colors, HSV_CHARTREUSE); // NORMAL_HOLD
+LC(layer2_colors, HSV_GOLD); // FUNC
+LC(layer3_colors, HSV_GOLD); // FUNC_HOLD
+LC(layer4_colors, HSV_AZURE); // NAS
+LC(layer5_colors, HSV_AZURE); // would be NAS hold
+LC(layer6_colors, HSV_RED); // maybe 10kp
+LC(layer7_colors, HSV_ORANGE);
+LC(layer8_colors, HSV_PINK);
+LC(layer9_colors, HSV_PURPLE);
+LC(layer10_colors, HSV_MAGENTA);
+LC(layer11_colors, HSV_SPRINGGREEN);
+LC(layer12_colors, HSV_TEAL);
+LC(layer13_colors, HSV_TURQUOISE);
+LC(layer14_colors, HSV_YELLOW);
+LC(layer15_colors, HSV_CORAL); // MBO
+#undef LC
+
+const rgblight_segment_t* const PROGMEM sval_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
+ layer0_colors, layer1_colors, layer2_colors, layer3_colors,
+ layer4_colors, layer5_colors, layer6_colors, layer7_colors,
+ layer8_colors, layer9_colors, layer10_colors, layer11_colors,
+ layer12_colors, layer13_colors, layer14_colors, layer15_colors
+);
+
+layer_state_t default_layer_state_set_user(layer_state_t state) {
+ rgblight_set_layer_state(0, layer_state_cmp(state, 0));
+ return state;
+}
+
+layer_state_t layer_state_set_user(layer_state_t state) {
+ for (int i = 0; i < RGBLIGHT_LAYERS; ++i) {
+ rgblight_set_layer_state(i, layer_state_cmp(state, i));
+ }
+ return state;
+}
+
+#endif
+
void keyboard_post_init_user(void) {
// Customise these values if you need to debug the matrix
//debug_enable=true;
debug_matrix=true;
//debug_keyboard=true;
//debug_mouse=true;
+
+#ifdef RGBLIGHT_ENABLE
+ rgblight_layers = sval_rgb_layers;
+#endif
}
// in keymap.c:
@@ -277,4 +322,4 @@ void mouse_mode(bool on) {
}
}
-#endif // defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && #defined MOUSEKEY_ENABLE
\ No newline at end of file
+#endif // defined MH_AUTO_BUTTONS && defined PS2_MOUSE_ENABLE && #defined MOUSEKEY_ENABLE
diff --git a/keyboards/svalboard/rules.mk b/keyboards/svalboard/rules.mk
index 67794b98b6..2cd2244612 100644
--- a/keyboards/svalboard/rules.mk
+++ b/keyboards/svalboard/rules.mk
@@ -39,4 +39,6 @@ ifeq ($(strip $(MH_AUTO_BUTTONS)), yes)
endif
-
+# we want some pretty lights
+RGBLIGHT_DRIVER = ws2812
+WS2812_DRIVER = vendor