// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
namespace SixLabors.ImageSharp.Drawing.Processing {
///
/// Defines a pen that can apply a pattern to a line with a set brush and thickness.
///
public class SolidPen : Pen
{
///
/// Initializes a new instance of the class.
///
/// The color.
public SolidPen(Color color)
: base(new SolidBrush(color))
{
}
///
/// Initializes a new instance of the class.
///
/// The color.
/// The width.
public SolidPen(Color color, float width)
: base(new SolidBrush(color), width)
{
}
///
/// Initializes a new instance of the class.
///
/// The brush used to fill the stroke outline.
public SolidPen(Brush strokeFill)
: base(strokeFill)
{
}
///
/// Initializes a new instance of the class.
///
/// The brush used to fill the stroke outline.
/// The stroke width in the path's local coordinate space before any drawing transform is applied.
public SolidPen(Brush strokeFill, float strokeWidth)
: base(strokeFill, strokeWidth)
{
}
///
/// Initializes a new instance of the class.
///
/// The pen options.
public SolidPen(PenOptions options)
: base(options)
{
}
///
public override bool Equals(Pen? other)
{
if (other is SolidPen)
{
return base.Equals(other);
}
return false;
}
///
public override IPath GeneratePath(IPath path, float strokeWidth)
=> path.GenerateOutline(strokeWidth, this.StrokeOptions);
}
}