movis.util.to_rgb#

movis.util.to_rgb(color: str | tuple[int, int, int] | Sequence[int]) tuple[int, int, int][source]#

Converts a color input to its RGB tuple representation.

The input can be either a string representing a color name or a hex code, or a sequence of integers representing the RGB values.

Args:
color:

A union type that can be either a string or a tuple containing RGB integers or a sequence of integers. If str: The string can be either a CSS color name (e.g., ‘red’) or a hexadecimal RGB string (e.g., '#FF0000'). If tuple[int, int, int] or Sequence[int], it represents RGB values as integers between 0 and 255 (e.g., (255, 0, 0)).

Returns:

A tuple of three integers (R, G, B) that represent the RGB values.