Browse Source

Remove NamedColors<T> usages

pull/910/head
Anton Firszov 7 years ago
parent
commit
51e23eb7d8
  1. 4
      src/ImageSharp.Drawing/Processing/GradientBrushBase.cs
  2. 4
      tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs

4
src/ImageSharp.Drawing/Processing/GradientBrushBase.cs

@ -49,6 +49,8 @@ namespace SixLabors.ImageSharp.Processing
internal abstract class GradientBrushApplicatorBase<TPixel> : BrushApplicator<TPixel>
where TPixel : struct, IPixel<TPixel>
{
private static readonly TPixel Transparent = Color.Transparent.ToPixel<TPixel>();
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<TPixel>.Transparent;
return Transparent;
}
break;

4
tests/ImageSharp.Tests/TestUtilities/Attributes/WithSolidFilledImagesAttribute.cs

@ -99,7 +99,7 @@ namespace SixLabors.ImageSharp.Tests
/// </summary>
/// <param name="width">The width of the requested image</param>
/// <param name="height">The height of the requested image</param>
/// <param name="colorName">The referenced color name (name of property in <see cref="NamedColors{TPixel}")/></param>
/// <param name="colorName">The referenced color name (name of property in <see cref="Color"/>).</param>
/// <param name="pixelTypes">The requested pixel types</param>
/// <param name="additionalParameters">Additional theory parameter values</param>
public WithSolidFilledImagesAttribute(
@ -119,7 +119,7 @@ namespace SixLabors.ImageSharp.Tests
/// <param name="memberData">The member data to apply to theories</param>
/// <param name="width">The width of the requested image</param>
/// <param name="height">The height of the requested image</param>
/// <param name="colorName">The referenced color name (name of property in <see cref="NamedColors{TPixel}")/></param>
/// <param name="colorName">The referenced color name (name of property in <see cref="Color"/>).</param>
/// <param name="pixelTypes">The requested pixel types</param>
/// <param name="additionalParameters">Additional theory parameter values</param>
public WithSolidFilledImagesAttribute(

Loading…
Cancel
Save