Drawable.SetColorFilter Method

Definition

Overloads

SetColorFilter(ColorFilter)

Specify an optional color filter for the drawable.

SetColorFilter(Color, PorterDuff+Mode)

Specify a color and Porter-Duff mode to be the color filter for this drawable.

SetColorFilter(ColorFilter)

Specify an optional color filter for the drawable.

[Android.Runtime.Register("setColorFilter", "(Landroid/graphics/ColorFilter;)V", "GetSetColorFilter_Landroid_graphics_ColorFilter_Handler")]
public abstract void SetColorFilter (Android.Graphics.ColorFilter? colorFilter);
[<Android.Runtime.Register("setColorFilter", "(Landroid/graphics/ColorFilter;)V", "GetSetColorFilter_Landroid_graphics_ColorFilter_Handler")>]
abstract member SetColorFilter : Android.Graphics.ColorFilter -> unit

Parameters

colorFilter
ColorFilter

The color filter to apply, or null to remove the existing color filter

Attributes

Remarks

Specify an optional color filter for the drawable.

If a Drawable has a ColorFilter, each output pixel of the Drawable's drawing contents will be modified by the color filter before it is blended onto the render target of a Canvas.

Pass null to remove any existing color filter.

<p class="note"><strong>Note:</strong> Setting a non-null color filter disables #setTintList(ColorStateList) tint. </p>

Java documentation for android.graphics.drawable.Drawable.setColorFilter(android.graphics.ColorFilter).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

SetColorFilter(Color, PorterDuff+Mode)

Specify a color and Porter-Duff mode to be the color filter for this drawable.

[Android.Runtime.Register("setColorFilter", "(ILandroid/graphics/PorterDuff$Mode;)V", "GetSetColorFilter_ILandroid_graphics_PorterDuff_Mode_Handler")]
public virtual void SetColorFilter (Android.Graphics.Color color, Android.Graphics.PorterDuff.Mode mode);
[<Android.Runtime.Register("setColorFilter", "(ILandroid/graphics/PorterDuff$Mode;)V", "GetSetColorFilter_ILandroid_graphics_PorterDuff_Mode_Handler")>]
abstract member SetColorFilter : Android.Graphics.Color * Android.Graphics.PorterDuff.Mode -> unit
override this.SetColorFilter : Android.Graphics.Color * Android.Graphics.PorterDuff.Mode -> unit

Parameters

color
Color
Attributes

Remarks

Java documentation for android.graphics.drawable.Drawable.setColorFilter(int, android.graphics.Mode).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to