minor refactoring of saveColor function