Example #1
0
 public bool Similar(ARBG anotherColor)
 {
     if (Math.Abs(this.A - anotherColor.A) > 25)
         return false;
     if (Math.Abs(this.R - anotherColor.R) > 25)
         return false;
     if (Math.Abs(this.B - anotherColor.B) > 25)
         return false;
     if (Math.Abs(this.G - anotherColor.G) > 25)
         return false;
     return true;
 }
Example #2
0
 public static ARBG Average(ARBG[] colors)
 {
     int avgA = 0, avgR = 0, avgB = 0, avgG = 0;
     foreach (ARBG color in colors)
     {
         avgA += color.A;
         avgR += color.R;
         avgB += color.B;
         avgG += color.G;
     }
     return new ARBG(avgA/colors.Length, avgR/colors.Length, avgB/colors.Length, avgG/colors.Length);
 }
Example #3
0
 public bool Similar(ARBG anotherColor)
 {
     if (Math.Abs(this.A - anotherColor.A) > 25)
     {
         return(false);
     }
     if (Math.Abs(this.R - anotherColor.R) > 25)
     {
         return(false);
     }
     if (Math.Abs(this.B - anotherColor.B) > 25)
     {
         return(false);
     }
     if (Math.Abs(this.G - anotherColor.G) > 25)
     {
         return(false);
     }
     return(true);
 }
Example #4
0
 double distanceSquared(ARBG anotherColor)
 {
     return(Math.Pow(this.A - anotherColor.A, 2) + Math.Pow(this.R - anotherColor.R, 2) +
            Math.Pow(this.B - anotherColor.B, 2) + Math.Pow(this.G - anotherColor.G, 2));
 }
Example #5
0
 double distanceSquared(ARBG anotherColor)
 {
     return Math.Pow(this.A - anotherColor.A, 2) + Math.Pow(this.R - anotherColor.R, 2) +
             Math.Pow(this.B - anotherColor.B, 2) + Math.Pow(this.G - anotherColor.G, 2);
 }