HypernovaDesktop Components · docs
Binarymission
WPFShaders Library › HueRotateEffect

HueRotateEffect

class.NET 6 / 8 / 10.NET Framework 4.8Binarymission.WPF.Shaders.Library.CustomEffects

A pixel shader effect that turns every colour in its input around the colour wheel while leaving its brightness where it was.

public class HueRotateEffect : ShaderEffect

Inherits from / implements: ShaderEffect

Remarks

The rotation is the constant-luminance matrix SVG's feColorMatrix uses for hueRotate, so a light pixel stays light. Animating Angle through 2*PI sweeps the picture through the spectrum and returns it exactly to where it started - which is why the default is a third of a turn rather than none: an effect that does nothing until it is configured looks broken.

Members at a glance

HueRotateEffectInitializes a new instance of the HueRotateEffect class.
AngleHow far the colours are turned, in radians. 2*PI is a full turn back to the original.
InputThe image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.
AnglePropertyIdentifies the Angle dependency property.
InputPropertyIdentifies the Input dependency property.

Constructors

HueRotateEffect

public HueRotateEffect()

Initializes a new instance of the HueRotateEffect class.

Properties

Angle

public double Angle

How far the colours are turned, in radians. 2*PI is a full turn back to the original.

Input

public Brush Input

The image this effect is applied to. It is set for you when the effect is attached to an element; set it directly only when using the effect as a brush.

Fields

AngleProperty

public static readonly DependencyProperty AngleProperty

Identifies the Angle dependency property.

InputProperty

public static readonly DependencyProperty InputProperty

Identifies the Input dependency property.