From 3129bf1afb74fc8b95cc32c4da4381ea98ecc6e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Manr=C3=ADquez=20Novoa?= Date: Mon, 2 Feb 2026 02:02:38 -0300 Subject: [PATCH 1/4] Fix YELLOW_C and add PURE_CYAN, PURE_MAGENTA and PURE_YELLOW --- manim/utils/color/manim_colors.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/manim/utils/color/manim_colors.py b/manim/utils/color/manim_colors.py index 44c7a8c0c4..3181f93876 100644 --- a/manim/utils/color/manim_colors.py +++ b/manim/utils/color/manim_colors.py @@ -102,6 +102,9 @@ def named_lines_group(length, color_names, labels, align_to_block): "pure_red", "pure_green", "pure_blue", + "pure_cyan", + "pure_magenta", + "pure_yellow", ) pure_lines = named_lines_group( @@ -145,12 +148,17 @@ def named_lines_group(length, color_names, labels, align_to_block): DARK_GREY = ManimColor("#444444") DARKER_GRAY = ManimColor("#222222") DARKER_GREY = ManimColor("#222222") +PURE_RED = ManimColor("#FF0000") +PURE_GREEN = ManimColor("#00FF00") +PURE_BLUE = ManimColor("#0000FF") +PURE_CYAN = ManimColor("#00FFFF") +PURE_MAGENTA = ManimColor("#FF00FF") +PURE_YELLOW = ManimColor("#FFFF00") BLUE_A = ManimColor("#C7E9F1") BLUE_B = ManimColor("#9CDCEB") BLUE_C = ManimColor("#58C4DD") BLUE_D = ManimColor("#29ABCA") BLUE_E = ManimColor("#236B8E") -PURE_BLUE = ManimColor("#0000FF") BLUE = ManimColor("#58C4DD") DARK_BLUE = ManimColor("#236B8E") TEAL_A = ManimColor("#ACEAD7") @@ -164,14 +172,13 @@ def named_lines_group(length, color_names, labels, align_to_block): GREEN_C = ManimColor("#83C167") GREEN_D = ManimColor("#77B05D") GREEN_E = ManimColor("#699C52") -PURE_GREEN = ManimColor("#00FF00") GREEN = ManimColor("#83C167") YELLOW_A = ManimColor("#FFF1B6") YELLOW_B = ManimColor("#FFEA94") -YELLOW_C = ManimColor("#FFFF00") +YELLOW_C = ManimColor("#F7D96F") YELLOW_D = ManimColor("#F4D345") YELLOW_E = ManimColor("#E8C11C") -YELLOW = ManimColor("#FFFF00") +YELLOW = ManimColor("#F7D96F") GOLD_A = ManimColor("#F7C797") GOLD_B = ManimColor("#F9B775") GOLD_C = ManimColor("#F0AC5F") @@ -183,7 +190,6 @@ def named_lines_group(length, color_names, labels, align_to_block): RED_C = ManimColor("#FC6255") RED_D = ManimColor("#E65A4C") RED_E = ManimColor("#CF5044") -PURE_RED = ManimColor("#FF0000") RED = ManimColor("#FC6255") MAROON_A = ManimColor("#ECABC1") MAROON_B = ManimColor("#EC92AB") From f276c0755bcf4fe7be09f64afae43c6aa9617ef7 Mon Sep 17 00:00:00 2001 From: Benjamin Hackl Date: Mon, 16 Feb 2026 17:48:41 +0100 Subject: [PATCH 2/4] update default colors YELLOW -> PURE_YELLOW throughout the library --- manim/animation/indication.py | 12 ++++++------ manim/mobject/geometry/shape_matchers.py | 4 ++-- manim/mobject/graphing/coordinate_systems.py | 8 ++++---- manim/mobject/graphing/functions.py | 4 ++-- manim/mobject/mobject.py | 4 ++-- manim/mobject/opengl/dot_cloud.py | 4 ++-- manim/mobject/opengl/opengl_point_cloud_mobject.py | 6 +++--- manim/mobject/table.py | 6 +++--- manim/mobject/types/point_cloud_mobject.py | 6 +++--- manim/scene/vector_space_scene.py | 8 ++++---- tests/opengl/test_coordinate_system_opengl.py | 6 +++--- tests/test_graphical_units/test_axes.py | 4 ++-- .../test_graphical_units/test_coordinate_systems.py | 8 ++++---- tests/test_graphical_units/test_mobjects.py | 4 ++-- tests/test_graphical_units/test_modifier_methods.py | 4 ++-- tests/test_graphical_units/test_probability.py | 6 +++--- tests/test_graphical_units/test_threed.py | 4 ++-- tests/test_graphical_units/test_transform.py | 2 +- 18 files changed, 50 insertions(+), 50 deletions(-) diff --git a/manim/animation/indication.py b/manim/animation/indication.py index 77918e0fb0..36dc4227aa 100644 --- a/manim/animation/indication.py +++ b/manim/animation/indication.py @@ -64,7 +64,7 @@ def construct(self): from ..mobject.types.vectorized_mobject import VGroup, VMobject from ..typing import Point3D, Point3DLike, Vector3DLike from ..utils.bezier import interpolate, inverse_interpolate -from ..utils.color import GREY, YELLOW, ParsableManimColor +from ..utils.color import GREY, PURE_YELLOW, ParsableManimColor from ..utils.rate_functions import RateFunction, smooth, there_and_back, wiggle from ..utils.space_ops import normalize @@ -89,7 +89,7 @@ class FocusOn(Transform): class UsingFocusOn(Scene): def construct(self): - dot = Dot(color=YELLOW).shift(DOWN) + dot = Dot(color=PURE_YELLOW).shift(DOWN) self.add(Tex("Focusing on the dot below:"), dot) self.play(FocusOn(dot)) self.wait() @@ -153,7 +153,7 @@ def __init__( self, mobject: Mobject, scale_factor: float = 1.2, - color: ParsableManimColor = YELLOW, + color: ParsableManimColor = PURE_YELLOW, rate_func: RateFunction = there_and_back, **kwargs: Any, ): @@ -198,7 +198,7 @@ class Flash(AnimationGroup): class UsingFlash(Scene): def construct(self): - dot = Dot(color=YELLOW).shift(DOWN) + dot = Dot(color=PURE_YELLOW).shift(DOWN) self.add(Tex("Flash the dot below:"), dot) self.play(Flash(dot)) self.wait() @@ -226,7 +226,7 @@ def __init__( num_lines: int = 12, flash_radius: float = 0.1, line_stroke_width: int = 3, - color: ParsableManimColor = YELLOW, + color: ParsableManimColor = PURE_YELLOW, time_width: float = 1, run_time: float = 1.0, **kwargs: Any, @@ -618,7 +618,7 @@ def __init__( fade_out: bool = False, time_width: float = 0.3, buff: float = SMALL_BUFF, - color: ParsableManimColor = YELLOW, + color: ParsableManimColor = PURE_YELLOW, run_time: float = 1, stroke_width: float = DEFAULT_STROKE_WIDTH, **kwargs: Any, diff --git a/manim/mobject/geometry/shape_matchers.py b/manim/mobject/geometry/shape_matchers.py index ae2a70db41..738cdb34f8 100644 --- a/manim/mobject/geometry/shape_matchers.py +++ b/manim/mobject/geometry/shape_matchers.py @@ -20,7 +20,7 @@ from manim.mobject.mobject import Mobject from manim.mobject.opengl.opengl_mobject import OpenGLMobject from manim.mobject.types.vectorized_mobject import VGroup -from manim.utils.color import BLACK, RED, YELLOW, ManimColor, ParsableManimColor +from manim.utils.color import BLACK, RED, PURE_YELLOW, ManimColor, ParsableManimColor class SurroundingRectangle(RoundedRectangle): @@ -50,7 +50,7 @@ def construct(self): def __init__( self, *mobjects: Mobject, - color: ParsableManimColor = YELLOW, + color: ParsableManimColor = PURE_YELLOW, buff: float | tuple[float, float] = SMALL_BUFF, corner_radius: float = 0.0, **kwargs: Any, diff --git a/manim/mobject/graphing/coordinate_systems.py b/manim/mobject/graphing/coordinate_systems.py index 48eba65737..47dd656284 100644 --- a/manim/mobject/graphing/coordinate_systems.py +++ b/manim/mobject/graphing/coordinate_systems.py @@ -43,7 +43,7 @@ BLUE_D, GREEN, WHITE, - YELLOW, + PURE_YELLOW, ManimColor, ParsableManimColor, color_gradient, @@ -1614,7 +1614,7 @@ def get_secant_slope_group( x: float, graph: ParametricFunction, dx: float | None = None, - dx_line_color: ParsableManimColor = YELLOW, + dx_line_color: ParsableManimColor = PURE_YELLOW, dy_line_color: ParsableManimColor | None = None, dx_label: float | str | None = None, dy_label: float | str | None = None, @@ -1796,7 +1796,7 @@ def get_T_label( triangle_size: float = MED_SMALL_BUFF, triangle_color: ParsableManimColor | None = WHITE, line_func: type[Line] = Line, - line_color: ParsableManimColor = YELLOW, + line_color: ParsableManimColor = PURE_YELLOW, ) -> VGroup: """Creates a labelled triangle marker with a vertical line from the x-axis to a curve at a given x-value. @@ -2293,7 +2293,7 @@ def plot_line_graph( x_values: Iterable[float], y_values: Iterable[float], z_values: Iterable[float] | None = None, - line_color: ParsableManimColor = YELLOW, + line_color: ParsableManimColor = PURE_YELLOW, add_vertex_dots: bool = True, vertex_dot_radius: float = DEFAULT_DOT_RADIUS, vertex_dot_style: dict[str, Any] | None = None, diff --git a/manim/mobject/graphing/functions.py b/manim/mobject/graphing/functions.py index f344de98d5..8650f339c8 100644 --- a/manim/mobject/graphing/functions.py +++ b/manim/mobject/graphing/functions.py @@ -22,7 +22,7 @@ from manim.typing import Point3D, Point3DLike from manim.utils.color import ParsableManimColor -from manim.utils.color import YELLOW +from manim.utils.color import PURE_YELLOW class ParametricFunction(VMobject, metaclass=ConvertToOpenGL): @@ -217,7 +217,7 @@ def __init__( self, function: Callable[[float], Any], x_range: tuple[float, float] | tuple[float, float, float] | None = None, - color: ParsableManimColor = YELLOW, + color: ParsableManimColor = PURE_YELLOW, **kwargs: Any, ) -> None: if x_range is None: diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py index 4a7c0409eb..83841cfcee 100644 --- a/manim/mobject/mobject.py +++ b/manim/mobject/mobject.py @@ -29,7 +29,7 @@ from ..utils.color import ( BLACK, WHITE, - YELLOW_C, + PURE_YELLOW, ManimColor, ParsableManimColor, color_gradient, @@ -1965,7 +1965,7 @@ def add_background_rectangle_to_family_members_with_points(self, **kwargs) -> Se # Color functions def set_color( - self, color: ParsableManimColor = YELLOW_C, family: bool = True + self, color: ParsableManimColor = PURE_YELLOW, family: bool = True ) -> Self: """Condition is function which takes in one arguments, (x, y, z). Here it just recurses to submobjects, but in subclasses this diff --git a/manim/mobject/opengl/dot_cloud.py b/manim/mobject/opengl/dot_cloud.py index 5154bc71a3..3ba440ebe4 100644 --- a/manim/mobject/opengl/dot_cloud.py +++ b/manim/mobject/opengl/dot_cloud.py @@ -9,13 +9,13 @@ from manim.constants import ORIGIN, RIGHT, UP from manim.mobject.opengl.opengl_point_cloud_mobject import OpenGLPMobject from manim.typing import Point3DLike -from manim.utils.color import YELLOW, ParsableManimColor +from manim.utils.color import PURE_YELLOW, ParsableManimColor class DotCloud(OpenGLPMobject): def __init__( self, - color: ParsableManimColor = YELLOW, + color: ParsableManimColor = PURE_YELLOW, stroke_width: float = 2.0, radius: float = 2.0, density: float = 10, diff --git a/manim/mobject/opengl/opengl_point_cloud_mobject.py b/manim/mobject/opengl/opengl_point_cloud_mobject.py index 9571853724..785ae36367 100644 --- a/manim/mobject/opengl/opengl_point_cloud_mobject.py +++ b/manim/mobject/opengl/opengl_point_cloud_mobject.py @@ -13,7 +13,7 @@ from manim.utils.color import ( BLACK, WHITE, - YELLOW, + PURE_YELLOW, ParsableManimColor, color_gradient, color_to_rgba, @@ -48,7 +48,7 @@ class OpenGLPMobject(OpenGLMobject): def __init__( self, stroke_width: float = 2.0, - color: ParsableManimColor = YELLOW, + color: ParsableManimColor = PURE_YELLOW, render_primitive: int = moderngl.POINTS, **kwargs, ): @@ -79,7 +79,7 @@ def add_points( Rgbas must be a Nx4 numpy array if it is not None. """ if rgbas is None and color is None: - color = YELLOW + color = PURE_YELLOW self.append_points(points) # rgbas array will have been resized with points if color is not None: diff --git a/manim/mobject/table.py b/manim/mobject/table.py index 6aa806277f..d0a40a32fc 100644 --- a/manim/mobject/table.py +++ b/manim/mobject/table.py @@ -79,7 +79,7 @@ def construct(self): from ..animation.creation import Create, Write from ..animation.fading import FadeIn from ..mobject.types.vectorized_mobject import VGroup, VMobject -from ..utils.color import BLACK, YELLOW, ManimColor, ParsableManimColor +from ..utils.color import BLACK, PURE_YELLOW, ManimColor, ParsableManimColor from .utils import get_vectorized_mobject_class @@ -811,7 +811,7 @@ def construct(self): return rec def get_highlighted_cell( - self, pos: Sequence[int] = (1, 1), color: ParsableManimColor = YELLOW, **kwargs + self, pos: Sequence[int] = (1, 1), color: ParsableManimColor = PURE_YELLOW, **kwargs ) -> BackgroundRectangle: """Returns a :class:`~.BackgroundRectangle` of the cell at the given position. @@ -847,7 +847,7 @@ def construct(self): return bg_cell def add_highlighted_cell( - self, pos: Sequence[int] = (1, 1), color: ParsableManimColor = YELLOW, **kwargs + self, pos: Sequence[int] = (1, 1), color: ParsableManimColor = PURE_YELLOW, **kwargs ) -> Table: """Highlights one cell at a specific position on the table by adding a :class:`~.BackgroundRectangle`. diff --git a/manim/mobject/types/point_cloud_mobject.py b/manim/mobject/types/point_cloud_mobject.py index 6b315fba99..0e31dc3239 100644 --- a/manim/mobject/types/point_cloud_mobject.py +++ b/manim/mobject/types/point_cloud_mobject.py @@ -18,7 +18,7 @@ from ...utils.color import ( BLACK, WHITE, - YELLOW, + PURE_YELLOW, ManimColor, ParsableManimColor, color_gradient, @@ -110,7 +110,7 @@ def add_points( return self def set_color( - self, color: ParsableManimColor = YELLOW, family: bool = True + self, color: ParsableManimColor = PURE_YELLOW, family: bool = True ) -> Self: rgba = color_to_rgba(color) mobs = self.family_members_with_points() if family else [self] @@ -359,7 +359,7 @@ def __init__( radius: float = 2.0, stroke_width: int = 2, density: int = DEFAULT_POINT_DENSITY_1D, - color: ManimColor = YELLOW, + color: ManimColor = PURE_YELLOW, **kwargs: Any, ) -> None: self.radius = radius diff --git a/manim/scene/vector_space_scene.py b/manim/scene/vector_space_scene.py index 17178e40aa..e41d211c53 100644 --- a/manim/scene/vector_space_scene.py +++ b/manim/scene/vector_space_scene.py @@ -37,7 +37,7 @@ GREY, RED_C, WHITE, - YELLOW, + PURE_YELLOW, ManimColor, ParsableManimColor, ) @@ -172,7 +172,7 @@ def get_vector(self, numerical_vector: Vector3DLike, **kwargs: Any) -> Arrow: def add_vector( self, vector: Arrow | Vector3DLike, - color: ParsableManimColor | Iterable[ParsableManimColor] = YELLOW, + color: ParsableManimColor | Iterable[ParsableManimColor] = PURE_YELLOW, animate: bool = True, **kwargs: Any, ) -> Arrow: @@ -808,7 +808,7 @@ def get_ghost_vectors(self) -> VGroup: def get_unit_square( self, - color: ParsableManimColor | Iterable[ParsableManimColor] = YELLOW, + color: ParsableManimColor | Iterable[ParsableManimColor] = PURE_YELLOW, opacity: float = 0.3, stroke_width: float = 3, ) -> Rectangle: @@ -875,7 +875,7 @@ def add_unit_square(self, animate: bool = False, **kwargs: Any) -> Self: def add_vector( self, vector: Arrow | list | tuple | np.ndarray, - color: ParsableManimColor = YELLOW, + color: ParsableManimColor = PURE_YELLOW, animate: bool = False, **kwargs: Any, ) -> Arrow: diff --git a/tests/opengl/test_coordinate_system_opengl.py b/tests/opengl/test_coordinate_system_opengl.py index c9f5cc81b6..84ed40a3cb 100644 --- a/tests/opengl/test_coordinate_system_opengl.py +++ b/tests/opengl/test_coordinate_system_opengl.py @@ -20,7 +20,7 @@ tempconfig, ) from manim import CoordinateSystem as CS -from manim.utils.color import BLUE, GREEN, ORANGE, RED, YELLOW +from manim.utils.color import BLUE, GREEN, ORANGE, RED, PURE_YELLOW from manim.utils.testing.frames_comparison import frames_comparison __module_test__ = "coordinate_system_opengl" @@ -152,7 +152,7 @@ def test_gradient_line_graph_x_axis(scene, using_opengl_renderer): curve = axes.plot( lambda x: 0.1 * x**3, x_range=(-3, 3, 0.001), - colorscale=[BLUE, GREEN, YELLOW, ORANGE, RED], + colorscale=[BLUE, GREEN, PURE_YELLOW, ORANGE, RED], colorscale_axis=0, ) @@ -167,7 +167,7 @@ def test_gradient_line_graph_y_axis(scene, using_opengl_renderer): curve = axes.plot( lambda x: 0.1 * x**3, x_range=(-3, 3, 0.001), - colorscale=[BLUE, GREEN, YELLOW, ORANGE, RED], + colorscale=[BLUE, GREEN, PURE_YELLOW, ORANGE, RED], colorscale_axis=1, ) diff --git a/tests/test_graphical_units/test_axes.py b/tests/test_graphical_units/test_axes.py index f26333570e..e034f69382 100644 --- a/tests/test_graphical_units/test_axes.py +++ b/tests/test_graphical_units/test_axes.py @@ -226,7 +226,7 @@ def test_get_area(scene): area2 = ax.get_area( curve1, x_range=(-4.5, -2), - color=(RED, YELLOW), + color=(RED, PURE_YELLOW), opacity=0.2, bounded_graph=curve2, ) @@ -266,7 +266,7 @@ def test_get_riemann_rectangles(scene, use_vectorized): quadratic, x_range=[-1.5, 1.5], dx=0.15, - color=YELLOW, + color=PURE_YELLOW, ) bounding_line = ax.plot(lambda x: 1.5 * x, color=BLUE_B, x_range=[3.3, 6]) diff --git a/tests/test_graphical_units/test_coordinate_systems.py b/tests/test_graphical_units/test_coordinate_systems.py index 7d6dad67af..299c7bcae6 100644 --- a/tests/test_graphical_units/test_coordinate_systems.py +++ b/tests/test_graphical_units/test_coordinate_systems.py @@ -26,7 +26,7 @@ def test_line_graph(scene): first_line = plane.plot_line_graph( x_values=[-3, 1], y_values=[-2, 2], - line_color=YELLOW, + line_color=PURE_YELLOW, ) second_line = plane.plot_line_graph( x_values=[0, 2, 2, 4], @@ -71,7 +71,7 @@ def param_trig(u, v): param_trig, u_range=(-3, 3), v_range=(-3, 3), - colorscale=[BLUE, GREEN, YELLOW, ORANGE, RED], + colorscale=[BLUE, GREEN, PURE_YELLOW, ORANGE, RED], ) scene.add(axes, trig_plane) @@ -151,7 +151,7 @@ def test_gradient_line_graph_x_axis(scene): curve = axes.plot( lambda x: 0.1 * x**3, x_range=(-3, 3, 0.001), - colorscale=[BLUE, GREEN, YELLOW, ORANGE, RED], + colorscale=[BLUE, GREEN, PURE_YELLOW, ORANGE, RED], colorscale_axis=0, ) @@ -166,7 +166,7 @@ def test_gradient_line_graph_y_axis(scene): curve = axes.plot( lambda x: 0.1 * x**3, x_range=(-3, 3, 0.001), - colorscale=[BLUE, GREEN, YELLOW, ORANGE, RED], + colorscale=[BLUE, GREEN, PURE_YELLOW, ORANGE, RED], colorscale_axis=1, ) diff --git a/tests/test_graphical_units/test_mobjects.py b/tests/test_graphical_units/test_mobjects.py index b0a1da92b6..e416b28b8b 100644 --- a/tests/test_graphical_units/test_mobjects.py +++ b/tests/test_graphical_units/test_mobjects.py @@ -24,7 +24,7 @@ def test_become(scene): .set_opacity(0.25) .set_color(GREEN) ) - s3 = s.copy().become(d, stretch=True).set_opacity(0.25).set_color(YELLOW) + s3 = s.copy().become(d, stretch=True).set_opacity(0.25).set_color(PURE_YELLOW) scene.add(s, d, s1, s2, s3) @@ -37,7 +37,7 @@ def test_become_no_color_linking(scene): scene.add(b) b.become(a) b.shift(1 * RIGHT) - b.set_stroke(YELLOW, opacity=1) + b.set_stroke(PURE_YELLOW, opacity=1) @frames_comparison diff --git a/tests/test_graphical_units/test_modifier_methods.py b/tests/test_graphical_units/test_modifier_methods.py index 7d123cc790..7fadadb138 100644 --- a/tests/test_graphical_units/test_modifier_methods.py +++ b/tests/test_graphical_units/test_modifier_methods.py @@ -8,11 +8,11 @@ @frames_comparison def test_Gradient(scene): - c = Circle(fill_opacity=1).set_color(color=[YELLOW, GREEN]) + c = Circle(fill_opacity=1).set_color(color=[PURE_YELLOW, GREEN]) scene.add(c) @frames_comparison def test_GradientRotation(scene): - c = Circle(fill_opacity=1).set_color(color=[YELLOW, GREEN]).rotate(PI) + c = Circle(fill_opacity=1).set_color(color=[PURE_YELLOW, GREEN]).rotate(PI) scene.add(c) diff --git a/tests/test_graphical_units/test_probability.py b/tests/test_graphical_units/test_probability.py index f5e31c95c8..c7762bd0fc 100644 --- a/tests/test_graphical_units/test_probability.py +++ b/tests/test_graphical_units/test_probability.py @@ -1,7 +1,7 @@ from manim.constants import LEFT from manim.mobject.graphing.probability import BarChart from manim.mobject.text.tex_mobject import MathTex -from manim.utils.color import BLUE, GREEN, RED, WHITE, YELLOW +from manim.utils.color import BLUE, GREEN, RED, WHITE, PURE_YELLOW from manim.utils.testing.frames_comparison import frames_comparison __module_test__ = "probability" @@ -69,13 +69,13 @@ def test_advanced_customization(scene): chart = BarChart(values=[10, 40, 10, 20], bar_names=["one", "two", "three", "four"]) c_x_lbls = chart.x_axis.labels - c_x_lbls.set_color_by_gradient(GREEN, RED, YELLOW) + c_x_lbls.set_color_by_gradient(GREEN, RED, PURE_YELLOW) c_y_nums = chart.y_axis.numbers c_y_nums.set_color_by_gradient(BLUE, WHITE).shift(LEFT) c_y_axis = chart.y_axis - c_y_axis.ticks.set_color(YELLOW) + c_y_axis.ticks.set_color(PURE_YELLOW) c_bar_lbls = chart.get_bar_labels() diff --git a/tests/test_graphical_units/test_threed.py b/tests/test_graphical_units/test_threed.py index 108472f840..da1f934850 100644 --- a/tests/test_graphical_units/test_threed.py +++ b/tests/test_graphical_units/test_threed.py @@ -133,7 +133,7 @@ def param_trig(u, v): u_range=[-3, 3], ) trig_plane.set_fill_by_value( - axes=axes, colorscale=[BLUE, GREEN, YELLOW, ORANGE, RED] + axes=axes, colorscale=[BLUE, GREEN, PURE_YELLOW, ORANGE, RED] ) scene.add(axes, trig_plane) @@ -158,7 +158,7 @@ def param_surface(u, v): ) surface_plane.set_style(fill_opacity=1) surface_plane.set_fill_by_value( - axes=axes, colorscale=[(RED, -0.4), (YELLOW, 0), (GREEN, 0.4)], axis=1 + axes=axes, colorscale=[(RED, -0.4), (PURE_YELLOW, 0), (GREEN, 0.4)], axis=1 ) scene.add(axes, surface_plane) diff --git a/tests/test_graphical_units/test_transform.py b/tests/test_graphical_units/test_transform.py index b2a34af5c2..3d9a4cbe96 100644 --- a/tests/test_graphical_units/test_transform.py +++ b/tests/test_graphical_units/test_transform.py @@ -159,7 +159,7 @@ def test_AnimationBuilder(scene): @frames_comparison(last_frame=False) def test_ReplacementTransform(scene): - yellow = Square(fill_opacity=1.0, fill_color=YELLOW) + yellow = Square(fill_opacity=1.0, fill_color=PURE_YELLOW) yellow.move_to([0, 0.75, 0]) green = Square(fill_opacity=1.0, fill_color=GREEN) From 9580ca88e9d75ab1eef0547f816ff447357722c4 Mon Sep 17 00:00:00 2001 From: Benjamin Hackl Date: Mon, 16 Feb 2026 17:49:29 +0100 Subject: [PATCH 3/4] chore: format + check --- manim/mobject/geometry/shape_matchers.py | 2 +- manim/mobject/graphing/coordinate_systems.py | 2 +- manim/mobject/mobject.py | 2 +- manim/mobject/opengl/opengl_point_cloud_mobject.py | 2 +- manim/mobject/table.py | 10 ++++++++-- manim/mobject/types/point_cloud_mobject.py | 2 +- manim/scene/vector_space_scene.py | 2 +- tests/opengl/test_coordinate_system_opengl.py | 2 +- tests/test_graphical_units/test_probability.py | 2 +- 9 files changed, 16 insertions(+), 10 deletions(-) diff --git a/manim/mobject/geometry/shape_matchers.py b/manim/mobject/geometry/shape_matchers.py index 738cdb34f8..6c4d68a34f 100644 --- a/manim/mobject/geometry/shape_matchers.py +++ b/manim/mobject/geometry/shape_matchers.py @@ -20,7 +20,7 @@ from manim.mobject.mobject import Mobject from manim.mobject.opengl.opengl_mobject import OpenGLMobject from manim.mobject.types.vectorized_mobject import VGroup -from manim.utils.color import BLACK, RED, PURE_YELLOW, ManimColor, ParsableManimColor +from manim.utils.color import BLACK, PURE_YELLOW, RED, ManimColor, ParsableManimColor class SurroundingRectangle(RoundedRectangle): diff --git a/manim/mobject/graphing/coordinate_systems.py b/manim/mobject/graphing/coordinate_systems.py index 47dd656284..5a1b1d3519 100644 --- a/manim/mobject/graphing/coordinate_systems.py +++ b/manim/mobject/graphing/coordinate_systems.py @@ -42,8 +42,8 @@ BLUE, BLUE_D, GREEN, - WHITE, PURE_YELLOW, + WHITE, ManimColor, ParsableManimColor, color_gradient, diff --git a/manim/mobject/mobject.py b/manim/mobject/mobject.py index 83841cfcee..2188624042 100644 --- a/manim/mobject/mobject.py +++ b/manim/mobject/mobject.py @@ -28,8 +28,8 @@ from ..constants import * from ..utils.color import ( BLACK, - WHITE, PURE_YELLOW, + WHITE, ManimColor, ParsableManimColor, color_gradient, diff --git a/manim/mobject/opengl/opengl_point_cloud_mobject.py b/manim/mobject/opengl/opengl_point_cloud_mobject.py index 785ae36367..03e07b547a 100644 --- a/manim/mobject/opengl/opengl_point_cloud_mobject.py +++ b/manim/mobject/opengl/opengl_point_cloud_mobject.py @@ -12,8 +12,8 @@ from manim.utils.bezier import interpolate from manim.utils.color import ( BLACK, - WHITE, PURE_YELLOW, + WHITE, ParsableManimColor, color_gradient, color_to_rgba, diff --git a/manim/mobject/table.py b/manim/mobject/table.py index d0a40a32fc..4f93f0a7cd 100644 --- a/manim/mobject/table.py +++ b/manim/mobject/table.py @@ -811,7 +811,10 @@ def construct(self): return rec def get_highlighted_cell( - self, pos: Sequence[int] = (1, 1), color: ParsableManimColor = PURE_YELLOW, **kwargs + self, + pos: Sequence[int] = (1, 1), + color: ParsableManimColor = PURE_YELLOW, + **kwargs, ) -> BackgroundRectangle: """Returns a :class:`~.BackgroundRectangle` of the cell at the given position. @@ -847,7 +850,10 @@ def construct(self): return bg_cell def add_highlighted_cell( - self, pos: Sequence[int] = (1, 1), color: ParsableManimColor = PURE_YELLOW, **kwargs + self, + pos: Sequence[int] = (1, 1), + color: ParsableManimColor = PURE_YELLOW, + **kwargs, ) -> Table: """Highlights one cell at a specific position on the table by adding a :class:`~.BackgroundRectangle`. diff --git a/manim/mobject/types/point_cloud_mobject.py b/manim/mobject/types/point_cloud_mobject.py index 0e31dc3239..a58e5d870b 100644 --- a/manim/mobject/types/point_cloud_mobject.py +++ b/manim/mobject/types/point_cloud_mobject.py @@ -17,8 +17,8 @@ from ...utils.bezier import interpolate from ...utils.color import ( BLACK, - WHITE, PURE_YELLOW, + WHITE, ManimColor, ParsableManimColor, color_gradient, diff --git a/manim/scene/vector_space_scene.py b/manim/scene/vector_space_scene.py index e41d211c53..ecb688ac2f 100644 --- a/manim/scene/vector_space_scene.py +++ b/manim/scene/vector_space_scene.py @@ -35,9 +35,9 @@ BLUE_D, GREEN_C, GREY, + PURE_YELLOW, RED_C, WHITE, - PURE_YELLOW, ManimColor, ParsableManimColor, ) diff --git a/tests/opengl/test_coordinate_system_opengl.py b/tests/opengl/test_coordinate_system_opengl.py index 84ed40a3cb..30807f83ca 100644 --- a/tests/opengl/test_coordinate_system_opengl.py +++ b/tests/opengl/test_coordinate_system_opengl.py @@ -20,7 +20,7 @@ tempconfig, ) from manim import CoordinateSystem as CS -from manim.utils.color import BLUE, GREEN, ORANGE, RED, PURE_YELLOW +from manim.utils.color import BLUE, GREEN, ORANGE, PURE_YELLOW, RED from manim.utils.testing.frames_comparison import frames_comparison __module_test__ = "coordinate_system_opengl" diff --git a/tests/test_graphical_units/test_probability.py b/tests/test_graphical_units/test_probability.py index c7762bd0fc..a8e68e1d6f 100644 --- a/tests/test_graphical_units/test_probability.py +++ b/tests/test_graphical_units/test_probability.py @@ -1,7 +1,7 @@ from manim.constants import LEFT from manim.mobject.graphing.probability import BarChart from manim.mobject.text.tex_mobject import MathTex -from manim.utils.color import BLUE, GREEN, RED, WHITE, PURE_YELLOW +from manim.utils.color import BLUE, GREEN, PURE_YELLOW, RED, WHITE from manim.utils.testing.frames_comparison import frames_comparison __module_test__ = "probability" From be06d82165578e41d2bf9857a6df51ddd409f4f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Francisco=20Manr=C3=ADquez=20Novoa?= Date: Mon, 16 Feb 2026 14:23:11 -0300 Subject: [PATCH 4/4] Modify RandomColorGenerator.next() doctest whose output changed by adding colors --- manim/utils/color/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manim/utils/color/core.py b/manim/utils/color/core.py index ad38829840..88eaca23b4 100644 --- a/manim/utils/color/core.py +++ b/manim/utils/color/core.py @@ -1520,7 +1520,7 @@ class RandomColorGenerator: >>> rnd = RandomColorGenerator(42) >>> rnd.next() - ManimColor('#ECE7E2') + ManimColor('#8B4513') >>> rnd.next() ManimColor('#BBBBBB') >>> rnd.next() @@ -1530,7 +1530,7 @@ class RandomColorGenerator: >>> rnd2 = RandomColorGenerator(42) >>> rnd2.next() - ManimColor('#ECE7E2') + ManimColor('#8B4513') >>> rnd2.next() ManimColor('#BBBBBB') >>> rnd2.next()