Cleaned up code
Tweaked colour generation

Purple colours are no longer chosen for background since this looked horrible.