qmk_firmware

QMK firmware for my keyboards (Corne, Sweep Ferris) and trackball (Ploopy Adept)
Log | Files | Refs | Submodules | LICENSE

commit d8ce8cd204313a15a600a9d4d3038f76d267f0b9
parent 248d7c1d6d0cc9d5a5403e81e7a59ae6f3ebbea1
Author: フィルターペーパー <76888457+filterpaper@users.noreply.github.com>
Date:   Sun,  7 Sep 2025 05:43:01 +0800

Simplify hue calculation in raindrops animation (#25587)


Diffstat:
Mquantum/rgb_matrix/animations/raindrops_anim.h | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/quantum/rgb_matrix/animations/raindrops_anim.h b/quantum/rgb_matrix/animations/raindrops_anim.h @@ -7,14 +7,9 @@ static void raindrops_set_color(uint8_t i, effect_params_t* params) { hsv_t hsv = rgb_matrix_config.hsv; // Take the shortest path between hues - int16_t deltaH = ((hsv.h + 180) % 360 - hsv.h) / 4; - if (deltaH > 127) { - deltaH -= 256; - } else if (deltaH < -127) { - deltaH += 256; - } - + int8_t deltaH = (int8_t)((hsv.h + 128) - hsv.h) / 4; hsv.h += (deltaH * random8_max(3)); + rgb_t rgb = rgb_matrix_hsv_to_rgb(hsv); rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); }