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

How to fill with gradient in shader mode? #1295

Open
BenEcon opened this issue Dec 22, 2020 · 1 comment
Open

How to fill with gradient in shader mode? #1295

BenEcon opened this issue Dec 22, 2020 · 1 comment

Comments

@BenEcon
Copy link

BenEcon commented Dec 22, 2020

How to fill circle for example with gradient in shader mode? I tried set_color_by_gradient, it results in having different colors for different submobjects.

For example:

class Gradient(Scene):
    def construct(self):
        circle_1 = Circle().move_to(2*RIGHT)
        circle_2 = Circle().move_to(2*LEFT)
        circles = VGroup(circle_1,circle_2)
        self.add(circles.set_color_by_gradient(PINK, YELLOW))
        self.wait()

The results is:

Gradient.mp4

What I want is something like this:

568-5686766_gradient-circle-circle-hd-png-download

All suggestions are highly appreciated. Thank you.

@BenEcon BenEcon changed the title How to fill with gradient How to fill with gradient in shader mode? Dec 22, 2020
eulertour pushed a commit to eulertour/manim-3b1b that referenced this issue Apr 21, 2021
A hyphen is required in a compound

Socioeconomic is a single word

"Sexual language and imagery in online communities or in any conference venue, including talks" -  There is a redundant "in"

"Did this incident occur in a private conversation or ina public space? Incidents that all community members can see will have a more negative impact." - Redundant "in" again

Harassment is misspelled as harrasment

Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
@ReneTC
Copy link

ReneTC commented Nov 22, 2023

Why do you post an example with two circles, when the desired outcome is a single circle?
Anyways, try

from manim import *

class Gradient(Scene):
    def construct(self):
       gradient_circle = Circle(fill_opacity=1).set_color([ORANGE, RED])
       self.add(gradient_circle)

output
image

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

2 participants