improve and fix ColorGradient class based on tests; add more tests