Skip to content

Conversation

@maxded
Copy link
Contributor

@maxded maxded commented Jul 30, 2024

Hey! I'm trying to achieve stacked plot lines and came across Line::fill, which does exactly what I want. The only problem with drawing the fill area is that a user doesn't have control over the alpha channel. As a result, having multiple fill areas within a single plot causes the colors to blend, which is undesired in my case. See the images below:

Current:

image

Desired:

image

This change adds Line::fill_alpha, which allows a user to explicitly set the alpha channel used for drawing the fill area. The default value for fill_alpha remains the same as before, causing this PR to not be a breaking change.

@emilk emilk merged commit e96f4e1 into emilk:main Sep 30, 2024
michalsustr pushed a commit that referenced this pull request Nov 26, 2025
Hey! I'm trying to achieve stacked plot lines and came across
[Line::fill](https://docs.rs/egui_plot/latest/egui_plot/struct.Line.html#method.fill),
which does exactly what I want. The only problem with drawing the fill
area is that a user doesn't have control over the alpha channel. As a
result, having multiple fill areas within a single plot causes the
colors to blend, which is undesired in my case. See the images below:

Current:


![image](https://github.com/user-attachments/assets/d6ece302-662f-44f7-854b-876a40b4b285)

Desired: 


![image](https://github.com/user-attachments/assets/146bdc6d-ca2f-4f0c-b89a-33eb34dd0af1)

This change adds `Line::fill_alpha`, which allows a user to explicitly
set the alpha channel used for drawing the fill area. The default value
for `fill_alpha` remains the same as before, causing this PR to not be a
breaking change.
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

Successfully merging this pull request may close these issues.

4 participants