SharpMap.Rendering.Thematics.GradientTheme.CalculateLabelStyle C# (CSharp) Method

CalculateLabelStyle() private method

private CalculateLabelStyle ( SharpMap min, SharpMap max, double value ) : LabelStyle
min SharpMap
max SharpMap
value double
return SharpMap.Styles.LabelStyle
        private LabelStyle CalculateLabelStyle(SharpMap.Styles.LabelStyle min, SharpMap.Styles.LabelStyle max, double value)
        {
            LabelStyle style = new LabelStyle();
            style.CollisionDetection = min.CollisionDetection;
            style.Enabled = InterpolateBool(min.Enabled, max.Enabled,value);
            float FontSize = InterpolateFloat(min.Font.Size,max.Font.Size,value);
            style.Font = new System.Drawing.Font(min.Font.FontFamily,FontSize,min.Font.Style);
            if (min.BackColor != null && max.BackColor != null)
                style.BackColor = InterpolateBrush(min.BackColor, max.BackColor, value);

            if (_TextColorBlend != null)
                style.ForeColor = _LineColorBlend.GetColor(Convert.ToSingle(Fraction(value)));
            else
                style.ForeColor = InterpolateColor(min.ForeColor, max.ForeColor, value);
            if (min.Halo != null && max.Halo != null)
                style.Halo = InterpolatePen(min.Halo,max.Halo, value);

            style.MinVisible = InterpolateDouble(min.MinVisible,max.MinVisible,value);
            style.MaxVisible = InterpolateDouble(min.MaxVisible, max.MaxVisible, value);
            style.Offset = new System.Drawing.PointF(InterpolateFloat(min.Offset.X, max.Offset.X, value), InterpolateFloat(min.Offset.Y, max.Offset.Y, value));
            return style;
        }