[Proposal] IconTintColor Effect
See original GitHub issueIconTintColorEffect
- Proposed
- Prototype: (It’s the same as XCT)
- Implementation:
- iOS Support
- Android Support
- macOS Support
- Windows Support
- Unit Tests
- Sample
- Documentation
Summary
An Effect
to set the tint color of an ImageButton or an Image.
Detailed Design
IconTintColorEffect.shared.cs
public class IconTintColorEffect
{
public static readonly BindableProperty TintColorProperty;
public static Color GetTintColor(BindableObject view);
public static void SetTintColor(BindableObject view, Color value);
}
Usage Syntax
XAML Usage
<ImageButton
Source="https://image.flaticon.com/icons/png/512/48/48639.png"
xct:IconTintColorEffect.TintColor="Red"
Grid.Row="2"
Grid.Column="1" />
C# Usage
var button = new ImageButton
{
Source="https://image.flaticon.com/icons/png/512/48/48639.png"
};
button.Effects.Add(new IconTintColorEffect());
IconTintColorEffect.SetTintColor(button, Colors.Red);
Issue Analytics
- State:
- Created 2 years ago
- Reactions:7
- Comments:17 (7 by maintainers)
Top Results From Across the Web
[Enhancement] Implement IconTintColorEffect for Image ...
With this effect you could tint an Image or ImageButton without needing to add your icon in multiple colors to your project.
Read more >Adaptive icons
Different shapes; User theming; Visual effects; Design adaptive icons ... the coloring of the user's chosen wallpaper and theme to determine the tint...
Read more >Image Tinting (Xamarin Community Toolkit) - YouTube
Getting all your image resources in the right color can be a big pain. Between iOS and Android alone you will have to...
Read more >Changing TintColor of IconTintColorBehavior at runtime ...
Hello I'm testing the new IconTintColorBehavior in CommunityToolkit.Maui 1.1.0. It works find, but only when starting the application. If I ...
Read more >Question - Inherit image tint color
I'd like to assign an icon-image's tint color from the color property. To do this, I assign it in the callback of the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@HausBJB yes, will be available on all platforms possible. That is to track what I’ve done so far.
Ok, thanks again for the great work