Pikatea GB4 hardcoded solid color layers

 avatar
annamaniacs
c_cpp
2 years ago
1.0 kB
2
Indexable
Never
/* keyboards\pikatea\pikatea_macropad_gb4\config.h */
#   define RGBLIGHT_LAYERS

/* keyboards\pikatea\pikatea_macropad_gb4\keymaps\vial\keymap.c */
const rgblight_segment_t PROGMEM my_layer0_layer[] = RGBLIGHT_LAYER_SEGMENTS(
    {0, 4, HSV_TEAL}
);

const rgblight_segment_t PROGMEM my_layer1_layer[] = RGBLIGHT_LAYER_SEGMENTS(
    {0, 4, HSV_ORANGE}
);

const rgblight_segment_t PROGMEM my_layer2_layer[] = RGBLIGHT_LAYER_SEGMENTS(
    {0, 4, HSV_CORAL}
);

const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
    my_layer0_layer,
    my_layer1_layer,    
    my_layer2_layer    
);

void keyboard_post_init_user(void) {
    rgblight_layers = my_rgb_layers;
    default_layer_set(0);
    layer_state_set_user(0);
}

layer_state_t layer_state_set_user(layer_state_t state) {
    rgblight_set_layer_state(1, layer_state_cmp(state, 1));
    rgblight_set_layer_state(2, layer_state_cmp(state, 2));
    rgblight_set_layer_state(0, layer_state_cmp(state, 0));
    
  return state;
}