3b1b / 3b1b/manim

I don't understand why I can't do gradient fill on a square in manimgl-1.7.1 version

未關閉
#2,296 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視
主要語言
Python
星號
93.9k
分支
7.7k
平均合併
2 天 13 小時
30 天內合併 PR
4

描述

### Describe the error
I want to implement gradient filling inside the square in manimgl, but using set_color_by_gradient cannot achieve the effect I want.

### Code
```
from manimlib import*
sin=np.sin
cos=np.cos
My_color=[BLUE_E,WHITE]
class MainScene(Scene):
def construct(self) -> None:
tex=Tex(r"a^2+b^2=c^2",font_size=200).to_edge(UP)
sq=Square(fill_opacity=1)

tex.set_color_by_gradient(*My_color)
sq.set_color_by_gradient(*My_color)

self.add(tex,sq)
```
### Output
Screenshot 2025-01-07 230218

### Wish get help

### Environment
**OS System**: Window11
**manim version**: manimgl v1.7.2 But when I run the version number in the terminal, it shows 1.7.1
**python version**:python v3.12.8

貢獻指南

這個儲存庫沒有索引到貢獻指南

研究方向

查看 manimlib/mobject/geometry.py 中的 Square 類別和 set_color_by_gradient 方法。Issue 顯示,漸層填色對文字有效,但對正方形無效。首先檢查填色如何套用於形狀以及文字。執行提供的程式碼以重現此問題,然後檢查形狀填色的渲染管線。

由索引模型根據 Issue 內容生成。

評估

領域
computer-graphics
Issue 類型
缺陷
難度
3/5
預估耗時
1-2 天
活躍度
停滯
描述清晰度
基本清楚
新手友好度
55/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。