Code checking before programming

Overall, you could drastically shorten & simplify your code with arrays.
Also remember LEDs are not linear, you may want a table in PROGMEM to map your brightness value to PWM value.