예제 #1
0
        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);
        }
예제 #2
0
        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));
        }