Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gd247217 opened this issue Jan 7, 2025 · 0 comments

Comments

@gd247217
Copy link

gd247217 commented Jan 7, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant