From c08fad399aad70f8d70fe58b11f0fe6beccb4061 Mon Sep 17 00:00:00 2001 From: Albert Y <76888457+filterpaper@users.noreply.github.com> Date: Mon, 10 Jan 2022 18:22:51 +0800 Subject: [PATCH] Add init function to clear previous effect --- quantum/rgb_matrix/animations/pixel_fractal_anim.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/quantum/rgb_matrix/animations/pixel_fractal_anim.h b/quantum/rgb_matrix/animations/pixel_fractal_anim.h index 8e25ec402c25..35187b92de70 100644 --- a/quantum/rgb_matrix/animations/pixel_fractal_anim.h +++ b/quantum/rgb_matrix/animations/pixel_fractal_anim.h @@ -31,6 +31,10 @@ static bool PIXEL_FRACTAL(effect_params_t* params) { inline uint32_t interval(void) { return 3000 / scale16by8(qadd8(rgb_matrix_config.speed, 16), 16); } + if (params->init) { + rgb_matrix_set_color_all(0, 0, 0); + } + RGB rgb = rgb_matrix_hsv_to_rgb(rgb_matrix_config.hsv); for (uint8_t h = 0; h < MATRIX_ROWS; ++h) { for (uint8_t l = 0; l < MID_COL - 1; ++l) { // Light and move left columns outwards