diff options
-rw-r--r-- | docs/feature_rgb_matrix.md | 2 | ||||
-rw-r--r-- | quantum/rgb_matrix.c | 19 | ||||
-rw-r--r-- | quantum/rgb_matrix.h | 3 |
3 files changed, 24 insertions, 0 deletions
diff --git a/docs/feature_rgb_matrix.md b/docs/feature_rgb_matrix.md index 910a70469..8d1efb12a 100644 --- a/docs/feature_rgb_matrix.md +++ b/docs/feature_rgb_matrix.md | |||
@@ -147,6 +147,7 @@ These are the effects that are currently available: | |||
147 | RGB_MATRIX_DIGITAL_RAIN, | 147 | RGB_MATRIX_DIGITAL_RAIN, |
148 | #ifdef RGB_MATRIX_KEYPRESSES | 148 | #ifdef RGB_MATRIX_KEYPRESSES |
149 | RGB_MATRIX_SOLID_REACTIVE, | 149 | RGB_MATRIX_SOLID_REACTIVE, |
150 | RGB_MATRIX_REACTIVE_SIMPLE, | ||
150 | RGB_MATRIX_SPLASH, | 151 | RGB_MATRIX_SPLASH, |
151 | RGB_MATRIX_MULTISPLASH, | 152 | RGB_MATRIX_MULTISPLASH, |
152 | RGB_MATRIX_SOLID_SPLASH, | 153 | RGB_MATRIX_SOLID_SPLASH, |
@@ -173,6 +174,7 @@ You can disable a single effect by defining `DISABLE_[EFFECT_NAME]` in your `con | |||
173 | |`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | | 174 | |`#define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS` |Disables `RGB_MATRIX_JELLYBEAN_RAINDROPS` | |
174 | |`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | | 175 | |`#define DISABLE_RGB_MATRIX_DIGITAL_RAIN` |Disables `RGB_MATRIX_DIGITAL_RAIN` | |
175 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | | 176 | |`#define DISABLE_RGB_MATRIX_SOLID_REACTIVE` |Disables `RGB_MATRIX_SOLID_REACTIVE` | |
177 | |`#define DISABLE_RGB_MATRIX_REACTIVE_SIMPLE` |Disables `RGB_MATRIX_REACTIVE_SIMPLE` | | ||
176 | |`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | | 178 | |`#define DISABLE_RGB_MATRIX_SPLASH` |Disables `RGB_MATRIX_SPLASH` | |
177 | |`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | | 179 | |`#define DISABLE_RGB_MATRIX_MULTISPLASH` |Disables `RGB_MATRIX_MULTISPLASH` | |
178 | |`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | | 180 | |`#define DISABLE_RGB_MATRIX_SOLID_SPLASH` |Disables `RGB_MATRIX_SOLID_SPLASH` | |
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 2ed36304d..56a97e3c7 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c | |||
@@ -221,6 +221,20 @@ void rgb_matrix_solid_reactive(void) { | |||
221 | } | 221 | } |
222 | } | 222 | } |
223 | 223 | ||
224 | void rgb_matrix_solid_reactive_simple(void) | ||
225 | { | ||
226 | HSV hsv = {.h = rgb_matrix_config.hue, .s = rgb_matrix_config.sat, .v = rgb_matrix_config.val}; | ||
227 | RGB rgb; | ||
228 | |||
229 | for (int i = 0; i < DRIVER_LED_TOTAL; i++) { | ||
230 | uint16_t offset2 = g_key_hit[i] << 2; | ||
231 | offset2 = (offset2 <= 255) ? (255 - offset2) : 0; | ||
232 | hsv.v = offset2 * rgb_matrix_config.val / RGB_MATRIX_MAXIMUM_BRIGHTNESS; | ||
233 | rgb = hsv_to_rgb(hsv); | ||
234 | rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); | ||
235 | } | ||
236 | } | ||
237 | |||
224 | // alphas = color1, mods = color2 | 238 | // alphas = color1, mods = color2 |
225 | void rgb_matrix_alphas_mods(void) { | 239 | void rgb_matrix_alphas_mods(void) { |
226 | 240 | ||
@@ -755,6 +769,11 @@ void rgb_matrix_task(void) { | |||
755 | rgb_matrix_solid_reactive(); | 769 | rgb_matrix_solid_reactive(); |
756 | break; | 770 | break; |
757 | #endif | 771 | #endif |
772 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
773 | case RGB_MATRIX_SOLID_REACTIVE_SIMPLE: | ||
774 | rgb_matrix_solid_reactive_simple(); | ||
775 | break; | ||
776 | #endif | ||
758 | #ifndef DISABLE_RGB_MATRIX_SPLASH | 777 | #ifndef DISABLE_RGB_MATRIX_SPLASH |
759 | case RGB_MATRIX_SPLASH: | 778 | case RGB_MATRIX_SPLASH: |
760 | rgb_matrix_splash(); | 779 | rgb_matrix_splash(); |
diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index e43532d11..e6acd2d4b 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h | |||
@@ -110,6 +110,9 @@ enum rgb_matrix_effects { | |||
110 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE | 110 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE |
111 | RGB_MATRIX_SOLID_REACTIVE, | 111 | RGB_MATRIX_SOLID_REACTIVE, |
112 | #endif | 112 | #endif |
113 | #ifndef DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE | ||
114 | RGB_MATRIX_SOLID_REACTIVE_SIMPLE, | ||
115 | #endif | ||
113 | #ifndef DISABLE_RGB_MATRIX_SPLASH | 116 | #ifndef DISABLE_RGB_MATRIX_SPLASH |
114 | RGB_MATRIX_SPLASH, | 117 | RGB_MATRIX_SPLASH, |
115 | #endif | 118 | #endif |