// Copyright (c) Six Labors and contributors. // Licensed under the Apache License, Version 2.0. namespace SixLabors.ImageSharp.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 = new float[0]; /// /// Create a solid pen with out any drawing patterns /// /// The color. /// The width. /// The Pen public static Pen Solid(Color color, float width) => new Pen(color, width); /// /// Create a solid pen with out any drawing patterns /// /// The brush. /// The width. /// The Pen public static Pen Solid(IBrush brush, float width) => new Pen(brush, width); /// /// Create a pen with a 'Dash' drawing patterns /// /// The color. /// The width. /// The Pen public static Pen Dash(Color color, float width) => new Pen(color, width, DashedPattern); /// /// Create a pen with a 'Dash' drawing patterns /// /// The brush. /// The width. /// The Pen public static Pen Dash(IBrush brush, float width) => new Pen(brush, width, DashedPattern); /// /// Create a pen with a 'Dot' drawing patterns /// /// The color. /// The width. /// The Pen public static Pen Dot(Color color, float width) => new Pen(color, width, DottedPattern); /// /// Create a pen with a 'Dot' drawing patterns /// /// The brush. /// The width. /// The Pen public static Pen Dot(IBrush brush, float width) => new Pen(brush, width, DottedPattern); /// /// Create a pen with a 'Dash Dot' drawing patterns /// /// The color. /// The width. /// The Pen public static Pen DashDot(Color color, float width) => new Pen(color, width, DashDotPattern); /// /// Create a pen with a 'Dash Dot' drawing patterns /// /// The brush. /// The width. /// The Pen public static Pen DashDot(IBrush brush, float width) => new Pen(brush, width, DashDotPattern); /// /// Create a pen with a 'Dash Dot Dot' drawing patterns /// /// The color. /// The width. /// The Pen public static Pen DashDotDot(Color color, float width) => new Pen(color, width, DashDotDotPattern); /// /// Create a pen with a 'Dash Dot Dot' drawing patterns /// /// The brush. /// The width. /// The Pen public static Pen DashDotDot(IBrush brush, float width) => new Pen(brush, width, DashDotDotPattern); } }