diff options
author | James Thomson <thomsj@users.noreply.github.com> | 2022-10-11 19:33:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-11 11:33:02 -0700 |
commit | 41159326ca7c366b50edad1392369131c4ce4008 (patch) | |
tree | 883ef6282eb5ae533f23704f73b348a4b1a201ed /docs | |
parent | 6af7d9fa736990d9c808e148592dc9efcec332ab (diff) |
Fix boundary in `RGB_MATRIX_INDICATOR_SET_COLOR` (#18650)
Diffstat (limited to 'docs')
-rw-r--r-- | docs/feature_rgb_matrix.md | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 669f88e0a9..e0c46f60e2 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md @@ -912,7 +912,7 @@ Caps Lock indicator on alphanumeric flagged keys: ```c bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { if (host_keyboard_led_state().caps_lock) { - for (uint8_t i = led_min; i <= led_max; i++) { + for (uint8_t i = led_min; i < led_max; i++) { if (g_led_config.flags[i] & LED_FLAG_KEYLIGHT) { rgb_matrix_set_color(i, RGB_RED); } @@ -925,7 +925,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { Layer indicator on all keys: ```c bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { - for (uint8_t i = led_min; i <= led_max; i++) { + for (uint8_t i = led_min; i < led_max; i++) { switch(get_highest_layer(layer_state|default_layer_state)) { case 2: rgb_matrix_set_color(i, RGB_BLUE); @@ -951,7 +951,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { for (uint8_t col = 0; col < MATRIX_COLS; ++col) { uint8_t index = g_led_config.matrix_co[row][col]; - if (index >= led_min && index <= led_max && index != NO_LED && + if (index >= led_min && index < led_max && index != NO_LED && keymap_key_to_keycode(layer, (keypos_t){col,row}) > KC_TRNS) { rgb_matrix_set_color(index, RGB_GREEN); } @@ -983,7 +983,7 @@ bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { } RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = led_min; i <= led_max; i++) { + for (uint8_t i = led_min; i < led_max; i++) { if (HAS_FLAGS(g_led_config.flags[i], 0x01)) { // 0x01 == LED_FLAG_MODIFIER rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); } |