Context
Discovered during Course Builder Manim scene development. Passing a hex color string as the second positional argument to Text() causes a deep Manim stack trace.
Problem
This code:
Text("Some label", C_BLUE, font_size=14)
Produces:
ValueError: could not convert string to float: '#2979ff'
The traceback points deep into vectorized_mobject.py → generate_rgbas_array → to_rgba_with_alpha, which is extremely confusing. The actual issue is that Text()'s second positional parameter is NOT color — it's something else in Manim's API.
The correct syntax is:
Text("Some label", font_size=14, color=C_BLUE)
Impact
This is easy to write by accident, especially when copying patterns from other Manim objects where color IS a positional arg. The error message gives no indication that the problem is a positional vs keyword argument issue.
Recommendations for docgen auto-scene generation
Severity
Low — easy fix once you know the cause, but the error message is deeply misleading and wastes debugging time.
Context
Discovered during Course Builder Manim scene development. Passing a hex color string as the second positional argument to
Text()causes a deep Manim stack trace.Problem
This code:
Produces:
The traceback points deep into
vectorized_mobject.py→generate_rgbas_array→to_rgba_with_alpha, which is extremely confusing. The actual issue is thatText()'s second positional parameter is NOTcolor— it's something else in Manim's API.The correct syntax is:
Impact
This is easy to write by accident, especially when copying patterns from other Manim objects where color IS a positional arg. The error message gives no indication that the problem is a positional vs keyword argument issue.
Recommendations for docgen auto-scene generation
Text():Text("...", font_size=N, color=C)docgen validatethat flagsText(string_literal, "#hex")patternsText()in a helper function in the_TimedScenebase class that enforces keyword-only colorSeverity
Low — easy fix once you know the cause, but the error message is deeply misleading and wastes debugging time.