Struct GradientStop
A gradient stop. Defines a color and where it is located within the gradient.
Inherited Members
Namespace: SadRogue.Primitives
Assembly: TheSadRogue.Primitives.dll
Syntax
[DataContract]
public readonly struct GradientStop : IEquatable<GradientStop>, IMatchable<GradientStop>
Constructors
View SourceGradientStop(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 SourceColor
The color.
Declaration
[DataMember]
public readonly Color Color
Field Value
| Type | Description |
|---|---|
| Color |
Stop
The color stop in the gradient this applies to.
Declaration
[DataMember]
public readonly float Stop
Field Value
| Type | Description |
|---|---|
| float |
Methods
View SourceEquals(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. |
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 |
Overrides
View SourceGetHashCode()
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
View SourceMatches(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 Sourceoperator ==(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. |
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. |