refactored color helper