Refactor color handling.