49 public static uint
Maximum {
get; } = 100;
66 $
"The given opacity {value} is out of range. The opacity value has to be within the range of {Minimum} and {Maximum}.");
77 public static IEqualityComparer<Opacity>
Comparer {
get; } =
new OpacityEqualityComparer();
88 return Value.ToString();
91 private sealed class OpacityEqualityComparer : IEqualityComparer<Opacity>
95 if (ReferenceEquals(x, y))
100 if (ReferenceEquals(x,
null))
105 if (ReferenceEquals(y,
null))
110 return x._value.Equals(y._value);
113 public int GetHashCode(
Opacity obj)
115 return obj._value.GetHashCode();
Occurs when a provided value falls outside the allowed valid range.
Holds an opacity value representing the transparency level of an object or pixel.
Opacity(uint value)
Constructs an Opacity object with the specified value.
Opacity()
Constructs an Opacity object with full opacity (100).
static IEqualityComparer< Opacity > Comparer
A default equality comparer for comparing Opacity data values.
override string ToString()
Returns a string that represents the current opacity value.
uint Value
The opacity value. Must be between 0 and 100.
static uint Minimum
The minimum allowed opacity value.
static uint Maximum
The maximum allowed opacity value.