Show / Hide Table of Contents

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
object
AbstractBindable
AbstractDecoratable<IGradientDecorator>
AbstractGradient
LinearGradient
Implements
IBindable
IGradient
IDecoratable<IGradientDecorator>
IDecoratable
INotifyPropertyChanged
Inherited Members
AbstractDecoratable<IGradientDecorator>.Decorators
AbstractDecoratable<IGradientDecorator>.AddDecorator(IGradientDecorator)
AbstractDecoratable<IGradientDecorator>.RemoveDecorator(IGradientDecorator)
AbstractDecoratable<IGradientDecorator>.RemoveAllDecorators()
AbstractBindable.PropertyChanged
AbstractBindable.RequiresUpdate<T>(ref T, T)
AbstractBindable.SetProperty<T>(ref T, T, string)
AbstractBindable.OnPropertyChanged(string)
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
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 Source

AbstractGradient()

Initializes a new instance of the AbstractGradient class.

Declaration
protected AbstractGradient()
| Edit this page View Source

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.

| Edit this page View Source

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 Source

GradientStops

Gets a list of the stops used by this AbstractGradient.

Declaration
public ObservableCollection<GradientStop> GradientStops { get; }
Property Value
Type Description
ObservableCollection<GradientStop>
| Edit this page View Source

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 Source

ClipOffset(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.

| Edit this page View Source

GetColor(float)

Gets the Color of the IGradient on the specified offset.

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.

| Edit this page View Source

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.

| Edit this page View Source

OnGradientChanged()

Should be called to indicate that the gradient was changed.

Declaration
protected void OnGradientChanged()

Events

| Edit this page View Source

GradientChanged

Occurs if the IGradient is changed.

Declaration
public event EventHandler? GradientChanged
Event Type
Type Description
EventHandler

Implements

IBindable
IGradient
IDecoratable<T>
IDecoratable
INotifyPropertyChanged
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX