Skip to content

Fade Class

Fades both the background and foreground to separate colors.

C#
[DataContract]
public class Fade : CellEffectBase, ICellEffect

Inheritance objectCellEffectBase

Implements ICellEffect

Creates a new instance of the effect.

C#
public Fade()

A value used in lerping the fade.

C#
protected double _calculatedValue

Indicates the fade is currently in reverse.

C#
protected bool _goingDown

Gets or sets the color gradient used to fade for the cell background.

C#
[DataMember]
public Gradient DestinationBackground { get; set; }

Gets or sets the color gradient used to fade for the cell background.

C#
[DataMember]
public Gradient DestinationForeground { get; set; }

Gets or sets how long the fade takes to complete in seconds.

C#
[DataMember]
public TimeSpan FadeDuration { get; set; }

Gets or sets a value to indicate that the fade effect should repeat.

C#
[DataMember]
public bool Repeat { get; set; }

Gets or sets a value to indicate that the color gradient used with the DestinationForeground should replace its first color stop with the cell’s foreground color.

C#
[DataMember]
public bool UseCellForeground { get; set; }

Gets or sets a value to indicate that the color gradient used with the DestinationBackground should replace its first color stop with the cell’s background color.

C#
[DataMember]
public bool UseCellBackground { get; set; }

Gets or sets a value to indicate that the fade effect should use the foreground color on the cell’s foreground.

C#
[DataMember]
public bool FadeForeground { get; set; }

Gets or sets a value to indicate that the fade effect should use the background color on the cell’s background.

C#
[DataMember]
public bool FadeBackground { get; set; }

Gets or sets a value to indicate that the fade effect should automatically reverse itself when it finishes going up the color spectrum. By setting this to true, and setting the Repeat property to true, you can create a pulse effect.

C#
[DataMember]
public bool AutoReverse { get; set; }

When UseCellForeground or UseCellBackground is set, and this is true, the last color in the fade will be set to the cell instead of the first.

C#
[DataMember]
public bool UseCellDestinationReverse { get; set; }

ApplyToCell(ColoredGlyphBase, ColoredGlyphBase)

Section titled “ApplyToCell(ColoredGlyphBase, ColoredGlyphBase)”

Applies the state of the effect to a cell.

C#
public override bool ApplyToCell(ColoredGlyphBase cell, ColoredGlyphBase originalState)

cell ColoredGlyphBase
The surface cell using this effect.

originalState ColoredGlyphBase
The state of the cell prior to the effect being applied.

bool
true when this method modified the cell; otherwise false.

Updates the state of the effect.

C#
public override void Update(TimeSpan delta)

delta TimeSpan
Time since the last call to this effect.

Restarts the cell effect.

C#
public override void Restart()

Returns a duplicate of this effect.

C#
public override ICellEffect Clone()

ICellEffect
A new copy of this effect.

C#
public override string ToString()

string