Cleaned up colorsmith

All common operations have been refactored out into functions to make the code
easier to tweak.