The color related functions live in an independent file now.
Fixes a number of minor bugs.