diff options
author | TurtleHunter <48608128+TurtleHunter@users.noreply.github.com> | 2021-04-03 10:41:54 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-03 16:41:54 +0200 |
commit | a3cd1290be8187a34e3c4e156c07531380bfecaa (patch) | |
tree | e2488e8bb917a742b0a204982d42156686b69889 | |
parent | 7d33d1bace66f1d9c6dbe3860d4bed651025e580 (diff) | |
download | qmk_firmware-a3cd1290be8187a34e3c4e156c07531380bfecaa.tar.gz qmk_firmware-a3cd1290be8187a34e3c4e156c07531380bfecaa.zip |
3 new LED effect animations (#9827)
Co-authored-by: Joel Challis <git@zvecr.com>
Co-authored-by: Ryan <fauxpark@gmail.com>
Co-authored-by: Erovia <Erovia@users.noreply.github.com>
-rw-r--r-- | docs/feature_rgb_matrix.md | 6 | ||||
-rw-r--r-- | quantum/rgb_matrix_animations/hue_breathing_anim.h | 22 | ||||
-rw-r--r-- | quantum/rgb_matrix_animations/hue_pendulum_anim.h | 17 | ||||
-rw-r--r-- | quantum/rgb_matrix_animations/hue_wave_anim.h | 17 | ||||
-rw-r--r-- | quantum/rgb_matrix_animations/rgb_matrix_effects.inc | 3 |
5 files changed, 65 insertions, 0 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 6917de5ab..e996caddd 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
@@ -254,6 +254,9 @@ enum rgb_matrix_effects { | |||
254 | RGB_MATRIX_RAINBOW_PINWHEELS, // Full dual gradients spinning two halfs of keyboard | 254 | RGB_MATRIX_RAINBOW_PINWHEELS, // Full dual gradients spinning two halfs of keyboard |
255 | RGB_MATRIX_RAINDROPS, // Randomly changes a single key's hue | 255 | RGB_MATRIX_RAINDROPS, // Randomly changes a single key's hue |
256 | RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation | 256 | RGB_MATRIX_JELLYBEAN_RAINDROPS, // Randomly changes a single key's hue and saturation |
257 | RGB_MATRIX_HUE_BREATHING, // Hue shifts up a slight ammount at the same time, then shifts back | ||
258 | RGB_MATRIX_HUE_PENDULUM, // Hue shifts up a slight ammount in a wave to the right, then back to the left | ||
259 | RGB_MATRIX_HUE_WAVE, // Hue shifts up a slight ammount and then back down in a wave to the right | ||
257 | #if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS) | 260 | #if define(RGB_MATRIX_FRAMEBUFFER_EFFECTS) |
258 | RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM! | 261 | RGB_MATRIX_TYPING_HEATMAP, // How hot is your WPM! |
259 | RGB_MATRIX_DIGITAL_RAIN, // That famous computer simulation | 262 | RGB_MATRIX_DIGITAL_RAIN, // That famous computer simulation |
@@ -305,6 +308,9 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con | |||
305 | |`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | | 308 | |`#define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS` |Disables `RGB_MATRIX_RAINBOW_PINWHEELS` | |
306 | |`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | | 309 | |`#define DISABLE_RGB_MATRIX_RAINDROPS` |Disables `RGB_MATRIX_RAINDROPS` | |
307 | |`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | | 310 | |`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | |
311 | |`#define DISABLE_RGB_MATRIX_HUE_BREATHING` |Disables `RGB_MATRIX_HUE_BREATHING` | | ||
312 | |`#define DISABLE_RGB_MATRIX_HUE_PENDULUM` |Disables `RGB_MATRIX_HUE_PENDULUM` | | ||
313 | |`#define DISABLE_RGB_MATRIX_HUE_WAVE ` |Disables `RGB_MATRIX_HUE_WAVE ` | | ||
308 | |`#define DISABLE_RGB_MATRIX_TYPING_HEATMAP` |Disables `RGB_MATRIX_TYPING_HEATMAP` | | 314 | |`#define DISABLE_RGB_MATRIX_TYPING_HEATMAP` |Disables `RGB_MATRIX_TYPING_HEATMAP` | |
309 | |`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | | 315 | |`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | |
310 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` | | 316 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_SOLID_REACTIVE_SIMPLE` | |
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 | ||
2 | RGB_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 | ||
7 | bool 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 | ||
2 | RGB_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 | ||
8 | static 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 | |||
14 | bool 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 | ||
2 | RGB_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 | ||
8 | static 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 | |||
14 | bool 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" |