diff options
| author | jpbruyere <jp.bruyere@hotmail.com> | 2016-03-21 07:39:28 +0100 |
|---|---|---|
| committer | jpbruyere <jp.bruyere@hotmail.com> | 2016-04-14 12:44:46 +0200 |
| commit | 0490aefbd71436f575187602355cfcda48a92063 (patch) | |
| tree | 63e31069e1aa3faf9cbca41ada94b7efbef1a7fa /src/Colors.cs | |
| parent | 45fb721a432caec62068994ee9a56a4b843bcc03 (diff) | |
code clean
Diffstat (limited to 'src/Colors.cs')
| -rw-r--r-- | src/Colors.cs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Colors.cs b/src/Colors.cs index 4cb8cd5c..269d7ae6 100644 --- a/src/Colors.cs +++ b/src/Colors.cs @@ -1028,6 +1028,25 @@ namespace Crow } #endregion + public override int GetHashCode () + { + unchecked // Overflow is fine, just wrap + { + int hash = 17; + // Suitable nullity checks etc, of course :) + hash = hash * 23 + A.GetHashCode(); + hash = hash * 23 + R.GetHashCode(); + hash = hash * 23 + G.GetHashCode(); + hash = hash * 23 + B.GetHashCode(); + return hash; + } + } + public override bool Equals (object obj) + { + return (obj == null || obj.GetType() != typeof(Color)) ? + false : + this == (Color)obj; + } public override string ToString() { if (!string.IsNullOrEmpty(Name)) |