refactoring color.ts