SVGBuilderExtensions.AddPolygon

AddPolygon<TBuilder>(this TBuilder, double[], OneOf<Color, Paint, string>, OneOf<Color, Paint, string>, string, Action<SVGPolygonElementBuilder>)

Adds a ‘polygon’ element to the SVG builder, specifying its vertices, and styles.

public static TBuilder AddPolygon<TBuilder>(this TBuilder builder, double[] points, 
    OneOf<Color, Paint, string> fill = null, OneOf<Color, Paint, string> stroke = null, 
    string id = null, Action<SVGPolygonElementBuilder> extend = null)
    where TBuilder : ISVGElementBuilder, IShapeElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder, facilitating fluent API usage.
builderThe SVG builder instance to which the ‘polygon’ element will be added.
pointsAn array of doubles representing the points of the polygon (alternating x and y coordinates).
fillThe fill color or paint style for the polygon. Can be a Color or a Paint enum value or paint server ID. Optional parameter.
strokeThe stroke color or paint style for the polygon. Can be a Color or a Paint enum value or paint server ID. Optional parameter.
idThe unique identifier for the polygon element. Optional parameter.
extendAn optional action to further configure the polygon element builder.

Return Value

The builder instance, allowing for method chaining.

See Also


AddPolygon<TBuilder>(this TBuilder, Action<SVGPolygonElementBuilder>)

Adds a ‘polygon’ element configuration to the builder.

public static TBuilder AddPolygon<TBuilder>(this TBuilder builder, 
    Action<SVGPolygonElementBuilder> configure)
    where TBuilder : ISVGElementBuilder, IShapeElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder.
builderThe builder instance.
configureThe configuration action for the ‘polygon’ element.

Return Value

The builder instance for chaining.

See Also