SVGBuilderExtensions.AddLinearGradient

AddLinearGradient<TBuilder>(this TBuilder, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, OneOf<double, (double, LengthType)>, CoordinateUnits?, SpreadMethod?, string, string, Action<SVGLinearGradientElementBuilder>)

Adds a ’linearGradient’ element to the SVG builder, specifying its start and end positions, along with other gradient properties.

public static TBuilder AddLinearGradient<TBuilder>(this TBuilder builder, 
    OneOf<double, (double, LengthType)> x1, OneOf<double, (double, LengthType)> y1, 
    OneOf<double, (double, LengthType)> x2, OneOf<double, (double, LengthType)> y2, 
    CoordinateUnits? gradientUnits, SpreadMethod? spreadMethod, string href = null, 
    string id = null, Action<SVGLinearGradientElementBuilder> 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 ’linearGradient’ element will be added.
x1The starting x-coordinate for the gradient. Can be a double or a ValueTuple with LengthType.
y1The starting y-coordinate for the gradient. Can be a double or a ValueTuple with LengthType.
x2The ending x-coordinate for the gradient. Can be a double or a ValueTuple with LengthType.
y2The ending y-coordinate for the gradient. Can be a double or a ValueTuple with LengthType.
gradientUnitsSpecifies the coordinate system for the gradient. Optional parameter.
spreadMethodDefines how the gradient spreads beyond its start and end points. Optional parameter.
hrefThe reference to another gradient, if applicable. Optional parameter.
idThe unique identifier for the gradient element. Optional parameter.
extendAn optional action to further configure the linear gradient element builder.

Return Value

The builder instance, allowing for method chaining.

See Also


AddLinearGradient<TBuilder>(this TBuilder, Action<SVGLinearGradientElementBuilder>)

Adds a ’linearGradient’ element configuration to the builder.

public static TBuilder AddLinearGradient<TBuilder>(this TBuilder builder, 
    Action<SVGLinearGradientElementBuilder> configure)
    where TBuilder : ISVGElementBuilder, IPaintServerElementBuilder
ParameterDescription
TBuilderThe type of the SVG element builder.
builderThe builder instance.
configureThe configuration action for the ’linearGradient’ element.

Return Value

The builder instance for chaining.

See Also