System.Drawing.PieChart.PieSlice.CreateSurfaceBrushes C# (CSharp) Method

CreateSurfaceBrushes() protected method

Creates brushes used to render the pie slice.
protected CreateSurfaceBrushes ( Color surfaceColor, ShadowStyle shadowStyle ) : void
surfaceColor Color /// Color used for rendering. ///
shadowStyle ShadowStyle /// Shadow style used for rendering. ///
return void
        protected virtual void CreateSurfaceBrushes(Color surfaceColor, ShadowStyle shadowStyle)
        {
            DisposeBrushes();
            m_brushSurface = new SolidBrush(surfaceColor);
            m_brushSurfaceHighlighted = new SolidBrush(ColorUtil.CreateColorWithCorrectedLightness(surfaceColor, ColorUtil.BrightnessEnhancementFactor1));
            switch (shadowStyle) {
            case ShadowStyle.NoShadow:
                m_brushStartSide = m_brushEndSide = m_brushPeripherySurface = new SolidBrush(surfaceColor);
                break;
            case ShadowStyle.UniformShadow:
                m_brushStartSide = m_brushEndSide = m_brushPeripherySurface = new SolidBrush(ColorUtil.CreateColorWithCorrectedLightness(surfaceColor, -ColorUtil.BrightnessEnhancementFactor1));
                break;
            case ShadowStyle.GradualShadow:
                double angle = m_startAngle - 180 - s_shadowAngle;
                if (angle < 0)
                    angle += 360;
                m_brushStartSide = CreateBrushForSide(surfaceColor, angle);
                angle = m_startAngle + m_sweepAngle - s_shadowAngle;
                if (angle < 0)
                    angle += 360;
                m_brushEndSide = CreateBrushForSide(surfaceColor, angle);
                m_brushPeripherySurface = CreateBrushForPeriphery(surfaceColor);
                break;
            }
        }