🌈 Create new beautiful Compose Gradients with our new wesite ->
Class

Stroke

DrawStyle that provides information for drawing content with a stroke

Source set: Common
public class Stroke(
    public val width: Float = 0.0f,
    public val miter: Float = DefaultMiter,
    public val cap: StrokeCap = DefaultCap,
    public val join: StrokeJoin = DefaultJoin,
    public val pathEffect: PathEffect? = null,
) : DrawStyle()

DrawStyle that provides information for drawing content with a stroke

Parameters

width Configure the width of the stroke in pixels
miter Set the stroke miter value. This is used to control the behavior of miter joins when the joins angle is sharp. This value must be >= 0
cap Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated. The default is StrokeCap.Butt
join Set's the treatment where lines and curve segments join on a stroked path. The default is StrokeJoin.Miter
pathEffect Effect to apply to the stroke, null indicates a solid stroke line is to be drawn

Members

Companion

Source set: Common
public companion object

Properties

HairlineWidth

Source set: Common
public const val HairlineWidth: Float = 0.0f

Width to indicate a hairline stroke of 1 pixel

DefaultMiter

Source set: Common
public const val DefaultMiter: Float = 4.0f

Default miter length used in combination with joins

DefaultCap

Source set: Common
public val DefaultCap: StrokeCap = StrokeCap.Butt

Default cap used for line endings

DefaultJoin

Source set: Common
public val DefaultJoin: StrokeJoin = StrokeJoin.Miter

Default join style used for connections between line and curve segments