Inherit backlight colour for CAPS LOCK LED

This commit is contained in:
Oscar Blue 2024-05-04 16:29:05 +01:00
parent ea8432c194
commit 06d6496643

View file

@ -85,8 +85,11 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = {
};
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
HSV hsv = rgb_matrix_get_hsv();
RGB rgb = hsv_to_rgb(hsv);
if (host_keyboard_led_state().caps_lock) {
RGB_MATRIX_INDICATOR_SET_COLOR(3, 255, 255, 255); // assuming caps lock is at led #3
RGB_MATRIX_INDICATOR_SET_COLOR(3, rgb.r, rgb.g, rgb.b); // assuming caps lock is at led #3
} else {
RGB_MATRIX_INDICATOR_SET_COLOR(3, 0, 0, 0);
}