aboutsummaryrefslogtreecommitdiff
path: root/keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc
diff options
context:
space:
mode:
Diffstat (limited to 'keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc')
-rw-r--r--keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc51
1 files changed, 51 insertions, 0 deletions
diff --git a/keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc
new file mode 100644
index 000000000..d837502ca
--- /dev/null
+++ b/keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc
@@ -0,0 +1,51 @@
1/*
2QMK Firmware Massdrop CTRL M-AS Keymap
3Copyright (C) 2020 matthewrobo
4
5This program is free software: you can redistribute it and/or modify
6it under the terms of the GNU General Public License as published by
7the Free Software Foundation, either version 3 of the License, or
8(at your option) any later version.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15You should have received a copy of the GNU General Public License
16along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19// !!! DO NOT ADD #pragma once !!! //
20
21// Step 1.
22// Declare custom effects using the RGB_MATRIX_EFFECT macro
23// (note the lack of semicolon after the macro!)
24RGB_MATRIX_EFFECT(SOLID_REACTIVE_WIDE2)
25RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE2)
26RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS2)
27RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS2)
28
29// Step 2.
30// Define effects inside the `RGB_MATRIX_CUSTOM_EFFECT_IMPLS` ifdef block
31#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
32
33static HSV SOLID_REACTIVE_WIDE_math2(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
34 uint16_t effect = tick - dist > 255 || dist > 32 ? 255 : tick - dist;
35 hsv.v = qadd8(hsv.v, 255 - effect);
36 return hsv;
37}
38
39static HSV SOLID_REACTIVE_NEXUS_math2(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
40 uint16_t effect = tick - dist > 255 || ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) ? 255 : tick - dist;
41 hsv.v = qadd8(hsv.v, 255 - effect);
42 hsv.h = rgb_matrix_config.hsv.h + dy / 4;
43 return hsv;
44}
45
46bool SOLID_REACTIVE_WIDE2(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math2); }
47bool SOLID_REACTIVE_MULTIWIDE2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math2); }
48bool SOLID_REACTIVE_NEXUS2(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math2); }
49bool SOLID_REACTIVE_MULTINEXUS2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math2); }
50
51#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS