Skip to content

Commit

Permalink
Refactor the rain lighting decision operator (qmk#21139)
Browse files Browse the repository at this point in the history
  • Loading branch information
filterpaper authored and jesperhellberg committed Sep 9, 2023
1 parent f38420c commit a6f8898
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions quantum/rgb_matrix/animations/pixel_rain_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,9 @@ static bool PIXEL_RAIN(effect_params_t* params) {
if (!HAS_ANY_FLAGS(g_led_config.flags[led_index], params->flags)) {
return;
}
if (random8() & 2) {
rgb_matrix_set_color(led_index, 0, 0, 0);
} else {
HSV hsv = {random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v};
RGB rgb = rgb_matrix_hsv_to_rgb(hsv);
rgb_matrix_set_color(led_index, rgb.r, rgb.g, rgb.b);
}
HSV hsv = (random8() & 2) ? (HSV){0, 0, 0} : (HSV){random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v};
RGB rgb = rgb_matrix_hsv_to_rgb(hsv);
rgb_matrix_set_color(led_index, rgb.r, rgb.g, rgb.b);
wait_timer = g_rgb_timer + interval();
}

Expand Down

0 comments on commit a6f8898

Please sign in to comment.