question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Proposal] IconTintColor Effect

See original GitHub issue

IconTintColorEffect

  • 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:closed
  • Created 2 years ago
  • Reactions:7
  • Comments:17 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
pictoscommented, Jun 1, 2022

@HausBJB yes, will be available on all platforms possible. That is to track what I’ve done so far.

1reaction
HausBJBcommented, Jun 14, 2022

Ok, thanks again for the great work

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found