private DoubleColor PixelToColor(System.Drawing.Color pixel) { var result = new DoubleColor(); result.DrawColor = pixel; result.GdkColor = new Gdk.Color(pixel.R, pixel.G, pixel.B); return(result); }
private double FindDistance(DoubleColor color) { var r = color.DrawColor.R; var rAdjusted = 255 - r; var g = color.DrawColor.G; var b = color.DrawColor.B; var rAdjustedSquared = rAdjusted * rAdjusted; var gSquared = g * g; var bSquared = b * b; var raw = rAdjustedSquared + gSquared + bSquared; return(Math.Sqrt(raw)); }