Class GradientStop
A gradient stop. Defines a color and where it is located within the gradient.
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
public sealed class GradientStop : ValueType, IEquatable<GradientStop>, IMatchable<GradientStop>
Constructors
GradientStop(Color, Single)
Creates a new gradient stop.
Declaration
public GradientStop(Color color, float stop)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to use. |
Single | stop | The position of the stop. |
Fields
Color
The color.
Declaration
public readonly Color Color
Field Value
Type | Description |
---|---|
Color |
Stop
The color stop in the gradient this applies to.
Declaration
public readonly float Stop
Field Value
Type | Description |
---|---|
Single |
Methods
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 |
---|---|
Boolean | True if this gradient stop and the specified one have the same color and stop values; false otherwise. |
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 |
---|---|
Boolean | True if |
GetHashCode()
Gets a hash code based upon the stop's color and stop values.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
Int32 | A hash code based upon the stop's color and stop values. |
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 |
---|---|
Boolean | True if this gradient stop and the specified one have the same color and stop values; false otherwise. |
Operators
Equality(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 |
---|---|
Boolean | True if the gradients have the same color and stop; false otherwise. |
Inequality(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 |
---|---|
Boolean | True if the gradients have different color or stop values, false otherwise. |