Skip to content

Conversation

abarth
Copy link
Contributor

@abarth abarth commented Jul 8, 2016

Putting the opacity in the color is much faster than using an opacity
widget because the opacity widget creates an offscreen buffer.

Fixes #4651

@abarth
Copy link
Contributor Author

abarth commented Jul 8, 2016

@HansMuller @chinmaygarde


Widget result = new Image(
if (iconOpacity != null && iconOpacity != 1.0)
iconColor = iconColor.withOpacity(iconOpacity);
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be iconColor.withOpacity(iconOpacity * iconColor.opacity) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's probably a good idea.

@HansMuller
Copy link
Contributor

LGTM

Putting the opacity in the color is much faster than using an opacity
widget because the opacity widget creates an offscreen buffer.

Fixes flutter#4651
@abarth abarth force-pushed the improve_icon_opacity branch from 0922124 to 9e44ceb Compare July 8, 2016 17:09
@abarth abarth merged commit 56aa920 into flutter:master Jul 8, 2016
@abarth abarth deleted the improve_icon_opacity branch July 8, 2016 20:39
cdotstout pushed a commit to cdotstout/flutter that referenced this pull request Apr 3, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve how ImageIcon does opacity
2 participants