diff options
Diffstat (limited to 'quantum/rgb_matrix/animations/solid_reactive_nexus.h')
-rw-r--r-- | quantum/rgb_matrix/animations/solid_reactive_nexus.h | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/quantum/rgb_matrix/animations/solid_reactive_nexus.h b/quantum/rgb_matrix/animations/solid_reactive_nexus.h new file mode 100644 index 000000000..17f94e3c1 --- /dev/null +++ b/quantum/rgb_matrix/animations/solid_reactive_nexus.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifdef RGB_MATRIX_KEYREACTIVE_ENABLED | ||
2 | # if !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) | ||
3 | |||
4 | # ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
5 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS) | ||
6 | # endif | ||
7 | |||
8 | # ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
9 | RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS) | ||
10 | # endif | ||
11 | |||
12 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
13 | |||
14 | static HSV SOLID_REACTIVE_NEXUS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) { | ||
15 | uint16_t effect = tick - dist; | ||
16 | if (effect > 255) effect = 255; | ||
17 | if (dist > 72) effect = 255; | ||
18 | if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) effect = 255; | ||
19 | hsv.v = qadd8(hsv.v, 255 - effect); | ||
20 | hsv.h = rgb_matrix_config.hsv.h + dy / 4; | ||
21 | return hsv; | ||
22 | } | ||
23 | |||
24 | # ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS | ||
25 | bool SOLID_REACTIVE_NEXUS(effect_params_t* params) { return effect_runner_reactive_splash(qsub8(g_last_hit_tracker.count, 1), params, &SOLID_REACTIVE_NEXUS_math); } | ||
26 | # endif | ||
27 | |||
28 | # ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS | ||
29 | bool SOLID_REACTIVE_MULTINEXUS(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math); } | ||
30 | # endif | ||
31 | |||
32 | # endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
33 | # endif // !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS) || !defined(DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS) | ||
34 | #endif // RGB_MATRIX_KEYREACTIVE_ENABLED | ||