diff options
| -rw-r--r-- | docs/feature_rgb_matrix.md | 1 | ||||
| -rw-r--r-- | keyboards/crkbd/keymaps/dsanchezseco/config.h | 1 | ||||
| -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 |
4 files changed, 25 insertions, 0 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 5695acc50..92fd62b32 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
| @@ -199,6 +199,7 @@ enum rgb_matrix_effects { | |||
| 199 | RGB_MATRIX_SOLID_COLOR = 1, // Static single hue, no speed support | 199 | RGB_MATRIX_SOLID_COLOR = 1, // Static single hue, no speed support |
| 200 | RGB_MATRIX_ALPHAS_MODS, // Static dual hue, speed is hue for secondary hue | 200 | RGB_MATRIX_ALPHAS_MODS, // Static dual hue, speed is hue for secondary hue |
| 201 | RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes | 201 | RGB_MATRIX_GRADIENT_UP_DOWN, // Static gradient top to bottom, speed controls how much gradient changes |
| 202 | RGB_MATRIX_GRADIENT_LEFT_RIGHT, // Static gradient left to right, speed controls how much gradient changes | ||
| 202 | RGB_MATRIX_BREATHING, // Single hue brightness cycling animation | 203 | RGB_MATRIX_BREATHING, // Single hue brightness cycling animation |
| 203 | RGB_MATRIX_BAND_SAT, // Single hue band fading saturation scrolling left to right | 204 | RGB_MATRIX_BAND_SAT, // Single hue band fading saturation scrolling left to right |
| 204 | RGB_MATRIX_BAND_VAL, // Single hue band fading brightness scrolling left to right | 205 | RGB_MATRIX_BAND_VAL, // Single hue band fading brightness scrolling left to right |
diff --git a/keyboards/crkbd/keymaps/dsanchezseco/config.h b/keyboards/crkbd/keymaps/dsanchezseco/config.h index 14efb7d4e..033173def 100644 --- a/keyboards/crkbd/keymaps/dsanchezseco/config.h +++ b/keyboards/crkbd/keymaps/dsanchezseco/config.h | |||
| @@ -36,6 +36,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. | |||
| 36 | //disable effects | 36 | //disable effects |
| 37 | #define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue speed is hue for secondary hue | 37 | #define DISABLE_RGB_MATRIX_ALPHAS_MODS // Static dual hue speed is hue for secondary hue |
| 38 | #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom speed controls how much gradient changes | 38 | #define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN // Static gradient top to bottom speed controls how much gradient changes |
| 39 | #define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT // Static gradient left to right speed controls how much gradient changes | ||
| 39 | #define DISABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right | 40 | #define DISABLE_RGB_MATRIX_BAND_SAT // Single hue band fading saturation scrolling left to right |
| 40 | #define DISABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right | 41 | #define DISABLE_RGB_MATRIX_BAND_VAL // Single hue band fading brightness scrolling left to right |
| 41 | #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation | 42 | #define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT // Single hue 3 blade spinning pinwheel fades saturation |
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" |
