Exemple #1
0
        public ColorF Transform(ColorTransformerContext context, ColorF color)
        {
            float brightness = color.GetBrightness();

            if (brightness > (1f - _threshold))
            {
                return(ColorF.FromRgb(1f, 1f, 1f));
            }

            if (brightness < _threshold)
            {
                return(ColorF.FromRgb(0f, 0f, 0f));
            }

            return(color);
        }