fillRoundRect

fun Canvas.fillRoundRect(x: Int, y: Int, width: Int, height: Int, roundness: Float, segments: Int = 0, color: Color = Color.BLACK)

Draws a filled rounded rectangle on the canvas.

Parameters

x

The X coordinate of the rectangle top-left corner

y

The Y coordinate of the rectangle top-left corner

width

The width of the rectangle

height

The height of the rectangle

roundness

The roundness of the rectangle corners as a percentage (0.0 - 1.0)

segments

The number of segments to use for drawing the rounded

color

The color of the rectangle