Properly refactor color validation