cleaned up computation of color scale to be more transparent & less buggy