ManimCommunity / ManimCommunity/manim

Default fill_opacity to 1 when fill_color is set

Open
#1,682 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement needs discussion
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Enhancement proposal

Currently fill_opacity for `VMobject` defaults to 0 which makes sense, but it doesn't make sense for it to remain 0 when the user sets the fill, as fill then doesn't really have any effect:

```py
class Example(Scene):
def construct(self):
rect = Rectangle(fill_color=GREEN)
self.add(rect)
```

![image](https://user-images.githubusercontent.com/32387857/121805810-b3b8b080-cc44-11eb-9a5e-1e98af3de653.png)

I propose that when fill is set opacity should then default to 1 as in the absence of fill_opacity passed by the user it is most likely what they would expect to happen.

## Additional comments

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how VMobject handles fill_color and fill_opacity during construction, using the Rectangle example in the issue as the expected entry point. The change is done when setting fill_color without an explicit fill_opacity produces a visible fill with opacity 1, while an explicitly supplied opacity remains respected.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.