diff --git a/src/ImageSharp.Drawing/Processing/GradientBrushBase.cs b/src/ImageSharp.Drawing/Processing/GradientBrushBase.cs index 6e1e0086d..39dbcb61a 100644 --- a/src/ImageSharp.Drawing/Processing/GradientBrushBase.cs +++ b/src/ImageSharp.Drawing/Processing/GradientBrushBase.cs @@ -49,6 +49,8 @@ namespace SixLabors.ImageSharp.Processing internal abstract class GradientBrushApplicatorBase : BrushApplicator where TPixel : struct, IPixel { + private static readonly TPixel Transparent = Color.Transparent.ToPixel(); + private readonly ColorStop[] colorStops; private readonly GradientRepetitionMode repetitionMode; @@ -103,7 +105,7 @@ namespace SixLabors.ImageSharp.Processing case GradientRepetitionMode.DontFill: if (positionOnCompleteGradient > 1 || positionOnCompleteGradient < 0) { - return NamedColors.Transparent; + return Transparent; } break; diff --git a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs index f95db45f7..190e80fba 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs @@ -99,7 +99,7 @@ namespace SixLabors.ImageSharp.Tests /// /// The width of the requested image /// The height of the requested image - /// The referenced color name (name of property in + /// The referenced color name (name of property in ). /// The requested pixel types /// Additional theory parameter values public WithSolidFilledImagesAttribute( @@ -119,7 +119,7 @@ namespace SixLabors.ImageSharp.Tests /// The member data to apply to theories /// The width of the requested image /// The height of the requested image - /// The referenced color name (name of property in + /// The referenced color name (name of property in ). /// The requested pixel types /// Additional theory parameter values public WithSolidFilledImagesAttribute(