Exemple #1
0
            public override ColorBgra Apply(ColorBgra color)
            {
                byte value = (byte)(Math.Abs(color.GetHue() - FilterColor.GetHue()) * 255 / 360);

                if (Grayscale)
                {
                    if (!Invert)
                    {
                        value = (byte)(255 - value);
                    }
                    return(ColorBgra.FromBgr(value, value, value));
                }
                return(value < Tolerance ? TransparentColor : OpaqueColor);
            }