Repository: pydantic/pydantic-extra-types

Issue:
Unhandled validation error when parsing Color
Missing TypeError handling when validating Color

```python
>>> from pydantic_extra_types.color import Color
>>> Color(({}, 0, 0))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/ilias/projects/my/pydantic-extra-types/pydantic_extra_types/color.py", line 75, in __init__
    self._rgba = parse_tuple(value)
  File "/Users/ilias/projects/my/pydantic-extra-types/pydantic_extra_types/color.py", line 251, in parse_tuple
    r, g, b = (parse_color_value(v) for v in value)
  File "/Users/ilias/projects/my/pydantic-extra-types/pydantic_extra_types/color.py", line 251, in <genexpr>
    r, g, b = (parse_color_value(v) for v in value)
  File "/Users/ilias/projects/my/pydantic-extra-types/pydantic_extra_types/color.py", line 356, in parse_color_value
    color = float(value)
TypeError: float() argument must be a string or a real number, not 'dict'
```

Hints from issue comments:

Solution patch:
diff --git a/pydantic_extra_types/color.py b/pydantic_extra_types/color.py
index 92995e5..18d9633 100644
--- a/pydantic_extra_types/color.py
+++ b/pydantic_extra_types/color.py
@@ -354,7 +354,7 @@ def parse_color_value(value: int | str, max_val: int = 255) -> float:
     """
     try:
         color = float(value)
-    except ValueError as e:
+    except (ValueError, TypeError) as e:
         raise PydanticCustomError(
             'color_error',
             'value is not a valid color: color values must be a valid number',


Test patch:
diff --git a/tests/test_types_color.py b/tests/test_types_color.py
index defec19..8e88ef6 100644
--- a/tests/test_types_color.py
+++ b/tests/test_types_color.py
@@ -91,6 +91,7 @@ def test_color_success(raw_color, as_tuple):
         (0, 0, 1128, 0.5),
         (0, 0, 1128, -0.5),
         (0, 0, 1128, 1.5),
+        ({}, 0, 0),
         # rgb/rgba strings
         'rgb(0, 0, 1205)',
         'rgb(0, 0, 1128)',