Class AbstractGradient
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
Inheritance
Inherited Members
Namespace: RGB.NET.Presets.Textures.Gradients
Assembly: RGB.NET.Presets.dll
Syntax
public abstract class AbstractGradient : AbstractDecoratable<IGradientDecorator>, IBindable, IGradient, IDecoratable<IGradientDecorator>, IDecoratable, INotifyPropertyChanged
Constructors
| Edit this page View SourceAbstractGradient()
Initializes a new instance of the AbstractGradient class.
Declaration
protected AbstractGradient()
AbstractGradient(params GradientStop[])
Initializes a new instance of the AbstractGradient class.
Declaration
protected AbstractGradient(params GradientStop[] gradientStops)
Parameters
Type | Name | Description |
---|---|---|
GradientStop[] | gradientStops | The stops with which the gradient should be initialized. |
AbstractGradient(bool, params GradientStop[])
Initializes a new instance of the AbstractGradient class.
Declaration
protected AbstractGradient(bool wrapGradient, params GradientStop[] gradientStops)
Parameters
Type | Name | Description |
---|---|---|
bool | wrapGradient | Specifies whether the gradient should wrapp or not (see WrapGradient for an example of what this means). |
GradientStop[] | gradientStops | The stops with which the gradient should be initialized. |
Properties
| Edit this page View SourceGradientStops
Gets a list of the stops used by this AbstractGradient.
Declaration
public ObservableCollection<GradientStop> GradientStops { get; }
Property Value
Type | Description |
---|---|
ObservableCollection<GradientStop> |
WrapGradient
Gets or sets if the Gradient wraps around if there isn't a second stop to take. Example: There is a stop at offset 0.0, 0.5 and 0.75. Without wrapping offset 1.0 will be calculated the same as 0.75; with wrapping it would be the same as 0.0.
Declaration
public bool WrapGradient { get; set; }
Property Value
Type | Description |
---|---|
bool |
Methods
| Edit this page View SourceClipOffset(float)
Clips the offset and ensures, that it is inside the bounds of the stop list.
Declaration
protected float ClipOffset(float offset)
Parameters
Type | Name | Description |
---|---|---|
float | offset | The offset to clip. |
Returns
Type | Description |
---|---|
float | The clipped offset. |
GetColor(float)
Declaration
public abstract Color GetColor(float offset)
Parameters
Type | Name | Description |
---|---|---|
float | offset | The percentage offset to take the Color from. |
Returns
Type | Description |
---|---|
Color | The Color at the specific offset. |
Move(float)
Moves the IGradient by the provided offset.
Declaration
public virtual void Move(float offset)
Parameters
Type | Name | Description |
---|---|---|
float | offset | The offset the IGradient should be moved. |
OnGradientChanged()
Should be called to indicate that the gradient was changed.
Declaration
protected void OnGradientChanged()
Events
| Edit this page View SourceGradientChanged
Occurs if the IGradient is changed.
Declaration
public event EventHandler? GradientChanged
Event Type
Type | Description |
---|---|
EventHandler |