refactor color generator