diff --git a/Brushes/RadialGradientBrush.cs b/Brushes/RadialGradientBrush.cs index 0f614d8..d3b20b7 100644 --- a/Brushes/RadialGradientBrush.cs +++ b/Brushes/RadialGradientBrush.cs @@ -67,6 +67,8 @@ namespace CUE.NET.Brushes /// The color at the specified point. public override Color GetColorAtPoint(RectangleF rectangle, PointF point) { + if(Gradient == null) return Color.Transparent; + PointF centerPoint = new PointF(rectangle.X + rectangle.Width * Center.X, rectangle.Y + rectangle.Height * Center.Y); // Calculate the distance to the farthest point from the center as reference (this has to be a corner)