// Copyright (c) Six Labors. // Licensed under the Six Labors Split License. namespace SixLabors.ImageSharp.Drawing.Processing { /// /// Contains a collection of common pen styles. /// public static class Pens { private static readonly float[] DashDotPattern = [3f, 1f, 1f, 1f]; private static readonly float[] DashDotDotPattern = [3f, 1f, 1f, 1f, 1f, 1f]; private static readonly float[] DottedPattern = [1f, 1f]; private static readonly float[] DashedPattern = [3f, 1f]; internal static readonly float[] EmptyPattern = []; /// /// Create a solid pen without any drawing patterns /// /// The color. /// The . public static SolidPen Solid(Color color) => new(color); /// /// Create a solid pen without any drawing patterns /// /// The brush. /// The . public static SolidPen Solid(Brush brush) => new(brush); /// /// Create a solid pen without any drawing patterns /// /// The color. /// The width. /// The . public static SolidPen Solid(Color color, float width) => new(color, width); /// /// Create a solid pen without any drawing patterns /// /// The brush. /// The width. /// The . public static SolidPen Solid(Brush brush, float width) => new(brush, width); /// /// Create a pen with a 'Dash' drawing patterns /// /// The color. /// The width. /// The . public static PatternPen Dash(Color color, float width) => new(color, width, DashedPattern); /// /// Create a pen with a 'Dash' drawing patterns /// /// The brush. /// The width. /// The . public static PatternPen Dash(Brush brush, float width) => new(brush, width, DashedPattern); /// /// Create a pen with a 'Dot' drawing patterns /// /// The color. /// The width. /// The . public static PatternPen Dot(Color color, float width) => new(color, width, DottedPattern); /// /// Create a pen with a 'Dot' drawing patterns /// /// The brush. /// The width. /// The . public static PatternPen Dot(Brush brush, float width) => new(brush, width, DottedPattern); /// /// Create a pen with a 'Dash Dot' drawing patterns /// /// The color. /// The width. /// The . public static PatternPen DashDot(Color color, float width) => new(color, width, DashDotPattern); /// /// Create a pen with a 'Dash Dot' drawing patterns /// /// The brush. /// The width. /// The . public static PatternPen DashDot(Brush brush, float width) => new(brush, width, DashDotPattern); /// /// Create a pen with a 'Dash Dot Dot' drawing patterns /// /// The color. /// The width. /// The . public static PatternPen DashDotDot(Color color, float width) => new(color, width, DashDotDotPattern); /// /// Create a pen with a 'Dash Dot Dot' drawing patterns /// /// The brush. /// The width. /// The . public static PatternPen DashDotDot(Brush brush, float width) => new(brush, width, DashDotDotPattern); } }