New to Telerik UI for .NET MAUIStart a free 30-day trial

A markup extension that is used to color-blend.

Definition

Namespace:Telerik.Maui.Controls.Theming

Assembly:Telerik.Maui.Controls.dll

Syntax:

C#
public class ColorFilterExtension : IMarkupExtension

Inheritance: objectColorFilterExtension

Implements: IMarkupExtension

Constructors

C#
public ColorFilterExtension()

Properties

When set, will be used as Alpha in the newly generated color, and will override the base Color's Alpha.

C#
public float? Alpha { get; set; }

Color

Color

The base color.

C#
public Color Color { get; set; }

Expected to be in range [-1, 1]. For [-1, 0] will darken the Color, where -1 will result in black, -0.5 will be a dark version and 0 will preserve the Color. For [0, 1] will lighten the Color, where 1 will result in white, 0.5 will be a light version and 0 will preserve the Color.

Does not affect the Color's Alpha.

C#
public float Lighten { get; set; }

Alpha blends the original Color with the TintColor one. The Red, Green, and Blue are linearly interpolated between the Color and the TintColor based on the TintColor's Alpha, the Alpha of the result preserves the Alpha of the original Color.

Useful to tint gradient shades.

C#
public Color TintColor { get; set; }

Methods

Provides the filtered color value based on the configured properties.

C#
public object ProvideValue(IServiceProvider serviceProvider = null)
Parameters:serviceProviderIServiceProvider

The service provider.

Returns:

object

The filtered color.