3b1b / 3b1b/manim

Keep it concise but clear. Example: "set_color_by_gradient not working as expected in ManimGL"

Open
#2,228 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
93.8k
Forks
7.7k
PR merge metrics
PR metrics pending

Description

### Describe the bug
When I use the `set_color_by_gradient` function in ManimGL, the object does not get the expected gradient coloring. Instead, it either shows a single color or doesn't change color at all.

### To Reproduce
Steps to reproduce the behavior:
1. Create a `Text` or `VMobject`.
2. Apply `set_color_by_gradient` with two or more colors.
3. Run the scene and observe the output.

**Code**:
```python
from manim_imports_ext import *

class Factorial(InteractiveScene):
def construct(self):
self.embed()
# Introduction
definition = Tex(
R"\mathbb{R} \text{ecursive}\ \mathbb{D} \text{efinition of } \mathbb{F} \text{actorial}")
definition.set_width(FRAME_WIDTH - 1)
definition.set_color_by_gradient(BLUE_C, YELLOW)
definition.move_to([0, 2.1, 0])
self.add(definition)

### Environment
1. ManimGL Version: v1.7.0
2. Python Version: 3.12.3
3. OS: Ubuntu on Termux (Android)
![VideoCapture_20241023-143559](https://github.com/user-attachments/assets/4c858a6d-14d2-4594-b557-1e2e4e2a7ff0)
@3b1b

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.