]> git.donarmstrong.com Git - qmk_firmware.git/commitdiff
Fixing effects to respect user sat and val levels (#6275)
authorXScorpion2 <rcalt2vt@gmail.com>
Thu, 11 Jul 2019 18:29:19 +0000 (13:29 -0500)
committerDrashna Jaelre <drashna@live.com>
Thu, 11 Jul 2019 18:29:19 +0000 (11:29 -0700)
quantum/rgb_matrix_animations/colorband_pinwheel_sat_anim.h
quantum/rgb_matrix_animations/colorband_pinwheel_val_anim.h
quantum/rgb_matrix_animations/colorband_sat_anim.h
quantum/rgb_matrix_animations/colorband_spiral_sat_anim.h
quantum/rgb_matrix_animations/colorband_spiral_val_anim.h
quantum/rgb_matrix_animations/colorband_val_anim.h

index cf9c0784a83e6815cbc86c1f87321bac93ba1af5..3739cde1f62063e4cc360be738ac66433d96c47d 100644 (file)
@@ -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) {
index 05ad0ee32351d707927dc6595fdaf93a87d69ef8..6e5871d7ec4d5cb238c2cc450ff15bb9dada3331 100644 (file)
@@ -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) {
index 8a40473e4a41cdd43856be3a83447ff5d3358c32..bfa1085cb1a43ea3b5bd6c24d533893f7e8a8660 100644 (file)
@@ -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) {
index 4af6c60b0d280406000352d7cf80c5edafed30d3..7db01c5f9ecb3b89031866ce9d31481ab6f432af 100644 (file)
@@ -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) {
index e787956a7a05c8e70e44060feef7a8412047d210..a16f8e2cea341656bdc4faa8df390a21c58ffe50 100644 (file)
@@ -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) {
index 1e3740cea46de336e1cc8f29717d460caa57d53d..4b76924db9fd8c2caf64ca38a925387560902b35 100644 (file)
@@ -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) {