Skip to content

Commit

Permalink
Adjust splash effect value range.
Browse files Browse the repository at this point in the history
  • Loading branch information
xinhaoyuan committed Oct 27, 2024
1 parent 010525b commit 2d84956
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ bool effect_runner_reactive_splash(uint8_t start, effect_params_t* params, react
RGB_MATRIX_USE_LIMITS(led_min, led_max);

uint8_t count = g_last_hit_tracker.count;
const uint8_t base = rgb_matrix_config.hsv.v >> 2;
for (uint8_t i = led_min; i < led_max; i++) {
RGB_MATRIX_TEST_LED_FLAGS();
HSV hsv = rgb_matrix_config.hsv;
Expand All @@ -19,7 +20,7 @@ bool effect_runner_reactive_splash(uint8_t start, effect_params_t* params, react
uint16_t tick = scale16by8(g_last_hit_tracker.tick[j], qadd8(rgb_matrix_config.speed, 1));
hsv = effect_func(hsv, dx, dy, dist, tick);
}
hsv.v = scale8(255 - hsv.v, rgb_matrix_config.hsv.v);
hsv.v = base + scale8(255 - hsv.v, rgb_matrix_config.hsv.v - base);
RGB rgb = rgb_matrix_hsv_to_rgb(hsv);
rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b);
}
Expand Down

0 comments on commit 2d84956

Please sign in to comment.