@@ -75,19 +75,33 @@ class ManimColor:
75
75
Be careful when passing strings to ManimColor it can create a big overhead for the color processing.
76
76
77
77
If you want to parse a list of colors use the function :meth:`parse` in :class:`ManimColor` which assumes that
78
- you are going to pass a list of color so arrays will not bei interpreted as a single color.
78
+ you are going to pass a list of color so arrays will not be interpreted as a single color.
79
79
80
80
.. warning::
81
81
If you pass an array of numbers to :meth:`parse` it will interpret the r,g,b,a numbers in that array as colors
82
82
so instead of the expect singular color you get and array with 4 colors.
83
83
84
- For conversion behaviors see the _internal functions for further documentation
84
+ For conversion behaviors see the ``_internal`` functions for further documentation
85
+
86
+ You can create a ``ManimColor`` instance via its classmethods. See the respective methods for more info.
87
+
88
+ .. code-block:: python
89
+
90
+ mycolor = ManimColor.from_rgb((0, 1, 0.4, 0.5))
91
+ myothercolor = ManimColor.from_rgb((153, 255, 255))
92
+
93
+ You can also convert between different color spaces:
94
+
95
+ .. code-block:: python
96
+
97
+ mycolor_hex = mycolor.to_hex()
98
+ myoriginalcolor = ManimColor.from_hex(mycolor_hex).to_hsv()
85
99
86
100
Parameters
87
101
----------
88
102
value
89
103
Some representation of a color (e.g., a string or
90
- a suitable tuple).
104
+ a suitable tuple). The default ``None`` is ``BLACK``.
91
105
alpha
92
106
The opacity of the color. By default, colors are
93
107
fully opaque (value 1.0).
0 commit comments