colors — Claude Code rule: coloring formulas and 3D scenes
colors is a Claude Code rule covering ManimGL palettes, gradients, and GLSL shading for coloring mathematical animations.
AGPL-3.0 ★ 78,316 updated 2026-10-24
.claude/rules/colors.mdWhat colors does
This rule equips agents with syntax and patterns for color handling in ManimGL (manimlib). It covers primary palette constants, gradient shade variations marked from A to E, interpolation utilities, and converters for RGB and Hex strings.
It guides the model through coloring specific characters inside Text and Tex objects, running animated transitions with animate.set_color, and applying gradients across submobjects. For 3D meshes, it specifies GLSL snippets using set_color_by_code alongside gloss and shadow settings.
Scripts using this rule fail immediately without ManimGL: the API calls target Grant Sanderson's manimlib codebase, which differs from Manim Community Edition.
What it helps with
- apply consistent ManimGL color constants and tonal scales across scenes
- colorize distinct math symbols within Tex objects using substring matching
- render procedural colors on 3D surfaces with GLSL shader snippets
- manage stroke opacity, fills, gloss, and shadows on vector groups
Example prompts for the agent
- Color individual variables in this Tex equation using ManimGL t2c mapping
- Create a smooth color gradient across a VGroup of squares
- Apply viridis shading to a Sphere using set_color_by_xyz_func in ManimGL
How to install colors
Manually: put the files in place
.claude/rules/colors.mdThe paths frontmatter field limits the files
AGENTS.md
Codex reads AGENTS.md: paste the rule text there
Manually: put the files in place
.cursor/rules/colors.mdcFrontmatter: description, globs, alwaysApply
Manually: put the files in place
.github/instructions/colors.instructions.mdThe applyTo field sets which files it applies to
Manually: put the files in place
.devin/rules/colors.mdManually: put the files in place
.clinerules/colors.mdStep by step, with commands for each platform: AGENTS.md vs CLAUDE.md: what they are and which one to use
Questions about colors
How to install colors in Claude Code?
Add the rule file directly to your project path at .claude/rules/colors.md.
What does the colors rule do?
It instructs code generation models on how to handle palettes, gradients, and GLSL shaders in ManimGL animation scripts.
Does this rule work with Manim Community Edition?
It targets manimlib features such as GLSL shading hooks and specific color utility paths, so direct compatibility with Manim Community is not guaranteed.