GradientStop Struct
Represents a single gradient stop in a gradient fill.
public readonly struct GradientStop : IEquatable<GradientStop>Public Structure GradientStop
Implements IEquatable(Of GradientStop)Implements
Constructors
GradientStop(Double, Color)
Initializes a new instance of the GradientStop class with the specified position and color.
public GradientStop(double position, Color color)Public Sub New(position As Double, color As Color)Parameters
position- System.Double
The position in the gradient where the gradient stop is placed. Value must be between 0 and 1.
color- Color
The color value of the gradient stop.
Properties
Color
Specifies the color of the gradient.
Property Value
The color of the gradient.
Position
Specifies where this gradient stop should appear in the color band. This position is expressed as a percentage from 0 to 1.
Property Value
- System.Double
The position of the gradient stop.
Methods
Equals(GradientStop)
Determines whether the other GradientStop is equal to this GradientStop instance.
public readonly bool Equals(GradientStop other)Public Function Equals(other As GradientStop) As BooleanParameters
other- GradientStop
The other gradient stop to compare with this gradient stop instance.
Returns
- System.Boolean
true if the other GradientStop is equal to this GradientStop instance; otherwise, false.
Equals(Object)
Determines whether the specified System.Object is equal to this GradientStop instance.
public override readonly bool Equals(object obj)Public Overrides Function Equals(obj As Object) As BooleanParameters
obj- System.Object
The System.Object to compare with this gradient stop instance.
Returns
- System.Boolean
true if the specified System.Object is a GradientStop and is equal to this GradientStop instance; otherwise, false.
Overrides
GetHashCode()
Returns a hash code for this GradientStop instance.
Returns
- System.Int32
An integer value that specifies a hash value for this GradientStop instance.
Overrides
ToString()
Returns a System.String that represents this GradientStop instance.
Returns
- System.String
A System.String that represents this GradientStop instance.
Overrides
Remarks
This method should be used primarily for debugging purposes and should be considered volatile (format of its return value might change in future versions).
Operators
Equality(GradientStop, GradientStop)
Determines whether first and second GradientStops are equal.
public static bool operator ==(GradientStop first, GradientStop second)Public Shared Operator =(first As GradientStop, second As GradientStop) As BooleanParameters
first- GradientStop
The first gradient stop.
second- GradientStop
The second gradient stop.
Returns
- System.Boolean
true if first and second gradient stops are equal; otherwise, false.
Inequality(GradientStop, GradientStop)
Determines whether first and second GradientStops are not equal.
public static bool operator !=(GradientStop first, GradientStop second)Public Shared Operator <>(first As GradientStop, second As GradientStop) As BooleanParameters
first- GradientStop
The first gradient stop.
second- GradientStop
The second gradient stop.
Returns
- System.Boolean
true if first and second gradient stops are not equal; otherwise, false.