circle

fun circle(diameter: Dp, fill: PdfColor? = null, fillPaint: PdfPaint? = null, strokeColor: PdfColor? = null, strokeWidth: Dp = Dp.Zero)

Appends a circle of the given diameter. The circle is drawn from a 4-cubic-Bézier path so it stays smooth at any zoom level.

Pass either fill (solid colour shorthand), fillPaint (gradient), or both — fillPaint takes precedence when both are supplied. To draw an outline-only circle, leave both fill parameters null and supply strokeColor + strokeWidth.

Parameters

diameter

outer diameter of the circle.

fill

solid fill colour. Skipped when null.

fillPaint

optional gradient / paint fill. Wins over fill.

strokeColor

optional outline colour. Stroke is skipped if null or strokeWidth is Dp.Zero.

strokeWidth

outline thickness.