In This Article

ColorInterpolationExtension Class

Provides a markup extension for finding the linear System.Windows.Media.Color value that is the specified percentage between the value of two System.Windows.Media.Color objects.

public class ColorInterpolationExtension : MarkupExtension
Inheritance:
System.Object MarkupExtension Object

Constructors

ColorInterpolationExtension()

Creates an instance of the ColorInterpolationExtension class.

public ColorInterpolationExtension()

ColorInterpolationExtension(Color, Color, Double)

Creates an instance of the ColorInterpolationExtension class.

public ColorInterpolationExtension(Color color1, Color color2, double percentage)
Parameter Type Description
color1 System.Windows.Media.Color

The first System.Windows.Media.Color.

color2 System.Windows.Media.Color

The second System.Windows.Media.Color.

percentage System.Double

The percentage from the first color towards the second.

Properties

Color1

Gets or sets the first System.Windows.Media.Color.

[ConstructorArgument("color1")]
public Color Color1 { get; set; }

Property Value

System.Windows.Media.Color:

The first System.Windows.Media.Color.

Color2

Gets or sets the second System.Windows.Media.Color.

[ConstructorArgument("color2")]
public Color Color2 { get; set; }

Property Value

System.Windows.Media.Color:

The second System.Windows.Media.Color.

Percentage

Gets or sets the percentage from the first color towards the second.

[ConstructorArgument("percentage")]
public double Percentage { get; set; }

Property Value

System.Double:

The percentage from the first color towards the second.

Methods

ProvideValue(IServiceProvider)

Returns the interpolated color value.

public override object ProvideValue(IServiceProvider serviceProvider)
Parameter Type Description
serviceProvider System.IServiceProvider

An object that can provide services for the markup extension.

Returns

System.Object:

The object value to set on the property where the extension is applied.

Inherited Members

  • System.Object.ToString()
  • System.Object.Equals(System.Object)
  • System.Object.Equals(System.Object, System.Object)
  • System.Object.ReferenceEquals(System.Object, System.Object)
  • System.Object.GetHashCode()
  • System.Object.GetType()
  • System.Object.MemberwiseClone()