summaryrefslogtreecommitdiff
path: root/keyboards/wekey/we27/rgb_matrix_kb.inc
diff options
context:
space:
mode:
authorUy Bui <uybv.cntt@gmail.com>2021-07-20 14:26:26 +0900
committerGitHub <noreply@github.com>2021-07-19 22:26:26 -0700
commit125691558398c4bfff93b457147b2802365cbd3f (patch)
tree1e4ea53de60bef8b57c441f752b52f9518409bc3 /keyboards/wekey/we27/rgb_matrix_kb.inc
parent35ee990bd0293efbd5746671f1e58cec262a066b (diff)
[Keyboard] Add we27 numpad (#13137)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards/wekey/we27/rgb_matrix_kb.inc')
-rw-r--r--keyboards/wekey/we27/rgb_matrix_kb.inc27
1 files changed, 27 insertions, 0 deletions
diff --git a/keyboards/wekey/we27/rgb_matrix_kb.inc b/keyboards/wekey/we27/rgb_matrix_kb.inc
new file mode 100644
index 0000000000..a7eeffbbe9
--- /dev/null
+++ b/keyboards/wekey/we27/rgb_matrix_kb.inc
@@ -0,0 +1,27 @@
+
+//RGB_MATRIX_EFFECT(SOLID_REACTIVE_WIDE2)
+RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTIWIDE2)
+//RGB_MATRIX_EFFECT(SOLID_REACTIVE_NEXUS2)
+//RGB_MATRIX_EFFECT(SOLID_REACTIVE_MULTINEXUS2)
+
+#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
+
+static HSV SOLID_REACTIVE_WIDE_math2(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
+ uint16_t effect = tick - dist > 255 || dist > 32 ? 255 : tick - dist;
+ hsv.v = qadd8(hsv.v, 255 - effect);
+ return hsv;
+}
+
+static HSV SOLID_REACTIVE_NEXUS_math2(HSV hsv, int16_t dx, int16_t dy, uint8_t dist, uint16_t tick) {
+ uint16_t effect = tick - dist > 255 || ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) ? 255 : tick - dist;
+ hsv.v = qadd8(hsv.v, 255 - effect);
+ hsv.h = rgb_matrix_config.hsv.h + dy / 4;
+ return hsv;
+}
+
+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); }
+bool SOLID_REACTIVE_MULTIWIDE2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_WIDE_math2); }
+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); }
+bool SOLID_REACTIVE_MULTINEXUS2(effect_params_t* params) { return effect_runner_reactive_splash(0, params, &SOLID_REACTIVE_NEXUS_math2); }
+
+#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS