mirror of
https://github.com/ManimCommunity/manim.git
synced 2026-06-22 10:01:47 +00:00
Fixed affecting colors bug returns copy instead
This commit is contained in:
parent
7a7ed422fc
commit
115bcf968f
2 changed files with 3 additions and 6 deletions
|
|
@ -269,8 +269,7 @@ class OpenGLVMobject(OpenGLMobject):
|
|||
if color is not None:
|
||||
mob.fill_color = listify(ManimColor.parse(color))
|
||||
if opacity is not None:
|
||||
for c in mob.fill_color:
|
||||
c.set_opacity(opacity)
|
||||
mob.fill_color = [c.set_opacity(opacity) for c in mob.fill_color]
|
||||
return self
|
||||
|
||||
def set_stroke(
|
||||
|
|
@ -285,8 +284,7 @@ class OpenGLVMobject(OpenGLMobject):
|
|||
if color is not None:
|
||||
mob.stroke_color = listify(ManimColor.parse(color))
|
||||
if opacity is not None:
|
||||
for c in mob.stroke_color:
|
||||
c.set_opacity(opacity)
|
||||
mob.stroke_color = [c.set_opacity(opacity) for c in mob.stroke_color]
|
||||
|
||||
if width is not None:
|
||||
mob.stroke_width = listify(width)
|
||||
|
|
|
|||
|
|
@ -529,8 +529,7 @@ class ManimColor:
|
|||
"""
|
||||
if opacity < 0 or opacity > 1:
|
||||
raise ValueError(f"Alpha value is not in range 0-1 it is {opacity}")
|
||||
self._internal_value[3] = opacity
|
||||
return self
|
||||
return ManimColor(self._internal_value[:3], opacity)
|
||||
|
||||
@classmethod
|
||||
def from_rgb(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue