We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 932a697 commit 8e57cb6Copy full SHA for 8e57cb6
1 file changed
folium/map.py
@@ -353,9 +353,13 @@ def __init__(
353
):
354
super().__init__()
355
self._name = "Icon"
356
- if color not in self.color_options:
+
357
+ # Check if the color is a valid hex code
358
+ is_hex_color = color.startswith("#") and len(color) in (4, 7)
359
360
+ if color not in self.color_options and not is_hex_color:
361
warnings.warn(
- f"color argument of Icon should be one of: {self.color_options}.",
362
+ f"color argument of Icon should be one of: {self.color_options} or a valid hex color (e.g., '#FF0000').",
363
stacklevel=2,
364
)
365
self.options = remove_empty(
0 commit comments