GradientStop Struct
A color at a position of a gradient.
public readonly struct GradientStop : IEquatable<GradientStop>- Implements
Constructors
| Name | Description |
|---|---|
| GradientStop(double, Rgba64) | Initializes a new instance of the GradientStop struct. |
GradientStop(double, Rgba64)
GradientStop.csInitializes a new instance of the GradientStop struct.
Parameters
offsetdouble- The position along the gradient, from 0 (its start) to 1 (its end).
colorRgba64- The color, with straight alpha. An
Rgba32converts implicitly.
Exceptions
ArgumentOutOfRangeExceptionoffsetis not between 0 and 1.
Properties
| Name | Description |
|---|---|
| Color | Gets the color, with straight alpha. |
| Offset | Gets the position along the gradient, from 0 (its start) to 1 (its end). |
Color
GradientStop.csOffset
GradientStop.csMethods
| Name | Description |
|---|---|
| Equals(GradientStop) | Indicates whether the current object is equal to another object of the same type. |
| Equals(object?) | Indicates whether this instance and a specified object are equal. |
| GetHashCode() | Returns the hash code for this instance. |
| ToString() | Returns the stop formatted as {Offset}: {Color}. |
Equals overloads
Equals(GradientStop)
GradientStop.csIndicates whether the current object is equal to another object of the same type.
public bool Equals(GradientStop other)Parameters
otherGradientStop- An object to compare with this object.
Returns
bool true if the current object is equal to the other parameter; otherwise, false.
Equals(object?)
GradientStop.csGetHashCode()
GradientStop.csToString()
GradientStop.csOperators
| Name | Description |
|---|---|
| operator ==(GradientStop, GradientStop) | Compares two stops for equality. |
| operator !=(GradientStop, GradientStop) | Compares two stops for inequality. |
operator ==(GradientStop, GradientStop)
GradientStop.csCompares two stops for equality.
public static bool operator ==(GradientStop left, GradientStop right)Parameters
leftGradientStop- The first stop.
rightGradientStop- The second stop.
Returns
bool true if both stops are equal; otherwise false.
operator !=(GradientStop, GradientStop)
GradientStop.csCompares two stops for inequality.
public static bool operator !=(GradientStop left, GradientStop right)Parameters
leftGradientStop- The first stop.
rightGradientStop- The second stop.
Returns
bool true if the stops differ; otherwise false.