public static void UpdateTextColor(this AppCompatButton button, XColor color, ColorStateList?defaultColor) { if (color.IsDefault) { button.SetTextColor(defaultColor); } else { button.SetTextColor(color.ToNative()); } }
public static void SetColorFilter(this ADrawable drawable, Color color, AColorFilter defaultColorFilter, FilterMode mode) { if (drawable == null) { return; } if (color == Color.Default) { SetColorFilter(drawable, defaultColorFilter); return; } drawable.SetColorFilter(color.ToAndroid(), mode); }
public static Task <UIImage> AssertContainsColor(this UIView view, Microsoft.Maui.Color expectedColor) => AssertContainsColor(view, expectedColor.ToNative());
public static void SetColorFilter(this ADrawable drawable, Color color, FilterMode mode) { drawable.SetColorFilter(color.ToAndroid(), mode); }
static XColor Cleanse(this XColor color, XColor defaultColor) => color.IsDefault ? defaultColor : color;
public static void UpdateTextColor(this AppCompatButton appCompatButton, IButton button, XColor defaultColor) => appCompatButton.SetTextColor(button.TextColor.Cleanse(defaultColor).ToNative());