Show / Hide Table of Contents

Struct GradientStop

A gradient stop. Defines a color and where it is located within the gradient.

Implements
IEquatable<GradientStop>
IMatchable<GradientStop>
Inherited Members
ValueType.ToString()
object.GetType()
object.Equals(object, object)
object.ReferenceEquals(object, object)
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
[DataContract]
public readonly struct GradientStop : IEquatable<GradientStop>, IMatchable<GradientStop>

Constructors

View Source

GradientStop(Color, float)

Creates a new gradient stop.

Declaration
public GradientStop(Color color, float stop)
Parameters
Type Name Description
Color color

The color to use.

float stop

The position of the stop.

Fields

View Source

Color

The color.

Declaration
[DataMember]
public readonly Color Color
Field Value
Type Description
Color
View Source

Stop

The color stop in the gradient this applies to.

Declaration
[DataMember]
public readonly float Stop
Field Value
Type Description
float

Methods

View Source

Equals(GradientStop)

Compares this gradient stop to the one given.

Declaration
public bool Equals(GradientStop g)
Parameters
Type Name Description
GradientStop g
Returns
Type Description
bool

True if this gradient stop and the specified one have the same color and stop values; false otherwise.

View Source

Equals(object?)

Returns true if obj is a gradient stop with the same color and stop value.

Declaration
public override bool Equals(object? obj)
Parameters
Type Name Description
object obj
Returns
Type Description
bool

True if obj is a gradient stop with the same color and stop value.

Overrides
ValueType.Equals(object)
View Source

GetHashCode()

Gets a hash code based upon the stop's color and stop values.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code based upon the stop's color and stop values.

Overrides
ValueType.GetHashCode()
View Source

Matches(GradientStop)

Compares this gradient stop to the one given.

Declaration
public bool Matches(GradientStop other)
Parameters
Type Name Description
GradientStop other
Returns
Type Description
bool

True if this gradient stop and the specified one have the same color and stop values; false otherwise.

Operators

View Source

operator ==(GradientStop, GradientStop)

Compares two gradient stops based on their color and stop value.

Declaration
public static bool operator ==(GradientStop lhs, GradientStop rhs)
Parameters
Type Name Description
GradientStop lhs
GradientStop rhs
Returns
Type Description
bool

True if the gradients have the same color and stop; false otherwise.

View Source

operator !=(GradientStop, GradientStop)

Compares two gradient stops based on their color and stop value.

Declaration
public static bool operator !=(GradientStop lhs, GradientStop rhs)
Parameters
Type Name Description
GradientStop lhs
GradientStop rhs
Returns
Type Description
bool

True if the gradients have different color or stop values, false otherwise.

Implements

IEquatable<T>
IMatchable<T>

Extension Methods

PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?)
PropertyChangedEventHelpers.SafelySetProperty<TObject, TProperty>(TObject, ref TProperty, TProperty, EventHandler<ValueChangedEventArgs<TProperty>>?, EventHandler<ValueChangedEventArgs<TProperty>>?)
  • View Source
In this article
Back to top Generated by DocFX