aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgb_matrix_animations/hue_breathing_anim.h22
-rw-r--r--quantum/rgb_matrix_animations/hue_pendulum_anim.h17
-rw-r--r--quantum/rgb_matrix_animations/hue_wave_anim.h17
-rw-r--r--quantum/rgb_matrix_animations/rgb_matrix_effects.inc3
4 files changed, 59 insertions, 0 deletions
diff --git a/quantum/rgb_matrix_animations/hue_breathing_anim.h b/quantum/rgb_matrix_animations/hue_breathing_anim.h
new file mode 100644
index 000000000..37a6293c7
--- /dev/null
+++ b/quantum/rgb_matrix_animations/hue_breathing_anim.h
@@ -0,0 +1,22 @@
1#ifndef DISABLE_RGB_MATRIX_HUE_BREATHING
2RGB_MATRIX_EFFECT(HUE_BREATHING)
3# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
4
5// Change huedelta to adjust range of hue change. 0-255.
6// Hue Breathing - All LED's light up
7bool HUE_BREATHING(effect_params_t* params) {
8 RGB_MATRIX_USE_LIMITS(led_min, led_max);
9 uint8_t huedelta = 12;
10 HSV hsv = rgb_matrix_config.hsv;
11 uint16_t time = scale16by8(g_rgb_timer, rgb_matrix_config.speed / 8);
12 hsv.h = hsv.h + scale8(abs8(sin8(time) - 128) * 2, huedelta);
13 RGB rgb = hsv_to_rgb(hsv);
14 for (uint8_t i = led_min; i < led_max; i++) {
15 RGB_MATRIX_TEST_LED_FLAGS();
16 rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
17 }
18 return led_max < DRIVER_LED_TOTAL;
19}
20
21# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
22#endif // DISABLE_RGB_HUE_BREATHING
diff --git a/quantum/rgb_matrix_animations/hue_pendulum_anim.h b/quantum/rgb_matrix_animations/hue_pendulum_anim.h
new file mode 100644
index 000000000..37db649c1
--- /dev/null
+++ b/quantum/rgb_matrix_animations/hue_pendulum_anim.h
@@ -0,0 +1,17 @@
1#ifndef DISABLE_RGB_MATRIX_HUE_PENDULUM
2RGB_MATRIX_EFFECT(HUE_PENDULUM)
3# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
4
5// Change huedelta to adjust range of hue change. 0-255.
6// Looks better with a low value and slow speed for subtle change.
7// Hue Pendulum - color changes in a wave to the right before reversing direction
8static HSV HUE_PENDULUM_math(HSV hsv, uint8_t i, uint8_t time) {
9 uint8_t huedelta = 12;
10 hsv.h = hsv.h + scale8(abs8(sin8(time) + (g_led_config.point[i].x) - 128) * 2, huedelta);
11 return hsv;
12}
13
14bool HUE_PENDULUM(effect_params_t* params) { return effect_runner_i(params, &HUE_PENDULUM_math); }
15
16# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
17#endif // DISABLE_RGB_HUE_PENDULUM
diff --git a/quantum/rgb_matrix_animations/hue_wave_anim.h b/quantum/rgb_matrix_animations/hue_wave_anim.h
new file mode 100644
index 000000000..1d4af5af4
--- /dev/null
+++ b/quantum/rgb_matrix_animations/hue_wave_anim.h
@@ -0,0 +1,17 @@
1#ifndef DISABLE_RGB_MATRIX_HUE_WAVE
2RGB_MATRIX_EFFECT(HUE_WAVE)
3# ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
4
5// Change huedelta to adjust range of hue change. 0-255.
6// Looks better with a low value and slow speed for subtle change.
7// Hue Wave - color changes in a wave to the right
8static HSV HUE_WAVE_math(HSV hsv, uint8_t i, uint8_t time) {
9 uint8_t huedelta = 24;
10 hsv.h = hsv.h + scale8(abs8(g_led_config.point[i].x - time), huedelta);
11 return hsv;
12}
13
14bool HUE_WAVE(effect_params_t* params) { return effect_runner_i(params, &HUE_WAVE_math); }
15
16# endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
17#endif // DISABLE_RGB_HUE_WAVE
diff --git a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc
index 4c1723d93..053d44150 100644
--- a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc
+++ b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc
@@ -23,6 +23,9 @@
23#include "rgb_matrix_animations/rainbow_pinwheels_anim.h" 23#include "rgb_matrix_animations/rainbow_pinwheels_anim.h"
24#include "rgb_matrix_animations/raindrops_anim.h" 24#include "rgb_matrix_animations/raindrops_anim.h"
25#include "rgb_matrix_animations/jellybean_raindrops_anim.h" 25#include "rgb_matrix_animations/jellybean_raindrops_anim.h"
26#include "rgb_matrix_animations/hue_breathing_anim.h"
27#include "rgb_matrix_animations/hue_pendulum_anim.h"
28#include "rgb_matrix_animations/hue_wave_anim.h"
26#include "rgb_matrix_animations/typing_heatmap_anim.h" 29#include "rgb_matrix_animations/typing_heatmap_anim.h"
27#include "rgb_matrix_animations/digital_rain_anim.h" 30#include "rgb_matrix_animations/digital_rain_anim.h"
28#include "rgb_matrix_animations/solid_reactive_simple_anim.h" 31#include "rgb_matrix_animations/solid_reactive_simple_anim.h"