Color
color
¶
Color
¶
Bases: StrEnum
Contains color aliases and converters to go between the various color formats. The color values are defined by the standard Tailwind CSS color theme.
MuJoCo uses a normalized rgba (all color channels clamped between 0 and 1). This enum defines with hex values, but they can be easily transformed with the provided methods (for example: Color.WHITE.rgba).
with_alpha
¶
hex_to_rgba
classmethod
¶
Converts '#RRGGBB' or 'RRGGBB' to normalized [0, 1] RGBA.
Source code in src/mujoco_mojo/utils/color.py
rgba255_to_rgba
classmethod
¶
Converts [0-255, 0-255, 0-255, 0-1] to normalized [0, 1] RGBA.
rgba_to_hex
classmethod
¶
Converts normalized RGBA to '#RRGGBB' (alpha is discarded).
Source code in src/mujoco_mojo/utils/color.py
rgba_to_rgba255
classmethod
¶
Converts normalized RGBA to [0-255, 0-255, 0-255, 0-1].