diff options
Diffstat (limited to 'quantum/rgb_matrix_animations')
| -rw-r--r-- | quantum/rgb_matrix_animations/gradient_left_right_anim.h | 22 | ||||
| -rw-r--r-- | quantum/rgb_matrix_animations/rgb_matrix_effects.inc | 1 |
2 files changed, 23 insertions, 0 deletions
diff --git a/quantum/rgb_matrix_animations/gradient_left_right_anim.h b/quantum/rgb_matrix_animations/gradient_left_right_anim.h new file mode 100644 index 000000000..2eab2eb75 --- /dev/null +++ b/quantum/rgb_matrix_animations/gradient_left_right_anim.h | |||
| @@ -0,0 +1,22 @@ | |||
| 1 | #ifndef DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT | ||
| 2 | RGB_MATRIX_EFFECT(GRADIENT_LEFT_RIGHT) | ||
| 3 | # ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 4 | |||
| 5 | bool GRADIENT_LEFT_RIGHT(effect_params_t* params) { | ||
| 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
| 7 | |||
| 8 | HSV hsv = rgb_matrix_config.hsv; | ||
| 9 | uint8_t scale = scale8(64, rgb_matrix_config.speed); | ||
| 10 | for (uint8_t i = led_min; i < led_max; i++) { | ||
| 11 | RGB_MATRIX_TEST_LED_FLAGS(); | ||
| 12 | // The x range will be 0..224, map this to 0..7 | ||
| 13 | // Relies on hue being 8-bit and wrapping | ||
| 14 | hsv.h = rgb_matrix_config.hsv.h + (scale * g_led_config.point[i].x >> 5); | ||
| 15 | RGB rgb = hsv_to_rgb(hsv); | ||
| 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_MATRIX_GRADIENT_LEFT_RIGHT | ||
diff --git a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc index 01332ed0d..4c1723d93 100644 --- a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc +++ b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc | |||
| @@ -2,6 +2,7 @@ | |||
| 2 | #include "rgb_matrix_animations/solid_color_anim.h" | 2 | #include "rgb_matrix_animations/solid_color_anim.h" |
| 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/gradient_left_right_anim.h" | ||
| 5 | #include "rgb_matrix_animations/breathing_anim.h" | 6 | #include "rgb_matrix_animations/breathing_anim.h" |
| 6 | #include "rgb_matrix_animations/colorband_sat_anim.h" | 7 | #include "rgb_matrix_animations/colorband_sat_anim.h" |
| 7 | #include "rgb_matrix_animations/colorband_val_anim.h" | 8 | #include "rgb_matrix_animations/colorband_val_anim.h" |
