     return 0;
 }
 
-// animation animates linearly, repeating the numbers 0-255.
+// animation animates from 0-255.
 uint8_t animation() {
     static uint8_t an = 0;
     an += animate();
     return an;
 }
 
-// animation animates linearly, repeating the numbers 0-255.
-uint8_t animationCubic() {
+// animationSin animates a sine wave.
+uint8_t animationSin() {
     static uint8_t an = 0;
-    static int8_t multiplier = 1;
-    if (an == 255 && multiplier == 1) {
-        multiplier = -1;
-    } else if (an == 0 && multiplier == -1) {
-        multiplier = 1;
-    }
-    an = an + (multiplier * animate());
-    return an;
+    an += animate();
+    return sin8(an);
+}
+
+// animationQuad animates quadratic in/out easing applied to a triangle wave.
+uint8_t animationQuad() {
+    static uint8_t an = 0;
+    an += animate();
+    return quadwave8(an);
 }
 
 // Read a value from an analog pin as a byte value between 0-255.

    }
}

void modeCubic() {
    uint8_t cubic;
    uint8_t value;
    for (uint8_t led = 0; led < NUM_LEDS; led++) {
        cubic = animationCubic();
        value = map(cubic, 0, 255, min(70, pots.val), pots.val);
        leds[led] = CHSV(pots.hue, pots.sat, value);
    }
}

void modeSolid();
void modeRainbow();
void modeRainbowCycle();
void modeBreathe();
void modeSine();
void modeEase();
void (*modes[MAX_MODES])() = {
    &modeOff,
    &modeSolid,
    &modeRainbow,
    &modeRainbowCycle,
    &modeBreathe,
    &modeSine,
    &modeEase,
    &modeEase,
    &modeOff,
    &modeOff
};
