Path

Composable Function

Common
@Composable
@VectorComposable
fun Path(
    pathData: List<PathNode>,
    pathFillType: PathFillType = DefaultFillType,
    name: String = DefaultPathName,
    fill: Brush? = null,
    fillAlpha: Float = 1.0f,
    stroke: Brush? = null,
    strokeAlpha: Float = 1.0f,
    strokeLineWidth: Float = DefaultStrokeLineWidth,
    strokeLineCap: StrokeCap = DefaultStrokeLineCap,
    strokeLineJoin: StrokeJoin = DefaultStrokeLineJoin,
    strokeLineMiter: Float = DefaultStrokeLineMiter,
    trimPathStart: Float = DefaultTrimPathStart,
    trimPathEnd: Float = DefaultTrimPathEnd,
    trimPathOffset: Float = DefaultTrimPathOffset,
)

Defines a path inside a VectorPainter. This is not a regular UI composable, it can only be called inside composables called from the content parameter to rememberVectorPainter.

Parameters

pathDataList of PathNodes that define the path.
pathFillTypeThe PathFillType that specifies how to fill the path.
nameOptional name of the path used when describing the vector as a string.
fillThe Brush used to fill the path.
fillAlphaThe alpha value to use for fill.
strokeThe Brush used to stroke the path.
strokeAlphaThe alpha value to use for stroke.
strokeLineWidthThe width of the stroke. See Stroke.width for details.
strokeLineCapThe StrokeCap of stroke. See Stroke.cap for details.
strokeLineJoinThe StrokeJoin of stroke. See Stroke.join for details.
strokeLineMiterThe stroke miter value. See Stroke.miter for details.
trimPathStartThe fraction of the path that specifies the start of the clipped region of the path. See PathMeasure.getSegment.
trimPathEndThe fraction of the path that specifies the end of the clipped region of the path. See PathMeasure.getSegment.
trimPathOffsetThe amount to offset both trimPathStart and trimPathEnd.