System.Drawing.PieChart.EdgeColor.GetContrastColorType C# (CSharp) Method

GetContrastColorType() private static method

private static GetContrastColorType ( System.Color color, EdgeColorType colorType ) : EdgeColorType
color System.Color
colorType EdgeColorType
return EdgeColorType
        private static EdgeColorType GetContrastColorType(Color color, EdgeColorType colorType)
        {
            Debug.Assert(colorType == EdgeColorType.Contrast || colorType == EdgeColorType.EnhancedContrast);
            if (color.GetBrightness() > s_brightnessThreshold) {
                if (colorType == EdgeColorType.Contrast)
                    return EdgeColorType.DarkerThanSurface;
                else
                    return EdgeColorType.DarkerDarkerThanSurface;
            }
            if (colorType == EdgeColorType.Contrast)
                return EdgeColorType.LighterThanSurface;
            else
                return EdgeColorType.LighterLighterThanSurface;
        }