aboutsummaryrefslogtreecommitdiff
path: root/quantum
diff options
context:
space:
mode:
Diffstat (limited to 'quantum')
-rw-r--r--quantum/rgb_matrix_animations/colorband_sat_anim.h21
-rw-r--r--quantum/rgb_matrix_animations/colorband_val_anim.h21
-rw-r--r--quantum/rgb_matrix_animations/rgb_matrix_effects.inc2
3 files changed, 44 insertions, 0 deletions
diff --git a/quantum/rgb_matrix_animations/colorband_sat_anim.h b/quantum/rgb_matrix_animations/colorband_sat_anim.h
new file mode 100644
index 000000000..89773b6ce
--- /dev/null
+++ b/quantum/rgb_matrix_animations/colorband_sat_anim.h
@@ -0,0 +1,21 @@
1#ifndef DISABLE_RGB_MATRIX_BAND_SAT
2RGB_MATRIX_EFFECT(BAND_SAT)
3#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
4
5bool BAND_SAT(effect_params_t* params) {
6 RGB_MATRIX_USE_LIMITS(led_min, led_max);
7
8 HSV hsv = { rgb_matrix_config.hue, 0, rgb_matrix_config.val };
9 uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
10 for (uint8_t i = led_min; i < led_max; i++) {
11 RGB_MATRIX_TEST_LED_FLAGS();
12 int16_t s = rgb_matrix_config.sat - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8;
13 hsv.s = s < 0 ? 0 : s;
14 RGB rgb = hsv_to_rgb(hsv);
15 rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
16 }
17 return led_max < DRIVER_LED_TOTAL;
18}
19
20#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
21#endif // DISABLE_RGB_MATRIX_BAND_SAT
diff --git a/quantum/rgb_matrix_animations/colorband_val_anim.h b/quantum/rgb_matrix_animations/colorband_val_anim.h
new file mode 100644
index 000000000..bf41cec91
--- /dev/null
+++ b/quantum/rgb_matrix_animations/colorband_val_anim.h
@@ -0,0 +1,21 @@
1#ifndef DISABLE_RGB_MATRIX_BAND_VAL
2RGB_MATRIX_EFFECT(BAND_VAL)
3#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
4
5bool BAND_VAL(effect_params_t* params) {
6 RGB_MATRIX_USE_LIMITS(led_min, led_max);
7
8 HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 };
9 uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
10 for (uint8_t i = led_min; i < led_max; i++) {
11 RGB_MATRIX_TEST_LED_FLAGS();
12 int16_t v = rgb_matrix_config.val - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8;
13 hsv.v = v < 0 ? 0 : v;
14 RGB rgb = hsv_to_rgb(hsv);
15 rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
16 }
17 return led_max < DRIVER_LED_TOTAL;
18}
19
20#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
21#endif // DISABLE_RGB_MATRIX_BAND_VAL
diff --git a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc
index f05a415a5..4b01afaa3 100644
--- a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc
+++ b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc
@@ -3,6 +3,8 @@
3#include "rgb_matrix_animations/alpha_mods_anim.h" 3#include "rgb_matrix_animations/alpha_mods_anim.h"
4#include "rgb_matrix_animations/gradient_up_down_anim.h" 4#include "rgb_matrix_animations/gradient_up_down_anim.h"
5#include "rgb_matrix_animations/breathing_anim.h" 5#include "rgb_matrix_animations/breathing_anim.h"
6#include "rgb_matrix_animations/colorband_sat_anim.h"
7#include "rgb_matrix_animations/colorband_val_anim.h"
6#include "rgb_matrix_animations/cycle_all_anim.h" 8#include "rgb_matrix_animations/cycle_all_anim.h"
7#include "rgb_matrix_animations/cycle_left_right_anim.h" 9#include "rgb_matrix_animations/cycle_left_right_anim.h"
8#include "rgb_matrix_animations/cycle_up_down_anim.h" 10#include "rgb_matrix_animations/cycle_up_down_anim.h"