mirror of
https://github.com/firewalkwithm3/qmk_firmware.git
synced 2024-11-22 11:30:30 +08:00
Refactor the rain lighting decision operator (#21139)
This commit is contained in:
parent
55f226159b
commit
3444e9656d
|
@ -16,13 +16,9 @@ static bool PIXEL_RAIN(effect_params_t* params) {
|
||||||
if (!HAS_ANY_FLAGS(g_led_config.flags[led_index], params->flags)) {
|
if (!HAS_ANY_FLAGS(g_led_config.flags[led_index], params->flags)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (random8() & 2) {
|
HSV hsv = (random8() & 2) ? (HSV){0, 0, 0} : (HSV){random8(), random8_min_max(127, 255), rgb_matrix_config.hsv.v};
|
||||||
rgb_matrix_set_color(led_index, 0, 0, 0);
|
RGB rgb = rgb_matrix_hsv_to_rgb(hsv);
|
||||||
} else {
|
rgb_matrix_set_color(led_index, rgb.r, rgb.g, rgb.b);
|
||||||
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);
|
|
||||||
}
|
|
||||||
wait_timer = g_rgb_timer + interval();
|
wait_timer = g_rgb_timer + interval();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue