Class ColorBase
- Namespace
- ImageMagick
- Assembly
- Magick.NET-Q16-AnyCPU.dll
Base class for colors.
public abstract class ColorBase : IEquatable<ColorBase?>, IComparable<ColorBase?>
- Inheritance
-
ColorBase
- Implements
- Derived
- Inherited Members
Constructors
ColorBase(IMagickColor<ushort>)
Initializes a new instance of the ColorBase class.
protected ColorBase(IMagickColor<ushort> color)
Parameters
color
IMagickColor<ushort>The color to use.
Properties
Color
Gets the actual color of this instance.
protected IMagickColor<ushort> Color { get; }
Property Value
- IMagickColor<ushort>
Methods
CompareTo(ColorBase?)
Compares the current instance with another object of the same type.
public int CompareTo(ColorBase? other)
Parameters
other
ColorBaseThe object to compare this color with.
Returns
- int
A signed number indicating the relative values of this instance and value.
Equals(ColorBase?)
Determines whether the specified color is equal to the current color.
public bool Equals(ColorBase? other)
Parameters
other
ColorBaseThe color to compare this color with.
Returns
- bool
True when the specified color is equal to the current instance.
Equals(object?)
Determines whether the specified object is equal to the current instance.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare this color with.
Returns
- bool
True when the specified object is equal to the current instance.
FuzzyEquals(ColorBase?, Percentage?)
Determines whether the specified color is fuzzy equal to the current color.
public bool FuzzyEquals(ColorBase? other, Percentage? fuzz)
Parameters
other
ColorBaseThe color to compare this color with.
fuzz
PercentageThe fuzz factor.
Returns
- bool
True when the specified color is fuzzy equal to the current instance.
GetHashCode()
Serves as a hash of this type.
public override int GetHashCode()
Returns
- int
A hash code for the current instance.
ToMagickColor()
Converts the value of this instance to an equivalent ImageMagick.IMagickColor<>.
public IMagickColor<ushort> ToMagickColor()
Returns
- IMagickColor<ushort>
A ImageMagick.IMagickColor<> instance.
ToString()
Converts the value of this instance to a hexadecimal string.
public override string ToString()
Returns
UpdateColor()
Updates the color value from an inherited class.
protected virtual void UpdateColor()
Operators
operator ==(ColorBase?, ColorBase?)
Determines whether the specified ColorBase instances are considered equal.
public static bool operator ==(ColorBase? left, ColorBase? right)
Parameters
Returns
operator >(ColorBase?, ColorBase?)
public static bool operator >(ColorBase? left, ColorBase? right)
Parameters
Returns
operator >=(ColorBase?, ColorBase?)
public static bool operator >=(ColorBase? left, ColorBase? right)
Parameters
Returns
operator !=(ColorBase?, ColorBase?)
Determines whether the specified ColorBase instances are not considered equal.
public static bool operator !=(ColorBase? left, ColorBase? right)
Parameters
Returns
operator <(ColorBase?, ColorBase?)
public static bool operator <(ColorBase? left, ColorBase? right)
Parameters
Returns
operator <=(ColorBase?, ColorBase?)
public static bool operator <=(ColorBase? left, ColorBase? right)