PathBuilder

Builder for SVG path (<path>) element with path data DSL. This class provides methods to construct complex path data using a fluent API.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun arcTo(rx: Number, ry: Number, xAxisRotation: Number, largeArcFlag: Int, sweepFlag: Int, x: Number, y: Number): PathBuilder

Adds an elliptical arc command (A) to the path, which draws an arc to the specified absolute coordinates.

Link copied to clipboard
fun arcToRelative(rx: Number, ry: Number, xAxisRotation: Number, largeArcFlag: Int, sweepFlag: Int, x: Number, y: Number): PathBuilder

Adds a relative elliptical arc command (a) to the path, which draws an arc to the specified relative coordinates.

Link copied to clipboard
fun attr(name: String, value: Number)

Sets an attribute on the SVG element with a numeric value.

fun attr(name: String, value: String)

Sets an attribute on the SVG element with a string value.

Link copied to clipboard
fun className(value: String)

Sets the class attribute of the SVG element.

Link copied to clipboard
fun clipPath(value: String)

Sets the clip-path attribute of the SVG element.

Link copied to clipboard

Adds a "close path" command (Z) to the path, which closes the current subpath by drawing a straight line back to the start point.

Link copied to clipboard
fun curveTo(x1: Number, y1: Number, x2: Number, y2: Number, x: Number, y: Number): PathBuilder

Adds a cubic Bezier curve command (C) to the path, which draws a curve to the specified absolute coordinates using two control points.

Link copied to clipboard

Adds a relative cubic Bezier curve command (c) to the path, which draws a curve to the specified relative coordinates using two control points.

Link copied to clipboard
fun d(value: String)

Sets the d attribute of the path, which defines the path data.

Link copied to clipboard
fun fill(color: Color)

Sets the fill attribute of the SVG element with a Color object.

fun fill(color: String)

Sets the fill attribute of the SVG element with a color string.

Link copied to clipboard
fun fillOpacity(value: Number)

Sets the fill-opacity attribute of the SVG element.

Link copied to clipboard
fun fillRule(value: String)

Sets the fill-rule attribute of the SVG element.

Link copied to clipboard
fun filter(value: String)

Sets the filter attribute of the SVG element.

Link copied to clipboard

Adds a "horizontal line to" command (H) to the path, which draws a horizontal line to the specified absolute x-coordinate.

Link copied to clipboard

Adds a relative "horizontal line to" command (h) to the path, which draws a horizontal line to the specified relative x-offset.

Link copied to clipboard
fun id(value: String)

Sets the id attribute of the SVG element.

Link copied to clipboard

Adds a "line to" command (L) to the path, which draws a straight line to the specified absolute coordinates.

Link copied to clipboard

Adds a relative "line to" command (l) to the path, which draws a straight line to the specified relative coordinates.

Link copied to clipboard
fun mask(value: String)

Sets the mask attribute of the SVG element.

Link copied to clipboard

Adds a "move to" command (M) to the path, which moves the pen to the specified absolute coordinates.

Link copied to clipboard

Adds a relative "move to" command (m) to the path, which moves the pen to the specified relative coordinates.

Link copied to clipboard
fun opacity(value: Number)

Sets the opacity attribute of the SVG element.

Link copied to clipboard

Adds a quadratic Bezier curve command (Q) to the path, which draws a curve to the specified absolute coordinates using one control point.

Link copied to clipboard

Adds a relative quadratic Bezier curve command (q) to the path, which draws a curve to the specified relative coordinates using one control point.

Link copied to clipboard

Adds a smooth cubic Bezier curve command (S) to the path, which draws a curve to the specified absolute coordinates using one control point.

Link copied to clipboard

Adds a relative smooth cubic Bezier curve command (s) to the path, which draws a curve to the specified relative coordinates using one control point.

Link copied to clipboard

Adds a smooth quadratic Bezier curve command (T) to the path, which draws a curve to the specified absolute coordinates.

Link copied to clipboard

Adds a relative smooth quadratic Bezier curve command (t) to the path, which draws a curve to the specified relative coordinates.

Link copied to clipboard
fun stroke(color: Color)

Sets the stroke attribute of the SVG element with a Color object.

fun stroke(color: String)

Sets the stroke attribute of the SVG element with a color string.

Link copied to clipboard

Sets the stroke-dasharray attribute of the SVG element.

Link copied to clipboard

Sets the stroke-dashoffset attribute of the SVG element.

Link copied to clipboard
fun strokeLinecap(value: String)

Sets the stroke-linecap attribute of the SVG element.

Link copied to clipboard

Sets the stroke-linejoin attribute of the SVG element.

Link copied to clipboard
fun strokeOpacity(value: Number)

Sets the stroke-opacity attribute of the SVG element.

Link copied to clipboard
fun strokeWidth(value: Number)

Sets the stroke-width attribute of the SVG element.

Link copied to clipboard
fun style(value: String)

Sets the style attribute of the SVG element.

Link copied to clipboard
fun transform(value: String)

Sets the transform attribute of the SVG element.

Link copied to clipboard

Adds a "vertical line to" command (V) to the path, which draws a vertical line to the specified absolute y-coordinate.

Link copied to clipboard

Adds a relative "vertical line to" command (v) to the path, which draws a vertical line to the specified relative y-offset.