aboutsummaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix.c
diff options
context:
space:
mode:
authorM-AS <matthewtransformer@hotmail.com>2019-03-17 13:38:51 -0400
committerDrashna Jaelre <drashna@live.com>2019-03-17 10:38:51 -0700
commit221ac2eabbc73c9d59583c6d78c779bbfec0d7bc (patch)
tree3f50380b649631b2d9c30bd1ce745cf82d8b973b /quantum/rgb_matrix.c
parentd8df01ca5e43b6322ba2ef5c7613a871ce69282c (diff)
downloadqmk_firmware-221ac2eabbc73c9d59583c6d78c779bbfec0d7bc.tar.gz
qmk_firmware-221ac2eabbc73c9d59583c6d78c779bbfec0d7bc.zip
New RGB Matrix effect: Single color reactive (#5330)
* Adds new RGB Matrix effect: rgb_matrix_config'd reactive LEDs * [Docs] Adds disable for new effect * [Docs] Added new effect to list of effects
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r--quantum/rgb_matrix.c19
1 files changed, 19 insertions, 0 deletions
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
224void 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
225void rgb_matrix_alphas_mods(void) { 239void 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();