From 7bb986baa2af4840359dd8e4567302e9eb5d1a30 Mon Sep 17 00:00:00 2001 From: Michael Dawson-Haggerty Date: Sun, 19 Jan 2025 13:19:18 -0500 Subject: [PATCH] tuples arent arraylike --- trimesh/visual/color.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/trimesh/visual/color.py b/trimesh/visual/color.py index 908f0d745..45022cdca 100644 --- a/trimesh/visual/color.py +++ b/trimesh/visual/color.py @@ -29,7 +29,16 @@ from .. import caching, util from ..constants import tol from ..grouping import unique_rows -from ..typed import ArrayLike, DTypeLike, Integer, Iterable, NDArray, Optional, Union +from ..typed import ( + ArrayLike, + DTypeLike, + Integer, + Iterable, + NDArray, + Optional, + Tuple, + Union, +) from .base import Visuals @@ -562,7 +571,9 @@ def __hash__(self): return self._colors.__hash__() -def to_rgba(colors: Optional[ArrayLike], dtype: DTypeLike = np.uint8) -> NDArray: +def to_rgba( + colors: Union[ArrayLike, None, Tuple], dtype: DTypeLike = np.uint8 +) -> NDArray: """ Convert a single or multiple RGB colors to RGBA colors.