Single Color Band scrolling left to right effects (#5867)

master
XScorpion2 2019-05-19 11:09:06 -05:00 committed by Drashna Jaelre
parent ba26736d7e
commit 0099bbf9a6
4 changed files with 48 additions and 0 deletions

View File

@ -194,6 +194,8 @@ enum rgb_matrix_effects {
RGB_MATRIX_ALPHAS_MODS, // Static dual hue, speed is hue for secondary hue
RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes
RGB_MATRIX_BREATHING, // Single hue brightness cycling animation
RGB_MATRIX_BAND_SAT, // Single hue band fading saturation scrolling left to right
RGB_MATRIX_BAND_VAL, // Single hue band fading brightness scrolling left to right
RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient
RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right
RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom
@ -235,6 +237,8 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con
|`#define DISABLE_RGB_MATRIX_ALPHAS_MODS` |Disables `RGB_MATRIX_ALPHAS_MODS` |
|`#define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN` |Disables `RGB_MATRIX_GRADIENT_UP_DOWN` |
|`#define DISABLE_RGB_MATRIX_BREATHING` |Disables `RGB_MATRIX_BREATHING` |
|`#define DISABLE_RGB_MATRIX_BAND_SAT` |Disables `RGB_MATRIX_BAND_SAT` |
|`#define DISABLE_RGB_MATRIX_BAND_VAL` |Disables `RGB_MATRIX_BAND_VAL` |
|`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` |
|`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` |
|`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` |

View File

@ -0,0 +1,21 @@
#ifndef DISABLE_RGB_MATRIX_BAND_SAT
RGB_MATRIX_EFFECT(BAND_SAT)
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
bool BAND_SAT(effect_params_t* params) {
RGB_MATRIX_USE_LIMITS(led_min, led_max);
HSV hsv = { rgb_matrix_config.hue, 0, rgb_matrix_config.val };
uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
for (uint8_t i = led_min; i < led_max; i++) {
RGB_MATRIX_TEST_LED_FLAGS();
int16_t s = rgb_matrix_config.sat - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8;
hsv.s = s < 0 ? 0 : s;
RGB rgb = hsv_to_rgb(hsv);
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
}
return led_max < DRIVER_LED_TOTAL;
}
#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
#endif // DISABLE_RGB_MATRIX_BAND_SAT

View File

@ -0,0 +1,21 @@
#ifndef DISABLE_RGB_MATRIX_BAND_VAL
RGB_MATRIX_EFFECT(BAND_VAL)
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS
bool BAND_VAL(effect_params_t* params) {
RGB_MATRIX_USE_LIMITS(led_min, led_max);
HSV hsv = { rgb_matrix_config.hue, rgb_matrix_config.sat, 0 };
uint8_t time = scale16by8(g_rgb_counters.tick, rgb_matrix_config.speed / 4);
for (uint8_t i = led_min; i < led_max; i++) {
RGB_MATRIX_TEST_LED_FLAGS();
int16_t v = rgb_matrix_config.val - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8;
hsv.v = v < 0 ? 0 : v;
RGB rgb = hsv_to_rgb(hsv);
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
}
return led_max < DRIVER_LED_TOTAL;
}
#endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS
#endif // DISABLE_RGB_MATRIX_BAND_VAL

View File

@ -3,6 +3,8 @@
#include "rgb_matrix_animations/alpha_mods_anim.h"
#include "rgb_matrix_animations/gradient_up_down_anim.h"
#include "rgb_matrix_animations/breathing_anim.h"
#include "rgb_matrix_animations/colorband_sat_anim.h"
#include "rgb_matrix_animations/colorband_val_anim.h"
#include "rgb_matrix_animations/cycle_all_anim.h"
#include "rgb_matrix_animations/cycle_left_right_anim.h"
#include "rgb_matrix_animations/cycle_up_down_anim.h"