]> git.donarmstrong.com Git - qmk_firmware.git/blobdiff - quantum/visualizer/led_test.c
big restructure now I only have to consider macOS, also added mouse, more function...
[qmk_firmware.git] / quantum / visualizer / led_test.c
index c2ea30b55ba4a0d7d38d5b2dc8d20362d53fc277..a9abace8df8d2a12803d48e0893ce88fd6eaf782 100644 (file)
@@ -89,8 +89,8 @@ static uint8_t crossfade_start_frame[NUM_ROWS][NUM_COLS];
 static uint8_t crossfade_end_frame[NUM_ROWS][NUM_COLS];
 
 static uint8_t compute_gradient_color(float t, float index, float num) {
-    const float two_pi = 2.0f * PI;
-    float normalized_index = (1.0f - index / (num - 1)) * two_pi;
+    const float two_pi = M_2_PI;
+    float normalized_index = (1.0f - index / (num - 1.0f)) * two_pi;
     float x = t * two_pi + normalized_index;
     float v = 0.5 * (cosf(x) + 1.0f);
     return (uint8_t)(255.0f * v);