summaryrefslogtreecommitdiff
path: root/keyboards/proteus67/proteus67.c
blob: 4073ac87d3e6cf88054c0b0dd2a0fd2c6c2446a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright 2023 James Gzowski
// SPDX-License-Identifier: GPL-2.0-or-later
#include QMK_KEYBOARD_H

enum custom_layer {
    _LAYERA,
    _LAYERB,
    _LAYERC,
};

// MO(_LAYERB)
const rgblight_segment_t PROGMEM backlight_layer_layerb[] = RGBLIGHT_LAYER_SEGMENTS(
    {0, 4, HSV_GOLD}
);
// MO(_LAYERC)
const rgblight_segment_t PROGMEM backlight_layer_layerc[] = RGBLIGHT_LAYER_SEGMENTS(
    {0, 4, HSV_CYAN}
);
const rgblight_segment_t PROGMEM backlight_layer_layera[] = RGBLIGHT_LAYER_SEGMENTS(
    {0, 4, HSV_BLACK}
);
const rgblight_segment_t* const PROGMEM set_backlight_mode[] = RGBLIGHT_LAYERS_LIST(
    backlight_layer_layerb,
    backlight_layer_layerc,
    backlight_layer_layera
);

layer_state_t layer_state_set_kb(layer_state_t state) {
    rgblight_set_layer_state(0, layer_state_cmp(state, _LAYERB));
    rgblight_set_layer_state(1, layer_state_cmp(state, _LAYERC));
    rgblight_set_layer_state(2, layer_state_cmp(state, _LAYERA));

    return layer_state_set_user(state);
}

void keyboard_post_init_kb(void) {
    rgblight_set_effect_range(4, 17);
    rgblight_sethsv_range(HSV_BLACK, 0, 4);
    rgblight_layers = set_backlight_mode;

    keyboard_post_init_user();
}