Skip to content

Conversation

@garvittsingla
Copy link

Fixes #3205
The main problem was in
MultiplyAlpha for Table<Color>, where only the alpha_blending.opacity was changing but not the color opacity as mentioned itself in the issue

I changed the color alpha itself with the function multiplied_alpha under the AlphaMut trait.
My fix is this:

impl MultiplyAlpha for Table<Color> {
	fn multiply_alpha(&mut self, factor: f64) {
		for row in self.iter_mut() {
			row.element.set_alpha(factor as f32);
			row.alpha_blending.opacity *= factor as f32;
		}
	}
}

Faulty behavior

image

Change in opacity node before the fill value does not changes anything. The opacity is always full


Corrected behaviour
image

Now changing the opacity changes the color opacity

@garvittsingla garvittsingla changed the title Fix/multiple alpha for table color Fix/multiply alpha for table color Dec 31, 2025
Copy link
Contributor

@0HyperCube 0HyperCube left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is an approach to fixing the issue.

I'm not sure if it is advantageous to have both the alpha_blending.opacity and the element.opacity?

@garvittsingla
Copy link
Author

garvittsingla commented Dec 31, 2025

This is an approach to fixing the issue.

I'm not sure if it is advantageous to have both the alpha_blending.opacity and the element.opacity?

@0HyperCube It makes sense, I just don't removed the alpha blending opacity, thought to have a review first

Should i remove it?

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.

Opacity node does not work directly on colors

2 participants