mirror of
https://github.com/3b1b/manim.git
synced 2025-08-05 16:49:03 +00:00
There's some (as of yet unresolved) bug associated with fill colors when they become negative during an animation
This commit is contained in:
parent
24d6c7bbef
commit
fae819695a
1 changed files with 8 additions and 2 deletions
10
camera.py
10
camera.py
|
@ -141,15 +141,21 @@ class Camera(object):
|
||||||
|
|
||||||
def get_pen_and_fill(self, vmobject):
|
def get_pen_and_fill(self, vmobject):
|
||||||
pen = aggdraw.Pen(
|
pen = aggdraw.Pen(
|
||||||
self.get_stroke_color(vmobject).get_hex_l(),
|
self.color_to_hex_l(self.get_stroke_color(vmobject)),
|
||||||
max(vmobject.stroke_width, 0)
|
max(vmobject.stroke_width, 0)
|
||||||
)
|
)
|
||||||
fill = aggdraw.Brush(
|
fill = aggdraw.Brush(
|
||||||
self.get_fill_color(vmobject).get_hex_l(),
|
self.color_to_hex_l(self.get_fill_color(vmobject)),
|
||||||
opacity = int(255*vmobject.get_fill_opacity())
|
opacity = int(255*vmobject.get_fill_opacity())
|
||||||
)
|
)
|
||||||
return (pen, fill)
|
return (pen, fill)
|
||||||
|
|
||||||
|
def color_to_hex_l(self, color):
|
||||||
|
try:
|
||||||
|
return color.get_hex_l()
|
||||||
|
except:
|
||||||
|
return Color(BLACK).get_hex_l()
|
||||||
|
|
||||||
def get_stroke_color(self, vmobject):
|
def get_stroke_color(self, vmobject):
|
||||||
return vmobject.get_stroke_color()
|
return vmobject.get_stroke_color()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue