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

Fixing effects to respect user sat and val levels #6275

Merged
merged 1 commit into from
Jul 11, 2019
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
Fixing effects to respect user sat and val levels
  • Loading branch information
XScorpion2 committed Jul 7, 2019
commit 635c9c7121179ece1c2777655be62e9f854ca65b
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RGB_MATRIX_EFFECT(BAND_PINWHEEL_SAT)
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS

static void BAND_PINWHEEL_SAT_math(HSV* hsv, int16_t dx, int16_t dy, uint8_t time) {
hsv->s = rgb_matrix_config.sat - time - atan2_8(dy, dx) * 3;
hsv->s = scale8(rgb_matrix_config.sat - time - atan2_8(dy, dx) * 3, rgb_matrix_config.sat);
}

bool BAND_PINWHEEL_SAT(effect_params_t* params) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RGB_MATRIX_EFFECT(BAND_PINWHEEL_VAL)
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS

static void BAND_PINWHEEL_VAL_math(HSV* hsv, int16_t dx, int16_t dy, uint8_t time) {
hsv->v = rgb_matrix_config.val - time - atan2_8(dy, dx) * 3;
hsv->v = scale8(rgb_matrix_config.val - time - atan2_8(dy, dx) * 3, rgb_matrix_config.val);
}

bool BAND_PINWHEEL_VAL(effect_params_t* params) {
Expand Down
2 changes: 1 addition & 1 deletion quantum/rgb_matrix_animations/colorband_sat_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RGB_MATRIX_EFFECT(BAND_SAT)

static void BAND_SAT_math(HSV* hsv, uint8_t i, uint8_t time) {
int16_t s = rgb_matrix_config.sat - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8;
hsv->s = s < 0 ? 0 : s;
hsv->s = scale8(s < 0 ? 0 : s, rgb_matrix_config.sat);
}

bool BAND_SAT(effect_params_t* params) {
Expand Down
2 changes: 1 addition & 1 deletion quantum/rgb_matrix_animations/colorband_spiral_sat_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RGB_MATRIX_EFFECT(BAND_SPIRAL_SAT)
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS

static void BAND_SPIRAL_SAT_math(HSV* hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) {
hsv->s = rgb_matrix_config.sat + dist - time - atan2_8(dy, dx);
hsv->s = scale8(rgb_matrix_config.sat + dist - time - atan2_8(dy, dx), rgb_matrix_config.sat);
}

bool BAND_SPIRAL_SAT(effect_params_t* params) {
Expand Down
2 changes: 1 addition & 1 deletion quantum/rgb_matrix_animations/colorband_spiral_val_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ RGB_MATRIX_EFFECT(BAND_SPIRAL_VAL)
#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS

static void BAND_SPIRAL_VAL_math(HSV* hsv, int16_t dx, int16_t dy, uint8_t dist, uint8_t time) {
hsv->v = rgb_matrix_config.val + dist - time - atan2_8(dy, dx);
hsv->v = scale8(rgb_matrix_config.val + dist - time - atan2_8(dy, dx), rgb_matrix_config.val);
}

bool BAND_SPIRAL_VAL(effect_params_t* params) {
Expand Down
2 changes: 1 addition & 1 deletion quantum/rgb_matrix_animations/colorband_val_anim.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RGB_MATRIX_EFFECT(BAND_VAL)

static void BAND_VAL_math(HSV* hsv, uint8_t i, uint8_t time) {
int16_t v = rgb_matrix_config.val - abs(scale8(g_led_config.point[i].x, 228) + 28 - time) * 8;
hsv->v = v < 0 ? 0 : v;
hsv->v = scale8(v < 0 ? 0 : v, rgb_matrix_config.val);
}

bool BAND_VAL(effect_params_t* params) {
Expand Down