Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Undo deprecation of color parameter #972

Closed
xinoxapps opened this issue Aug 4, 2023 · 2 comments
Closed

Undo deprecation of color parameter #972

xinoxapps opened this issue Aug 4, 2023 · 2 comments

Comments

@xinoxapps
Copy link

Can the color parameter be recovered to its full glory?

          SvgPicture.asset(
            titleIcon,
            colorFilter: const ColorFilter.mode(Colors.green, BlendMode.srcIn),
            width: 18,
            height: 18,
          ),

vs

          SvgPicture.asset(
            titleIcon,
            color: Colors.green,
            width: 18,
            height: 18,
          ),

👍

@dnfield
Copy link
Owner

dnfield commented Aug 4, 2023

Duplicate of #856

@dnfield dnfield marked this as a duplicate of #856 Aug 4, 2023
@dnfield dnfield closed this as completed Aug 4, 2023
@dnfield
Copy link
Owner

dnfield commented Aug 4, 2023

The TL;DR for that issue:

  • The parameter is deprecated but not going anywhere anytime soon.
  • It's deprecated because it's confusing and potentially very expensive to use.
  • Anyone can trivially write a method to create the right kind of color filter if you commonly use srcIn blending.
  • I'd like users to think about whether they want a colorMapper or colorFilter. In almost all cases you should prefer a colorMapper where that will work.

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

No branches or pull requests

2 participants