public override int GetHashCode()
 {
     //Optional override. Only here for completeness with required Equals() override.
     //Really only required for hash tables and dictionaries.
     unchecked
     {
         int hash = 13;
         hash = (hash * 7) + Color1.GetHashCode();
         hash = (hash * 7) + this.Style == GradientStyle.Solid ? 0 : Color2.GetHashCode();
         hash = (hash * 7) + Style.GetHashCode();
         hash = (hash * 7) + this.Style == GradientStyle.Solid ? 0 : GammaCorrection.GetHashCode();
         return(hash);
     }
 }