aboutsummaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix/animations/pixel_fractal_anim.h
diff options
context:
space:
mode:
authorNick Brassel <[email protected]>2024-08-26 10:01:57 +1000
committerNick Brassel <[email protected]>2024-08-26 10:01:57 +1000
commit5d76c5280dc0aff398cdce19fa54d0e0725c418d (patch)
tree40026340f0d524a6006f18f01ef988e15d271075 /quantum/rgb_matrix/animations/pixel_fractal_anim.h
parente6a898e3eea3521d3f0497ee26937d5269d78fb7 (diff)
parent81dcf2b547bacc42bd9cf8ccaccd3d7164e69926 (diff)
downloadqmk_firmware-5d76c5280dc0aff398cdce19fa54d0e0725c418d.tar.gz
qmk_firmware-5d76c5280dc0aff398cdce19fa54d0e0725c418d.zip
Merge branch 'develop'0.26.0
Diffstat (limited to 'quantum/rgb_matrix/animations/pixel_fractal_anim.h')
-rw-r--r--quantum/rgb_matrix/animations/pixel_fractal_anim.h24
1 files changed, 12 insertions, 12 deletions
diff --git a/quantum/rgb_matrix/animations/pixel_fractal_anim.h b/quantum/rgb_matrix/animations/pixel_fractal_anim.h
index 4cd1d9b861..90a75ed321 100644
--- a/quantum/rgb_matrix/animations/pixel_fractal_anim.h
+++ b/quantum/rgb_matrix/animations/pixel_fractal_anim.h
@@ -30,23 +30,23 @@ static bool PIXEL_FRACTAL(effect_params_t* params) {
for (uint8_t h = 0; h < MATRIX_ROWS; ++h) {
// Light and copy columns outward
for (uint8_t l = 0; l < MID_COL - 1; ++l) {
- if (led[h][l]) {
- rgb_matrix_set_color(g_led_config.matrix_co[h][l], rgb.r, rgb.g, rgb.b);
- rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - 1 - l], rgb.r, rgb.g, rgb.b);
- } else {
- rgb_matrix_set_color(g_led_config.matrix_co[h][l], 0, 0, 0);
- rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - 1 - l], 0, 0, 0);
+ RGB index_rgb = led[h][l] ? (RGB){rgb.r, rgb.g, rgb.b} : (RGB){0, 0, 0};
+ if (HAS_ANY_FLAGS(g_led_config.flags[g_led_config.matrix_co[h][l]], params->flags)) {
+ rgb_matrix_set_color(g_led_config.matrix_co[h][l], index_rgb.r, index_rgb.g, index_rgb.b);
+ }
+ if (HAS_ANY_FLAGS(g_led_config.flags[g_led_config.matrix_co[h][MATRIX_COLS - 1 - l]], params->flags)) {
+ rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - 1 - l], index_rgb.r, index_rgb.g, index_rgb.b);
}
led[h][l] = led[h][l + 1];
}
// Light both middle columns
- if (led[h][MID_COL - 1]) {
- rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL - 1], rgb.r, rgb.g, rgb.b);
- rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - MID_COL], rgb.r, rgb.g, rgb.b);
- } else {
- rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL - 1], 0, 0, 0);
- rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - MID_COL], 0, 0, 0);
+ RGB index_rgb = led[h][MID_COL - 1] ? (RGB){rgb.r, rgb.g, rgb.b} : (RGB){0, 0, 0};
+ if (HAS_ANY_FLAGS(g_led_config.flags[g_led_config.matrix_co[h][MID_COL - 1]], params->flags)) {
+ rgb_matrix_set_color(g_led_config.matrix_co[h][MID_COL - 1], index_rgb.r, index_rgb.g, index_rgb.b);
+ }
+ if (HAS_ANY_FLAGS(g_led_config.flags[g_led_config.matrix_co[h][MATRIX_COLS - MID_COL]], params->flags)) {
+ rgb_matrix_set_color(g_led_config.matrix_co[h][MATRIX_COLS - MID_COL], index_rgb.r, index_rgb.g, index_rgb.b);
}
// Generate new random fractal column