diff options
| -rw-r--r-- | docs/feature_rgb_matrix.md | 4 | ||||
| -rw-r--r-- | quantum/rgb_matrix_animations/cycle_out_in_anim.h | 23 | ||||
| -rw-r--r-- | quantum/rgb_matrix_animations/cycle_out_in_dual_anim.h | 23 | ||||
| -rw-r--r-- | quantum/rgb_matrix_animations/rgb_matrix_effects.inc | 2 |
4 files changed, 52 insertions, 0 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index e29433a4b..8347660df 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
| @@ -197,6 +197,8 @@ enum rgb_matrix_effects { | |||
| 197 | RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient | 197 | RGB_MATRIX_CYCLE_ALL, // Full keyboard solid hue cycling through full gradient |
| 198 | RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right | 198 | RGB_MATRIX_CYCLE_LEFT_RIGHT, // Full gradient scrolling left to right |
| 199 | RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom | 199 | RGB_MATRIX_CYCLE_UP_DOWN, // Full gradient scrolling top to bottom |
| 200 | RGB_MATRIX_CYCLE_OUT_IN, // Full gradient scrolling out to in | ||
| 201 | RGB_MATRIX_CYCLE_OUT_IN_DUAL, // Full dual gradients scrolling out to in | ||
| 200 | RGB_MATRIX_RAINBOW_MOVING_CHEVRON, // Full gradent Chevron shapped scrolling left to right | 202 | RGB_MATRIX_RAINBOW_MOVING_CHEVRON, // Full gradent Chevron shapped scrolling left to right |
| 201 | RGB_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard | 203 | RGB_MATRIX_DUAL_BEACON, // Full gradient spinning around center of keyboard |
| 202 | RGB_MATRIX_RAINBOW_BEACON, // Full tighter gradient spinning around center of keyboard | 204 | RGB_MATRIX_RAINBOW_BEACON, // Full tighter gradient spinning around center of keyboard |
| @@ -236,6 +238,8 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con | |||
| 236 | |`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` | | 238 | |`#define DISABLE_RGB_MATRIX_CYCLE_ALL` |Disables `RGB_MATRIX_CYCLE_ALL` | |
| 237 | |`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | | 239 | |`#define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT` |Disables `RGB_MATRIX_CYCLE_LEFT_RIGHT` | |
| 238 | |`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` | | 240 | |`#define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN` |Disables `RGB_MATRIX_CYCLE_UP_DOWN` | |
| 241 | |`#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN` |Disables `RGB_MATRIX_CYCLE_OUT_IN` | | ||
| 242 | |`#define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL` |Disables `RGB_MATRIX_CYCLE_OUT_IN_DUAL` | | ||
| 239 | |`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` | | 243 | |`#define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON` |Disables `RGB_MATRIX_RAINBOW_MOVING_CHEVRON` | |
| 240 | |`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` | | 244 | |`#define DISABLE_RGB_MATRIX_DUAL_BEACON` |Disables `RGB_MATRIX_DUAL_BEACON` | |
| 241 | |`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` | | 245 | |`#define DISABLE_RGB_MATRIX_RAINBOW_BEACON` |Disables `RGB_MATRIX_RAINBOW_BEACON` | |
diff --git a/quantum/rgb_matrix_animations/cycle_out_in_anim.h b/quantum/rgb_matrix_animations/cycle_out_in_anim.h new file mode 100644 index 000000000..dc9d09fd3 --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_out_in_anim.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_OUT_IN | ||
| 2 | RGB_MATRIX_EFFECT(CYCLE_OUT_IN) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 4 | |||
| 5 | bool CYCLE_OUT_IN(effect_params_t* params) { | ||
| 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
| 7 | |||
| 8 | HSV hsv = { 0, rgb_matrix_config.sat, 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 dx = g_led_config.point[i].x - 112; | ||
| 13 | int16_t dy = g_led_config.point[i].y - 32; | ||
| 14 | uint8_t dist = sqrt16(dx * dx + dy * dy); | ||
| 15 | hsv.h = 3 * dist / 2 + time; | ||
| 16 | RGB rgb = hsv_to_rgb(hsv); | ||
| 17 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
| 18 | } | ||
| 19 | return led_max < DRIVER_LED_TOTAL; | ||
| 20 | } | ||
| 21 | |||
| 22 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 23 | #endif // DISABLE_RGB_MATRIX_CYCLE_OUT_IN | ||
diff --git a/quantum/rgb_matrix_animations/cycle_out_in_dual_anim.h b/quantum/rgb_matrix_animations/cycle_out_in_dual_anim.h new file mode 100644 index 000000000..941e6b9a8 --- /dev/null +++ b/quantum/rgb_matrix_animations/cycle_out_in_dual_anim.h | |||
| @@ -0,0 +1,23 @@ | |||
| 1 | #ifndef DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
| 2 | RGB_MATRIX_EFFECT(CYCLE_OUT_IN_DUAL) | ||
| 3 | #ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 4 | |||
| 5 | bool CYCLE_OUT_IN_DUAL(effect_params_t* params) { | ||
| 6 | RGB_MATRIX_USE_LIMITS(led_min, led_max); | ||
| 7 | |||
| 8 | HSV hsv = { 0, rgb_matrix_config.sat, 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 dx = 56 - abs8(g_led_config.point[i].x - 112); | ||
| 13 | int16_t dy = g_led_config.point[i].y - 32; | ||
| 14 | uint8_t dist = sqrt16(dx * dx + dy * dy); | ||
| 15 | hsv.h = 3 * dist + time; | ||
| 16 | RGB rgb = hsv_to_rgb(hsv); | ||
| 17 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
| 18 | } | ||
| 19 | return led_max < DRIVER_LED_TOTAL; | ||
| 20 | } | ||
| 21 | |||
| 22 | #endif // RGB_MATRIX_CUSTOM_EFFECT_IMPLS | ||
| 23 | #endif // DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL | ||
diff --git a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc index 9bc645461..f05a415a5 100644 --- a/quantum/rgb_matrix_animations/rgb_matrix_effects.inc +++ b/quantum/rgb_matrix_animations/rgb_matrix_effects.inc | |||
| @@ -7,6 +7,8 @@ | |||
| 7 | #include "rgb_matrix_animations/cycle_left_right_anim.h" | 7 | #include "rgb_matrix_animations/cycle_left_right_anim.h" |
| 8 | #include "rgb_matrix_animations/cycle_up_down_anim.h" | 8 | #include "rgb_matrix_animations/cycle_up_down_anim.h" |
| 9 | #include "rgb_matrix_animations/rainbow_moving_chevron_anim.h" | 9 | #include "rgb_matrix_animations/rainbow_moving_chevron_anim.h" |
| 10 | #include "rgb_matrix_animations/cycle_out_in_anim.h" | ||
| 11 | #include "rgb_matrix_animations/cycle_out_in_dual_anim.h" | ||
| 10 | #include "rgb_matrix_animations/dual_beacon_anim.h" | 12 | #include "rgb_matrix_animations/dual_beacon_anim.h" |
| 11 | #include "rgb_matrix_animations/rainbow_beacon_anim.h" | 13 | #include "rgb_matrix_animations/rainbow_beacon_anim.h" |
| 12 | #include "rgb_matrix_animations/rainbow_pinwheels_anim.h" | 14 | #include "rgb_matrix_animations/rainbow_pinwheels_anim.h" |
