Refactored color utils.