From 7f2ac4c5765f899d53aef6456a99be910ce3f3b5 Mon Sep 17 00:00:00 2001 From: Albert Y <76888457+filterpaper@users.noreply.github.com> Date: Wed, 28 Dec 2022 04:11:31 +0800 Subject: De-obfuscate random8 functions in RGB matrix animations (#19416) --- quantum/rgb_matrix/animations/pixel_flow_anim.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'quantum/rgb_matrix/animations/pixel_flow_anim.h') diff --git a/quantum/rgb_matrix/animations/pixel_flow_anim.h b/quantum/rgb_matrix/animations/pixel_flow_anim.h index 8628c3c2ec..27567b4f3a 100644 --- a/quantum/rgb_matrix/animations/pixel_flow_anim.h +++ b/quantum/rgb_matrix/animations/pixel_flow_anim.h @@ -22,7 +22,7 @@ static bool PIXEL_FLOW(effect_params_t* params) { // Clear LEDs and fill the state array rgb_matrix_set_color_all(0, 0, 0); for (uint8_t j = 0; j < RGB_MATRIX_LED_COUNT; ++j) { - led[j] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), qadd8(random8() >> 1, 127), rgb_matrix_config.hsv.v}); + led[j] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v}); } } @@ -39,7 +39,7 @@ static bool PIXEL_FLOW(effect_params_t* params) { led[j] = led[j + 1]; } // Fill last LED - led[led_max - 1] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), qadd8(random8() >> 1, 127), rgb_matrix_config.hsv.v}); + led[led_max - 1] = (random8() & 2) ? (RGB){0, 0, 0} : hsv_to_rgb((HSV){random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v}); // Set pulse timer wait_timer = g_rgb_timer + interval(); } -- cgit v1.2.3