ColorRampShade Struct
Stores information about a shade in a color ramp.
public struct ColorRampShade : IComparable<ColorRampShade>, IEquatable<ColorRampShade>
- Implements:
- IComparable<ColorRampShade> IEquatable<ColorRampShade>
Constructors
ColorRampShade(int, UIColor)
Initializes an instance of the class.
public ColorRampShade(int shadeNumber, UIColor color)
Parameter | Type | Description |
---|---|---|
shadeNumber | int | The shade's number ( |
color | UIColor | The shade's color value. |
Properties
Color
The shade's color value.
IsInterpolated
Whether the shade is interpolated, meaning it has been programmatically derived by an algorithm.
public readonly bool IsInterpolated { get; }
Property Value
- bool:
true
if the shade is interpolated; otherwise,false
.
Number
The shade's number (0
..1000
) within its parent color ramp.
public readonly int Number { get; }
Property Value
- int:
The shade's number (
0
..1000
) within its parent color ramp.
Methods
ClampShadeNumber(int)
Clamps a shade number to be within the 0
..1000
range.
public static int ClampShadeNumber(int shadeNumber)
Parameter | Type | Description |
---|---|---|
shadeNumber | int | The shade number to coerce. |
Returns
- int:
The clamped shade number.
CompareTo(ColorRampShade)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public readonly int CompareTo(ColorRampShade other)
Parameter | Type | Description |
---|---|---|
other | ColorRampShade | An object to compare with this instance. |
Returns
- int:
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
Equals(ColorRampShade)
Indicates whether the current object is equal to another object of the same type.
public readonly bool Equals(ColorRampShade other)
Parameter | Type | Description |
---|---|---|
other | ColorRampShade | An object to compare with this object. |
Returns
- bool:
true
if the current object is equal to theother
parameter; otherwise,false
.
Equals(object)
Determines whether the specified object is equal to the current object.
public override readonly bool Equals(object obj)
Parameter | Type | Description |
---|---|---|
obj | object | The object to compare with the current object. |
Returns
- bool:
true
if the specified object is equal to the current object; otherwise,false
.
GetHashCode()
Serves as the default hash function.
ToString()
Returns the string representation of this object.
public override readonly string ToString()
Returns
- string:
The string representation of this object.
Operators
operator ==(ColorRampShade, ColorRampShade)
Compares two objects for equality
public static bool operator ==(ColorRampShade left, ColorRampShade right)
Parameter | Type | Description |
---|---|---|
left | ColorRampShade | The first object to compare. |
right | ColorRampShade | The second object to compare. |
Returns
- bool:
true
if the two objects are equal; otherwise,false
.
operator >(ColorRampShade, ColorRampShade)
Tests whether one object is greater than another.
public static bool operator >(ColorRampShade left, ColorRampShade right)
Parameter | Type | Description |
---|---|---|
left | ColorRampShade | The first object to compare. |
right | ColorRampShade | The second object to compare. |
Returns
- bool:
true
if the first object is greater than the second; otherwise,false
.
operator >=(ColorRampShade, ColorRampShade)
Tests whether one object is greater than or equal to another.
public static bool operator >=(ColorRampShade left, ColorRampShade right)
Parameter | Type | Description |
---|---|---|
left | ColorRampShade | The first object to compare. |
right | ColorRampShade | The second object to compare. |
Returns
- bool:
true
if the first object is greater than or equal to the second; otherwise,false
.
operator !=(ColorRampShade, ColorRampShade)
Compares two object for inequality
public static bool operator !=(ColorRampShade left, ColorRampShade right)
Parameter | Type | Description |
---|---|---|
left | ColorRampShade | The first object to compare. |
right | ColorRampShade | The second object to compare. |
Returns
- bool:
true
if the two objects are not equal; otherwise,false
.
operator <(ColorRampShade, ColorRampShade)
Tests whether one object is less than another.
public static bool operator <(ColorRampShade left, ColorRampShade right)
Parameter | Type | Description |
---|---|---|
left | ColorRampShade | The first object to compare. |
right | ColorRampShade | The second object to compare. |
Returns
- bool:
true
if the first object is less than the second; otherwise,false
.
operator <=(ColorRampShade, ColorRampShade)
Tests whether one object is less than or equal to another.
public static bool operator <=(ColorRampShade left, ColorRampShade right)
Parameter | Type | Description |
---|---|---|
left | ColorRampShade | The first object to compare. |
right | ColorRampShade | The second object to compare. |
Returns
- bool:
true
if the first object is less than or equal to the second; otherwise,false
.