@@ -1083,6 +1083,57 @@ static public implicit operator Microsoft.Maui.Graphics.Color(Color Color)
10831083 return Microsoft . Maui . Graphics . Color . FromRgba ( Color . R , Color . G , Color . B , Color . A ) ;
10841084 }
10851085
1086+ /// <summary>
1087+ /// Tests whether two specified <see cref="Color"/> structures are equivalent.
1088+ /// </summary>
1089+ /// <param name="left">The <see cref="Color"/> that is to the left of the equality operator.</param>
1090+ /// <param name="right">The <see cref="Color"/> that is to the right of the equality operator.</param>
1091+ /// <returns>true if the two <see cref="Color"/> structures are equal; otherwise, false.</returns>
1092+ public static bool operator == ( Color left , Color right )
1093+ {
1094+ return left . R == right . R &&
1095+ left . G == right . G &&
1096+ left . B == right . B &&
1097+ left . A == right . A ;
1098+ }
1099+
1100+ /// <summary>
1101+ /// Tests whether two specified <see cref="Color"/> structures are different.
1102+ /// </summary>
1103+ /// <param name="left">The <see cref="Color"/> that is to the left of the inequality operator.</param>
1104+ /// <param name="right">The <see cref="Color"/> that is to the right of the inequality operator.</param>
1105+ /// <returns>true if the two <see cref="Color"/> structures are different; otherwise, false.</returns>
1106+ public static bool operator != ( Color left , Color right )
1107+ {
1108+ return left . R != right . R ||
1109+ left . G != right . G ||
1110+ left . B != right . B ||
1111+ left . A != right . A ;
1112+ }
1113+
1114+ /// <summary>
1115+ /// Indicates whether the current object is equal to another object of the same type.
1116+ /// </summary>
1117+ /// <param name="other">An object to compare with this object.</param>
1118+ /// <returns>true if the current object is equal to other; otherwise, false.</returns>
1119+ public override bool Equals ( object other )
1120+ {
1121+ if ( other == null )
1122+ {
1123+ return false ;
1124+ }
1125+
1126+ if ( ! ( other is Color ) )
1127+ {
1128+ return false ;
1129+ }
1130+
1131+ return this . R == ( ( Color ) other ) . R &&
1132+ this . G == ( ( Color ) other ) . G &&
1133+ this . B == ( ( Color ) other ) . B &&
1134+ this . A == ( ( Color ) other ) . A ;
1135+ }
1136+
10861137 #region Private Method
10871138
10881139 private static InvalidOperationException NoConverterException ( string color , Exception innerException )
0 commit comments