Class Fade
Fades both the background and foreground to separate colors.
Implements
Inherited Members
Namespace: SadConsole.Effects
Assembly: SadConsole.dll
Syntax
[DataContract]
public class Fade : CellEffectBase, ICellEffect
Constructors
Fade()
Creates a new instance of the effect.
Declaration
public Fade()
Fields
_calculatedValue
A value used in lerping the fade.
Declaration
protected double _calculatedValue
Field Value
| Type | Description |
|---|---|
| double |
_goingDown
Indicates the fade is currently in reverse.
Declaration
protected bool _goingDown
Field Value
| Type | Description |
|---|---|
| bool |
Properties
AutoReverse
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.
Declaration
[DataMember]
public bool AutoReverse { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
DestinationBackground
Gets or sets the color gradient used to fade for the cell background.
Declaration
[DataMember]
public Gradient DestinationBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| Gradient |
DestinationForeground
Gets or sets the color gradient used to fade for the cell background.
Declaration
[DataMember]
public Gradient DestinationForeground { get; set; }
Property Value
| Type | Description |
|---|---|
| Gradient |
FadeBackground
Gets or sets a value to indicate that the fade effect should use the background color on the cell's background.
Declaration
[DataMember]
public bool FadeBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
FadeDuration
Gets or sets how long the fade takes to complete in seconds.
Declaration
[DataMember]
public TimeSpan FadeDuration { get; set; }
Property Value
| Type | Description |
|---|---|
| TimeSpan |
FadeForeground
Gets or sets a value to indicate that the fade effect should use the foreground color on the cell's foreground.
Declaration
[DataMember]
public bool FadeForeground { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Repeat
Gets or sets a value to indicate that the fade effect should repeat.
Declaration
[DataMember]
public bool Repeat { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
UseCellBackground
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.
Declaration
[DataMember]
public bool UseCellBackground { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
UseCellDestinationReverse
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.
Declaration
[DataMember]
public bool UseCellDestinationReverse { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
UseCellForeground
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.
Declaration
[DataMember]
public bool UseCellForeground { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
ApplyToCell(ColoredGlyphBase, ColoredGlyphBase)
Applies the state of the effect to a cell.
Declaration
public override bool ApplyToCell(ColoredGlyphBase cell, ColoredGlyphBase originalState)
Parameters
| Type | Name | Description |
|---|---|---|
| ColoredGlyphBase | cell | The surface cell using this effect. |
| ColoredGlyphBase | originalState | The state of the cell prior to the effect being applied. |
Returns
| Type | Description |
|---|---|
| bool |
Overrides
Clone()
Returns a duplicate of this effect.
Declaration
public override ICellEffect Clone()
Returns
| Type | Description |
|---|---|
| ICellEffect | A new copy of this effect. |
Overrides
Restart()
Restarts the cell effect.
Declaration
public override void Restart()
Overrides
ToString()
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string |
Overrides
Update(TimeSpan)
Updates the state of the effect.
Declaration
public override void Update(TimeSpan delta)
Parameters
| Type | Name | Description |
|---|---|---|
| TimeSpan | delta | Time since the last call to this effect. |