using System.Drawing;
using System.Drawing.Drawing2D;
#pragma warning disable CS1591 // 缺少对公共可见类型或成员的 XML 注释
namespace WeifenLuo.WinFormsUI.Docking {
    public static class DrawingRoutines {
        public static void SafelyDrawLinearGradient(Rectangle rectangle, Color startColor, Color endColor,
            LinearGradientMode mode, Graphics graphics)
        {
            if (rectangle.Width > 0 && rectangle.Height > 0)
            {
                using (LinearGradientBrush brush = new LinearGradientBrush(rectangle, startColor, endColor, mode))
                {
                    graphics.FillRectangle(brush, rectangle);
                }
            }
        }
    }
}
