Skip to content

armgit / manim

Public Imported from GitHub
0

A community-maintained Python framework for creating mathematical animations.

Added an example for the manim colormap (#1242)

kolibril1320005b1f6df4
diff --git a/manim/utils/color.py b/manim/utils/color.py
index bb18977b4..b6d140918 100644
--- a/manim/utils/color.py
+++ b/manim/utils/color.py
@@ -105,6 +105,18 @@ class Colors(Enum):
Examples
--------
+
+ .. manim:: ColorExample
+ :save_last_frame:
+
+ from manim.utils.color import Colors
+ class ColorExample(Scene):
+ def construct(self):
+ cols = Colors._member_names_
+ s = VGroup(*[Line(DOWN, UP, stroke_width=15).set_color(Colors[cols[i]].value) for i in range(0, len(cols))])
+ s.arrange_submobjects(buff=0.2)
+ self.add(s)
+
The preferred way of using these colors is
.. code-block:: python