Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RGB matrix reactive gradient timer scale #19415

Merged
merged 1 commit into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion quantum/rgb_matrix/animations/solid_reactive_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RGB_MATRIX_EFFECT(SOLID_REACTIVE)

static HSV SOLID_REACTIVE_math(HSV hsv, uint16_t offset) {
# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE
hsv.h = scale16by8(g_rgb_timer, add8(rgb_matrix_config.speed, 1) >> 6);
hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4);
# endif
hsv.h += qsub8(130, offset);
return hsv;
Expand Down
2 changes: 1 addition & 1 deletion quantum/rgb_matrix/animations/solid_reactive_cross.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ static HSV SOLID_REACTIVE_CROSS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t di
effect += dx > dy ? dy : dx;
if (effect > 255) effect = 255;
# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE
hsv.h = scale16by8(g_rgb_timer, add8(rgb_matrix_config.speed, 1) >> 6);
hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4);
# endif
hsv.v = qadd8(hsv.v, 255 - effect);
return hsv;
Expand Down
5 changes: 3 additions & 2 deletions quantum/rgb_matrix/animations/solid_reactive_nexus.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ static HSV SOLID_REACTIVE_NEXUS_math(HSV hsv, int16_t dx, int16_t dy, uint8_t di
if (dist > 72) effect = 255;
if ((dx > 8 || dx < -8) && (dy > 8 || dy < -8)) effect = 255;
# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE
hsv.h = scale16by8(g_rgb_timer, add8(rgb_matrix_config.speed, 1) >> 6);
hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4) + dy / 4;
# else
hsv.h = rgb_matrix_config.hsv.h + dy / 4;
# endif
hsv.v = qadd8(hsv.v, 255 - effect);
hsv.h = rgb_matrix_config.hsv.h + dy / 4;
return hsv;
}

Expand Down
2 changes: 1 addition & 1 deletion quantum/rgb_matrix/animations/solid_reactive_simple_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ RGB_MATRIX_EFFECT(SOLID_REACTIVE_SIMPLE)

static HSV SOLID_REACTIVE_SIMPLE_math(HSV hsv, uint16_t offset) {
# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE
hsv.h = scale16by8(g_rgb_timer, add8(rgb_matrix_config.speed, 1) >> 6);
hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4);
# endif
hsv.v = scale8(255 - offset, hsv.v);
return hsv;
Expand Down
2 changes: 1 addition & 1 deletion quantum/rgb_matrix/animations/solid_reactive_wide.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static HSV SOLID_REACTIVE_WIDE_math(HSV hsv, int16_t dx, int16_t dy, uint8_t dis
uint16_t effect = tick + dist * 5;
if (effect > 255) effect = 255;
# ifdef RGB_MATRIX_SOLID_REACTIVE_GRADIENT_MODE
hsv.h = scale16by8(g_rgb_timer, add8(rgb_matrix_config.speed, 1) >> 6);
hsv.h = scale16by8(g_rgb_timer, qadd8(rgb_matrix_config.speed, 8) >> 4);
# endif
hsv.v = qadd8(hsv.v, 255 - effect);
return hsv;
Expand Down