void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { for (int i = 0; i < DRIVER_LED_TOTAL; i++) { if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color( i, red, green, blue ); } } }
void rgb_matrix_set_color_all( uint8_t red, uint8_t green, uint8_t blue ) { #ifdef RGB_MATRIX_EXTRA_TOG for (int i = 0; i < DRIVER_LED_TOTAL; i++) { rgb_matrix_set_color(i, red, green, blue); } #else rgb_matrix_driver.set_color_all(red, green, blue); #endif }
void rgb_matrix_layer_helper (uint8_t red, uint8_t green, uint8_t blue, bool default_layer) { rgb_led led; for (int i = 0; i < DRIVER_LED_TOTAL; i++) { led = g_rgb_leds[i]; if (led.matrix_co.raw < 0xFF) { if (led.modifier) { rgb_matrix_set_color( i, red, green, blue ); } } } }
static bool rgb_matrix_none(effect_params_t* params) { if (!params->init) { return false; } RGB_MATRIX_USE_LIMITS(led_min, led_max); for (uint8_t i = led_min; i < led_max; i++) { rgb_matrix_set_color(i, 0, 0, 0); } return led_max < DRIVER_LED_TOTAL; }
void rgb_matrix_indicators_user(void) { #ifdef RGB_MATRIX_ENABLE switch (biton32(layer_state)) { case _RAISE: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0x6B, 0x00, 0x80); } else { rgb_matrix_set_color(i, 0x00, 0xFF, 0x00); } } break; case _LOWER: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { if (HAS_FLAGS(g_led_config.flags[i], LED_FLAG_MODIFIER)) { rgb_matrix_set_color(i, 0xFF, 0xA5, 0x00); } else { rgb_matrix_set_color(i, 0x00, 0x67, 0xC7); } } break; case _ADJUST: for (int i = 0; i < DRIVER_LED_TOTAL; i++) { rgb_matrix_set_color(i, 0xFF, 0x99, 0x00); } rgb_matrix_set_color(1, 0xFF, 0x00, 0x00); break; default: break; } #endif }
void rgb_matrix_indicators_user(void) { uint8_t this_led = host_keyboard_leds(); if (!g_suspend_state) { switch (biton32(layer_state)) { case _LAYER1: rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; case _LAYER2: rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; case _LAYER3: rgb_matrix_layer_helper(0x00, 0x00, 0xFF, false); break; case _LAYER4: rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; } } if ( this_led & (1<<USB_LED_CAPS_LOCK)) { rgb_matrix_set_color(41, 0xFF, 0xFF, 0xFF); } }
void rgb_matrix_indicators_user(void) { if (g_suspend_state || !rgb_matrix_config.enable || !userspace_config.rgb_layer_change) { return; } switch (biton32(layer_state)) { case _MODS: rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; case _GAMEPAD: rgb_matrix_layer_helper(0xFF, 0x80, 0x00); rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); // Q rgb_matrix_set_color(31, 0x00, 0xFF, 0xFF); // W rgb_matrix_set_color(30, 0xFF, 0x00, 0x00); // E rgb_matrix_set_color(29, 0xFF, 0x80, 0x00); // R rgb_matrix_set_color(37, 0x00, 0xFF, 0xFF); // A rgb_matrix_set_color(36, 0x00, 0xFF, 0xFF); // S rgb_matrix_set_color(35, 0x00, 0xFF, 0xFF); // D rgb_matrix_set_color(34, 0x7A, 0x00, 0xFF); // F rgb_matrix_set_color(27, 0xFF, 0xFF, 0xFF); // 1 rgb_matrix_set_color(26, 0x00, 0xFF, 0x00); // 2 rgb_matrix_set_color(25, 0x7A, 0x00, 0xFF); // 3 break; case _DIABLO: rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; case _RAISE: rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; case _LOWER: rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; case _ADJUST: rgb_matrix_layer_helper(0xFF, 0x00, 0x00); break; default: switch (biton32(default_layer_state)) { case _QWERTY: rgb_matrix_layer_helper(0x00, 0xFF, 0xFF); break; case _COLEMAK: rgb_matrix_layer_helper(0xFF, 0x00, 0xFF); break; case _DVORAK: rgb_matrix_layer_helper(0x00, 0xFF, 0x00); break; case _WORKMAN: rgb_matrix_layer_helper(0xD9, 0xA5, 0x21); break; case _NORMAN: rgb_matrix_layer_helper(0xFF, 0x7C, 0x4D); break; case _MALTRON: rgb_matrix_layer_helper(0xFF, 0xFF, 0x00); break; case _EUCALYN: rgb_matrix_layer_helper(0xFF, 0x80, 0xBF); break; case _CARPLAX: rgb_matrix_layer_helper(0x00, 0x00, 0xFF); break; } } #if 0 if (this_mod & MOD_MASK_SHIFT || this_led & (1<<USB_LED_CAPS_LOCK) || this_osm & MOD_MASK_SHIFT) { rgb_matrix_set_color(24, 0x00, 0xFF, 0x00); rgb_matrix_set_color(36, 0x00, 0xFF, 0x00); } if (this_mod & MOD_MASK_CTRL || this_osm & MOD_MASK_CTRL) { rgb_matrix_set_color(25, 0xFF, 0x00, 0x00); rgb_matrix_set_color(34, 0xFF, 0x00, 0x00); rgb_matrix_set_color(37, 0xFF, 0x00, 0x00); } if (this_mod & MOD_MASK_GUI || this_osm & MOD_MASK_GUI) { rgb_matrix_set_color(39, 0xFF, 0xD9, 0x00); } if (this_mod & MOD_MASK_ALT || this_osm & MOD_MASK_ALT) { rgb_matrix_set_color(38, 0x00, 0x00, 0xFF); } #endif }
void rgb_matrix_indicators_user(void) { uint8_t this_led = host_keyboard_leds(); if (!g_suspend_state) { switch (biton32(layer_state)) { case _LAYER1: rgb_matrix_layer_helper(0xFF, 0x00, 0x00, false); break; case _LAYER2: rgb_matrix_layer_helper(0x00, 0xFF, 0x00, false); break; case _LAYER4: rgb_matrix_layer_helper(0xFF, 0xFF, 0x00, false); break; } } if (this_led & (1 << USB_LED_CAPS_LOCK)) { rgb_matrix_set_color(40, 0xFF, 0xFF, 0xFF); } switch (biton32(layer_state)) { case _LAYER3: if (this_led & (1 << USB_LED_NUM_LOCK)) { rgb_matrix_set_color(13, 0xFF, 0x00, 0x00); } else { rgb_matrix_set_color(13, 0x00, 0x00, 0x00); } rgb_matrix_set_color(0, 0x00, 0xFF, 0x00); rgb_matrix_set_color(1, 0x00, 0x00, 0x00); rgb_matrix_set_color(1, 0x00, 0xFF, 0x00); rgb_matrix_set_color(2, 0x00, 0xFF, 0x00); rgb_matrix_set_color(3, 0x00, 0xFF, 0x00); rgb_matrix_set_color(4, 0x00, 0xFF, 0x00); rgb_matrix_set_color(5, 0x00, 0x00, 0x00); rgb_matrix_set_color(6, 0x00, 0x00, 0x00); rgb_matrix_set_color(7, 0x00, 0x00, 0x00); rgb_matrix_set_color(8, 0x00, 0x00, 0x00); rgb_matrix_set_color(9, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(10, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(11, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(12, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(14, 0x00, 0x00, 0xFF); rgb_matrix_set_color(15, 0x00, 0x00, 0x00); rgb_matrix_set_color(16, 0x00, 0x00, 0x00); rgb_matrix_set_color(17, 0x00, 0xFF, 0x00); rgb_matrix_set_color(18, 0x00, 0xFF, 0x00); rgb_matrix_set_color(19, 0x00, 0xFF, 0x00); rgb_matrix_set_color(20, 0x00, 0x00, 0x00); rgb_matrix_set_color(21, 0x00, 0x00, 0x00); rgb_matrix_set_color(22, 0x00, 0x00, 0x00); rgb_matrix_set_color(23, 0x00, 0x00, 0x00); rgb_matrix_set_color(24, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(25, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(26, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(27, 0x00, 0x00, 0x00); rgb_matrix_set_color(28, 0x00, 0xFF, 0x00); rgb_matrix_set_color(29, 0x00, 0x00, 0x00); rgb_matrix_set_color(30, 0x00, 0xFF, 0x00); rgb_matrix_set_color(31, 0x00, 0xFF, 0x00); rgb_matrix_set_color(32, 0x00, 0xFF, 0x00); rgb_matrix_set_color(33, 0x00, 0x00, 0x00); rgb_matrix_set_color(34, 0x00, 0x00, 0x00); rgb_matrix_set_color(35, 0x00, 0x00, 0x00); rgb_matrix_set_color(36, 0x00, 0x00, 0x00); rgb_matrix_set_color(37, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(38, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(39, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(40, 0x00, 0x00, 0x00); rgb_matrix_set_color(41, 0x00, 0x00, 0x00); rgb_matrix_set_color(42, 0x00, 0x00, 0x00); rgb_matrix_set_color(43, 0x00, 0xFF, 0x00); rgb_matrix_set_color(44, 0x00, 0xFF, 0x00); rgb_matrix_set_color(45, 0x00, 0xFF, 0x00); rgb_matrix_set_color(46, 0x00, 0x00, 0x00); rgb_matrix_set_color(47, 0x00, 0x00, 0x00); rgb_matrix_set_color(48, 0x00, 0x00, 0x00); rgb_matrix_set_color(49, 0x00, 0x00, 0x00); rgb_matrix_set_color(50, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(51, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(52, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(53, 0x00, 0x00, 0x00); rgb_matrix_set_color(54, 0x00, 0x00, 0x00); rgb_matrix_set_color(55, 0x00, 0x00, 0x00); rgb_matrix_set_color(56, 0x00, 0x00, 0x00); rgb_matrix_set_color(57, 0x00, 0xFF, 0x00); rgb_matrix_set_color(58, 0x00, 0xFF, 0x00); rgb_matrix_set_color(59, 0xFF, 0x00, 0x00); rgb_matrix_set_color(60, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(61, 0xFF, 0xFF, 0x00); rgb_matrix_set_color(62, 0x00, 0x00, 0x00); break; } }
void rgb_matrix_indicators_user(void) { // Disable light in middle of 2U position rgb_matrix_set_color(42, 0, 0, 0); }