aboutsummaryrefslogtreecommitdiff
path: root/users/drashna/rgb/readme.md
diff options
context:
space:
mode:
Diffstat (limited to 'users/drashna/rgb/readme.md')
-rw-r--r--users/drashna/rgb/readme.md52
1 files changed, 52 insertions, 0 deletions
diff --git a/users/drashna/rgb/readme.md b/users/drashna/rgb/readme.md
new file mode 100644
index 000000000..4deaa0a46
--- /dev/null
+++ b/users/drashna/rgb/readme.md
@@ -0,0 +1,52 @@
1# RGB
2
3Custom RGB code can be disabled by setting `CUSTOM_RGBLIGHT = no` or `CUSTOM_RGB_MATRIX = no` in your `rules.mk`
4
5## RGB Light
6
7### Layer Indication Code
8
9At least for RGB Light, the `layer_state_set` function is used to detect the current highest layer, and change the underglow based on that layer.
10
11This works for both the regular layers, and for the default layers, too.
12
13I use the sethsv variants of the commands, so that different modes can be used, as well.
14
15RGB Matrix uses a custom, per board implementation, at the moment.
16
17### RGB Light Startup Animation
18
19On startup, if enabled, the board will cycle through the entire hue wheel, starting and ending on the default layer color.
20
21```c
22void keyboard_post_init_rgb(void) {
23#if defined(RGBLIGHT_ENABLE) && defined(RGBLIGHT_STARTUP_ANIMATION)
24 if (userspace_config.rgb_layer_change) { rgblight_enable_noeeprom(); }
25 if (rgblight_config.enable) {
26 layer_state_set_user(layer_state);
27 uint16_t old_hue = rgblight_config.hue;
28 rgblight_mode_noeeprom(RGBLIGHT_MODE_STATIC_LIGHT);
29 for (uint16_t i = 255; i > 0; i--) {
30 rgblight_sethsv_noeeprom( ( i + old_hue) % 255, 255, 255);
31 matrix_scan();
32 wait_ms(10);
33 }
34 }
35#endif
36 layer_state_set_user(layer_state);
37}
38```
39
40This could probably benefit from some cleanup and better handling.
41
42## RGB Matrix
43
44### Idle Animation
45
46This feature can be toggled with the `RGB_IDL` keycode.
47
48This sets the mode to the Heatmap Animation when typing, but will switch to the cycle in animations when idle.
49
50### Layer Indication
51
52This sets the modifier keys to indicate the current layer state, with the option to override the behavior.