@@ 0,0 1,67 @@
+/* Copyright 2021 Nguyen Vu Khang <brew4k@gmail.com>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#pragma once
+
+#define MINIMAL_BASEx(hue,sat) \
+ rgblight_sethsv_range(hue, sat, 0, 0, 12); \
+ rgblight_sethsv_range(hue, sat, 100, 5, 7)
+
+#define MINIMAL_BASE(hue, sat) \
+ {0, 12, hue, sat, 0}, \
+ {5, 2, hue, sat, 100}
+
+#define MINIMAL(hue, sat) \
+ {0, 12, hue, sat, 0}, \
+ {3, 1, hue, sat, 100}, \
+ {8, 1, hue, sat, 100}
+
+const int yellow = 30;
+const int green = 99;
+const int red = 252;
+const int base_sat = 120;
+
+const rgblight_segment_t PROGMEM _BL_rgblayer[] = RGBLIGHT_LAYER_SEGMENTS(
+ MINIMAL_BASE(yellow,250)
+);
+const rgblight_segment_t PROGMEM _FN_rgblayer[] = RGBLIGHT_LAYER_SEGMENTS(
+ MINIMAL(green,255)
+);
+const rgblight_segment_t PROGMEM _SL_rgblayer[] = RGBLIGHT_LAYER_SEGMENTS(
+ MINIMAL(red,255)
+);
+
+const rgblight_segment_t* const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
+ _BL_rgblayer,
+ _FN_rgblayer,
+ _SL_rgblayer
+);
+
+void keyboard_post_init_user(void) {
+ MINIMAL_BASEx(yellow,200);
+ rgblight_layers = my_rgb_layers;
+}
+
+layer_state_t default_layer_state_set_user(layer_state_t state) {
+ rgblight_set_layer_state(0, layer_state_cmp(state, _BL));
+ return state;
+}
+
+layer_state_t layer_state_set_user(layer_state_t state) {
+ rgblight_set_layer_state(1, layer_state_cmp(state, _FN));
+ rgblight_set_layer_state(2, layer_state_cmp(state, _SL));
+ return state;
+}
@@ 0,0 1,71 @@
+#include QMK_KEYBOARD_H
+
+enum keyboard_layers {
+ _BL = 0,
+ _FN,
+ _SL,
+ _BF,
+ _UP
+};
+
+#include "colors.h"
+#include "extrakeys.h"
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ [_BL] = LAYOUT(
+ //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
+ KC_GRV , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 ,KC_BSPC ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P ,KC_BSLS ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_ESC , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L ,KC_SCLN ,KC_QUOT ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_LSFT , KC_Z , KC_X , KC_C , KC_V , KC_B ,KC_MINS , KC_PLUS , KC_N , KC_M ,KC_COMM , KC_DOT ,KC_SLSH ,MO(_FN) ,
+ //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
+ KC_LGUI ,KC_LCTL , KC_ENT , KC_SPC ,MO(_UP) ,KC_RALT
+ // └────────┴────────┴────────┘ └────────┴────────┴────────┘
+ ),
+
+ [_UP] = LAYOUT(
+ //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
+ KC_TILD ,KC_EXLM , KC_AT ,KC_HASH , KC_DLR ,KC_PERC , ______ , ______ , ______ ,KC_MINS , KC_EQL , KC_NO ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ ,KC_LBRC ,KC_RBRC , ______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ ______ , ______ , ______ , ______ , ______ , ______ , KC_LEFT ,KC_DOWN , KC_UP ,KC_RGHT , ______ , ______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_LSFT , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ ,
+ //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
+ KC_LGUI ,KC_LCTL , ______ , ______ , KC_NO , ______
+ // └────────┴────────┴────────┘ └────────┴────────┴────────┘
+ ),
+
+ [_FN] = LAYOUT(
+ //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
+ ______ , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_STAB , ______ , ______ , ______ , ______ , HYPRT , ______ , ______ , ______ , ______ , ______ , KC_F12 ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ ______ , ______ , HYPRS , ______ , ______ , ______ , ______ , ______ ,KC_BRID ,KC_BRIU , ______ , ______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ MO(_SL) , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , HYPRM ,KC_VOLD ,KC_VOLU , ______ , KC_NO ,
+ //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
+ ______ , ______ , ______ , KC_MPLY ,KC_MPRV ,KC_MNXT
+ // └────────┴────────┴────────┘ └────────┴────────┴────────┘
+ ),
+
+ [_SL] = LAYOUT(
+ //┌────────┬────────┬────────┬────────┬────────┬────────┐ ┌────────┬────────┬────────┬────────┬────────┬────────┐
+ ______ , HYPR1 , HYPR2 , HYPR3 , HYPR4 , HYPR5 , HYPR6 , HYPR7 , HYPR8 , HYPR9 , HYPR0 , ______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ ______ , HYPRQ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , HYPRP , ______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┤ ├────────┼────────┼────────┼────────┼────────┼────────┤
+ ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ ,HYPRL , ______ , ______ ,
+ //├────────┼────────┼────────┼────────┼────────┼────────┼────────┐ ┌────────┼────────┼────────┼────────┼────────┼────────┼────────┤
+ KC_NO , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , ______ , KC_NO ,
+ //└────────┴────────┴────────┴───┬────┴───┬────┴───┬────┴───┬────┘ └───┬────┴───┬────┴───┬────┴───┬────┴────────┴────────┴────────┘
+ ______ , ______ , ______ , RESET , ______ , ______
+ // └────────┴────────┴────────┘ └────────┴────────┴────────┘
+ )
+};