diff options
Diffstat (limited to 'keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc')
| -rw-r--r-- | keyboards/massdrop/ctrl/keymaps/matthewrobo/rgb_matrix_user.inc | 51 |
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 | /* | ||
| 2 | QMK Firmware Massdrop CTRL M-AS Keymap | ||
| 3 | Copyright (C) 2020 matthewrobo | ||
| 4 | |||
| 5 | This program is free software: you can redistribute it and/or modify | ||
| 6 | it under the terms of the GNU General Public License as published by | ||
| 7 | the Free Software Foundation, either version 3 of the License, or | ||
| 8 | (at your option) any later version. | ||
| 9 | |||
| 10 | This program is distributed in the hope that it will be useful, | ||
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 13 | GNU General Public License for more details. | ||
| 14 | |||
| 15 | You should have received a copy of the GNU General Public License | ||
| 16 | along 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!) | ||
| 24 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_WIDE2) | ||
| 25 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE2) | ||
| 26 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS2) | ||
| 27 | RGB_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 | |||
| 33 | static 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 | |||
| 39 | static 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 | |||
| 46 | bool SOLID_REACTIVE_WIDE2(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_WIDE_math2); } | ||
| 47 | bool SOLID_REACTIVE_MULTIWIDE2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math2); } | ||
| 48 | bool SOLID_REACTIVE_NEXUS2(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math2); } | ||
| 49 | bool 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 | ||
